aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGpuDevice.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c3754dcada..874ed8e422 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -130,8 +130,10 @@ static SkBitmap::Config grConfig2skConfig(GrPixelConfig config, bool* isOpaque)
}
static SkBitmap make_bitmap(GrContext* context, GrRenderTarget* renderTarget) {
+ SkAutoTUnref<GrRenderTarget> rtunref;
if (SkGpuDevice::Current3DApiRenderTarget() == renderTarget) {
renderTarget = context->createRenderTargetFrom3DApiState();
+ rtunref.reset(renderTarget);
}
GrTexture* texture = renderTarget->asTexture();
GrPixelConfig config = texture ? texture->config() : kRGBA_8888_GrPixelConfig;