detach -> release
The C++ standard library uses the name "release" for the operation we call "detach".
Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).
This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002
Review URL: https://codereview.chromium.org/1809733002
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index f56a4e4..e04adee 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -713,7 +713,7 @@
}
}
- return texture.detach();
+ return texture.release();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/GrContextFactory.cpp b/src/gpu/GrContextFactory.cpp
index b7e4825..bcf0c32 100755
--- a/src/gpu/GrContextFactory.cpp
+++ b/src/gpu/GrContextFactory.cpp
@@ -143,7 +143,7 @@
}
Context& context = fContexts.push_back();
- context.fGLContext = glCtx.detach();
+ context.fGLContext = glCtx.release();
context.fGrContext = SkRef(grCtx.get());
context.fType = type;
context.fOptions = options;
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index afeeda7..512ce9b 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -477,7 +477,7 @@
return specs;
}
const MultisampleSpecs& specs = *new (&fMultisampleSpecsAllocator)
- MultisampleSpecs{effectiveKey, effectiveSampleCnt, locations.detach()};
+ MultisampleSpecs{effectiveKey, effectiveSampleCnt, locations.release()};
if (fMultisampleSpecsMap.count() <= effectiveKey) {
int n = 1 + effectiveKey - fMultisampleSpecsMap.count();
fMultisampleSpecsMap.push_back_n(n, (const MultisampleSpecs*) nullptr);
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index 7affae6..429a63a 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -119,7 +119,7 @@
SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtDesc.fHeight));
drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRect, localRect);
- return copy.detach();
+ return copy.release();
}
GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
diff --git a/src/gpu/GrYUVProvider.cpp b/src/gpu/GrYUVProvider.cpp
index 708cbec..f35c6df 100644
--- a/src/gpu/GrYUVProvider.cpp
+++ b/src/gpu/GrYUVProvider.cpp
@@ -141,6 +141,6 @@
drawContext->drawRect(GrClip::WideOpen(), paint, SkMatrix::I(), r);
- return result.detach();
+ return result.release();
}
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7a6d967..173fe30 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -335,7 +335,7 @@
SkASSERT(fRenderTarget != newRT);
- fRenderTarget.reset(newRT.detach());
+ fRenderTarget.reset(newRT.release());
#ifdef SK_DEBUG
SkImageInfo info = fRenderTarget->surfacePriv().info(fOpaque ? kOpaque_SkAlphaType :
diff --git a/src/gpu/batches/GrDrawPathBatch.cpp b/src/gpu/batches/GrDrawPathBatch.cpp
index a99f4eb..b115858 100644
--- a/src/gpu/batches/GrDrawPathBatch.cpp
+++ b/src/gpu/batches/GrDrawPathBatch.cpp
@@ -99,7 +99,7 @@
fTotalPathCount += that->fTotalPathCount;
while (Draw* head = that->fDraws.head()) {
Draw* draw = fDraws.addToTail();
- draw->fInstanceData.reset(head->fInstanceData.detach());
+ draw->fInstanceData.reset(head->fInstanceData.release());
draw->fX = head->fX;
draw->fY = head->fY;
that->fDraws.popHead();
diff --git a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
index ada6dbf..cf43173 100644
--- a/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
+++ b/src/gpu/batches/GrStencilAndCoverPathRenderer.cpp
@@ -60,7 +60,7 @@
} else {
SkASSERT(path->isEqualTo(skPath, stroke));
}
- return path.detach();
+ return path.release();
}
void GrStencilAndCoverPathRenderer::onStencilPath(const StencilPathArgs& args) {
diff --git a/src/gpu/gl/GrGLExtensions.cpp b/src/gpu/gl/GrGLExtensions.cpp
index 1ddc101..43a147d 100644
--- a/src/gpu/gl/GrGLExtensions.cpp
+++ b/src/gpu/gl/GrGLExtensions.cpp
@@ -125,7 +125,7 @@
if (idx >= 0) {
// This is not terribly effecient but we really only expect this function to be called at
// most a handful of times when our test programs start.
- SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.detach());
+ SkAutoTDelete< SkTArray<SkString> > oldStrings(fStrings.release());
fStrings.reset(new SkTArray<SkString>(oldStrings->count() - 1));
fStrings->push_back_n(idx, &oldStrings->front());
fStrings->push_back_n(oldStrings->count() - idx - 1, &(*oldStrings)[idx] + 1);
diff --git a/src/gpu/gl/SkGLContext.cpp b/src/gpu/gl/SkGLContext.cpp
index 01f827c..ebe5032 100644
--- a/src/gpu/gl/SkGLContext.cpp
+++ b/src/gpu/gl/SkGLContext.cpp
@@ -140,7 +140,7 @@
return nullptr;
}
- return ret.detach();
+ return ret.release();
}
SkPlatformGpuFence SkGLContext::GLFenceSync::insertFence() const {
diff --git a/src/gpu/gl/angle/SkANGLEGLContext.cpp b/src/gpu/gl/angle/SkANGLEGLContext.cpp
index 2c9f38e..0e37a7e 100644
--- a/src/gpu/gl/angle/SkANGLEGLContext.cpp
+++ b/src/gpu/gl/angle/SkANGLEGLContext.cpp
@@ -123,7 +123,7 @@
return;
}
- this->init(gl.detach());
+ this->init(gl.release());
}
SkANGLEGLContext::~SkANGLEGLContext() {
diff --git a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp
index cf9da93..b14debd 100644
--- a/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp
+++ b/src/gpu/gl/command_buffer/SkCommandBufferGLContext.cpp
@@ -259,7 +259,7 @@
return;
}
- this->init(gl.detach());
+ this->init(gl.release());
}
SkCommandBufferGLContext::~SkCommandBufferGLContext() {
diff --git a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
index bf93973..09b7323 100644
--- a/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
+++ b/src/gpu/gl/egl/SkCreatePlatformGLContext_egl.cpp
@@ -179,7 +179,7 @@
continue;
}
- this->init(gl.detach(), SkEGLFenceSync::CreateIfSupported(fDisplay));
+ this->init(gl.release(), SkEGLFenceSync::CreateIfSupported(fDisplay));
break;
}
}
diff --git a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
index 51b8ce9..b91262f 100644
--- a/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
+++ b/src/gpu/gl/glx/SkCreatePlatformGLContext_glx.cpp
@@ -284,7 +284,7 @@
return;
}
- this->init(gl.detach());
+ this->init(gl.release());
}
diff --git a/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm b/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
index 5be351f..54dc59a 100644
--- a/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
+++ b/src/gpu/gl/iOS/SkCreatePlatformGLContext_iOS.mm
@@ -53,7 +53,7 @@
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib",
RTLD_LAZY);
- this->init(gl.detach());
+ this->init(gl.release());
}
IOSGLContext::~IOSGLContext() {
diff --git a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
index d1826a4..c6eb34b 100644
--- a/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
+++ b/src/gpu/gl/mac/SkCreatePlatformGLContext_mac.cpp
@@ -77,7 +77,7 @@
"/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib",
RTLD_LAZY);
- this->init(gl.detach());
+ this->init(gl.release());
}
MacGLContext::~MacGLContext() {
diff --git a/src/gpu/gl/mesa/SkMesaGLContext.cpp b/src/gpu/gl/mesa/SkMesaGLContext.cpp
index 541b247..8b3666c 100644
--- a/src/gpu/gl/mesa/SkMesaGLContext.cpp
+++ b/src/gpu/gl/mesa/SkMesaGLContext.cpp
@@ -63,7 +63,7 @@
return;
}
- this->init(gl.detach());
+ this->init(gl.release());
}
SkMesaGLContext::~SkMesaGLContext() {
diff --git a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
index 6cc1143..da13ee7 100644
--- a/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
+++ b/src/gpu/gl/win/SkCreatePlatformGLContext_win.cpp
@@ -127,7 +127,7 @@
return;
}
- this->init(gl.detach());
+ this->init(gl.release());
}
WinGLContext::~WinGLContext() {