aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGr.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-09-01 08:34:28 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-01 08:34:28 -0700
commitc9a3706f1ee38c331610ec1e872d9a658566c397 (patch)
treea202dd4d7a9f3d42732483988a8e5a16e13aac36 /src/gpu/SkGr.cpp
parentdac7005b877c7c1c6f36b6e298133dfc7b85b9c0 (diff)
Limit lifetime of GrDrawContext objects
GrDrawContext's are about to become real allocated objects. This CL sets up the machinery so they won't leak. Review URL: https://codereview.chromium.org/1321353002
Diffstat (limited to 'src/gpu/SkGr.cpp')
-rw-r--r--src/gpu/SkGr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 4293194de3..29c4572859 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -312,7 +312,7 @@ GrTexture* stretch_texture(GrTexture* inputTexture, const Stretch& stretch,
SkRect rect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar(rtDesc.fHeight));
SkRect localRect = SkRect::MakeWH(1.f, 1.f);
- GrDrawContext* drawContext = context->drawContext();
+ SkAutoTUnref<GrDrawContext> drawContext(context->drawContext());
if (!drawContext) {
return nullptr;
}
@@ -473,7 +473,7 @@ static GrTexture* load_yuv_texture(GrContext* ctx, const GrUniqueKey& optionalKe
SkRect r = SkRect::MakeWH(SkIntToScalar(yuvInfo.fSize[0].fWidth),
SkIntToScalar(yuvInfo.fSize[0].fHeight));
- GrDrawContext* drawContext = ctx->drawContext();
+ SkAutoTUnref<GrDrawContext> drawContext(ctx->drawContext());
if (!drawContext) {
return nullptr;
}