Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 997923002: fix for valgrind preAbandonGpuContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for valgrind leak Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrCoordTransform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 491f5983d8c5da29577890d05b38a90ee1b78909..e363f7b4c7652c83e66a3621013404042bfbdd13 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -927,9 +927,9 @@ GrFragmentProcessor* GrRRectBlurEffect::Create(GrContext* context, float sigma,
builder[1] = cornerRadius;
builder.finish();
- GrTexture *blurNinePatchTexture = context->findAndRefCachedTexture(key);
+ SkAutoTUnref<GrTexture> blurNinePatchTexture(context->findAndRefCachedTexture(key));
- if (NULL == blurNinePatchTexture) {
+ if (!blurNinePatchTexture) {
SkMask mask;
unsigned int smallRectSide = 2*(blurRadius + cornerRadius) + 1;
@@ -954,8 +954,8 @@ GrFragmentProcessor* GrRRectBlurEffect::Create(GrContext* context, float sigma,
SkDraw::DrawToMask(path, &mask.fBounds, NULL, NULL, &mask,
SkMask::kJustRenderImage_CreateMode, SkPaint::kFill_Style);
- SkMask blurred_mask;
- SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHigh_SkBlurQuality,
+ SkMask blurredMask;
+ SkBlurMask::BoxBlur(&blurredMask, mask, sigma, kNormal_SkBlurStyle, kHigh_SkBlurQuality,
NULL, true );
unsigned int texSide = smallRectSide + 2*blurRadius;
@@ -964,20 +964,13 @@ GrFragmentProcessor* GrRRectBlurEffect::Create(GrContext* context, float sigma,
texDesc.fHeight = texSide;
texDesc.fConfig = kAlpha_8_GrPixelConfig;
- blurNinePatchTexture = context->createTexture(texDesc, true, blurred_mask.fImage, 0);
+ blurNinePatchTexture.reset(context->createTexture(texDesc, true, blurredMask.fImage, 0));
+ SkMask::FreeImage(blurredMask.fImage);
if (!blurNinePatchTexture) {
return NULL;
}
context->addResourceToCache(key, blurNinePatchTexture);
-
- SkMask::FreeImage(blurred_mask.fImage);
}
-
- SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture);
- if (NULL == blurNinePatchTexture) {
- return NULL;
- }
-
return SkNEW_ARGS(GrRRectBlurEffect, (sigma, rrect, blurNinePatchTexture));
}
« no previous file with comments | « include/gpu/GrCoordTransform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698