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
This commit is contained in:
commit-bot@chromium.org 2014-01-31 14:00:58 +00:00
parent 5c3b335bb8
commit a29105ad10

View File

@ -527,11 +527,12 @@ public:
*/ */
static GrEffectRef* Create(GrContext *context, const SkRect& rect, static GrEffectRef* Create(GrContext *context, const SkRect& rect,
float sigma) { float sigma) {
GrTexture *horizontalScanline, *verticalScanline; GrTexture *horizontalScanline = NULL, *verticalScanline = NULL;
bool createdScanlines = CreateScanlineTextures(context, sigma, bool createdScanlines = CreateScanlineTextures(context, sigma,
SkScalarCeilToInt(rect.width()), SkScalarCeilToInt(rect.width()),
SkScalarCeilToInt(rect.height()), SkScalarCeilToInt(rect.height()),
&horizontalScanline, &verticalScanline); &horizontalScanline, &verticalScanline);
SkAutoTUnref<GrTexture> hunref(horizontalScanline), vunref(verticalScanline);
if (!createdScanlines) { if (!createdScanlines) {
return NULL; return NULL;
} }
@ -686,6 +687,7 @@ bool GrRectBlurEffect::CreateScanlineTextures(GrContext *context, float sigma,
verticalPixels, 0); verticalPixels, 0);
if (NULL == *verticalScanline) { if (NULL == *verticalScanline) {
(*horizontalScanline)->unref();
return false; return false;
} }