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

Side by Side Diff: src/effects/SkBlurMaskFilter.cpp

Issue 256273002: fix leaks in blurrrect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 899
900 SkPath path; 900 SkPath path;
901 path.addRRect( smallRRect ); 901 path.addRRect( smallRRect );
902 902
903 SkDraw::DrawToMask(path, &mask.fBounds, NULL, NULL, &mask, SkMask::kJust RenderImage_CreateMode, SkPaint::kFill_Style); 903 SkDraw::DrawToMask(path, &mask.fBounds, NULL, NULL, &mask, SkMask::kJust RenderImage_CreateMode, SkPaint::kFill_Style);
904 904
905 SkMask blurred_mask; 905 SkMask blurred_mask;
906 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi gh_SkBlurQuality, NULL, true ); 906 SkBlurMask::BoxBlur(&blurred_mask, mask, sigma, kNormal_SkBlurStyle, kHi gh_SkBlurQuality, NULL, true );
907 907
908 blurNinePatchTexture = context->createTexture(&params, texDesc, blurRRec tNinePatchID, blurred_mask.fImage, 0); 908 blurNinePatchTexture = context->createTexture(&params, texDesc, blurRRec tNinePatchID, blurred_mask.fImage, 0);
909 SkMask::FreeImage(blurred_mask.fImage);
909 } 910 }
910 911
912 SkAutoTUnref<GrTexture> blurunref(blurNinePatchTexture);
911 if (NULL == blurNinePatchTexture) { 913 if (NULL == blurNinePatchTexture) {
912 return NULL; 914 return NULL;
913 } 915 }
914 916
915 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrRRectBlurEffect, 917 return CreateEffectRef(AutoEffectUnref(SkNEW_ARGS(GrRRectBlurEffect,
916 (sigma, rrect, blurNinePat chTexture)))); 918 (sigma, rrect, blurNinePat chTexture))));
917 } 919 }
918 920
919 void GrRRectBlurEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const { 921 void GrRRectBlurEffect::getConstantColorComponents(GrColor* color, uint32_t* val idFlags) const {
920 *validFlags = 0; 922 *validFlags = 0;
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 } else { 1207 } else {
1206 str->append("None"); 1208 str->append("None");
1207 } 1209 }
1208 str->append("))"); 1210 str->append("))");
1209 } 1211 }
1210 #endif 1212 #endif
1211 1213
1212 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1213 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1215 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1214 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1216 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698