diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-31 14:00:58 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-01-31 14:00:58 +0000 |
commit | a29105ad1049939dafa01fbb76d00c5a401de3f3 (patch) | |
tree | 2accbbd67c938ec78b6ed70a8bdfa7e1bd668449 /src/effects | |
parent | 5c3b335bb886dc8eb21b596b2b70a51814010363 (diff) |
release the scanline textures in GrRectBlurEffect
BUG=skia:
R=robertphillips@google.com
Author: humper@google.com
Review URL: https://codereview.chromium.org/131163007
git-svn-id: http://skia.googlecode.com/svn/trunk@13260 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkBlurMaskFilter.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 5cb98153f0..9b3354484b 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -527,17 +527,18 @@ public: */ static GrEffectRef* Create(GrContext *context, const SkRect& rect, float sigma) { - GrTexture *horizontalScanline, *verticalScanline; + GrTexture *horizontalScanline = NULL, *verticalScanline = NULL; bool createdScanlines = CreateScanlineTextures(context, sigma, SkScalarCeilToInt(rect.width()), SkScalarCeilToInt(rect.height()), &horizontalScanline, &verticalScanline); - if (!createdScanlines) { + SkAutoTUnref<GrTexture> hunref(horizontalScanline), vunref(verticalScanline); + if (!createdScanlines) { return NULL; } AutoEffectUnref effect(SkNEW_ARGS(GrRectBlurEffect, (rect, sigma, horizontalScanline, verticalScanline))); - return CreateEffectRef(effect); + return CreateEffectRef(effect); } unsigned int getWidth() const { return fWidth; } @@ -686,6 +687,7 @@ bool GrRectBlurEffect::CreateScanlineTextures(GrContext *context, float sigma, verticalPixels, 0); if (NULL == *verticalScanline) { + (*horizontalScanline)->unref(); return false; } |