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,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;
}