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

Unified Diff: tests/ImageFilterTest.cpp

Issue 59713010: Address some more valgrind issues (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 0722d141537773d5a53947c01aed6c562bdc5693..2328627d7cff6be4439ff8631bc6d6b99b8bbc1d 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -130,11 +130,12 @@ public:
// 3 ) large negative specular exponent value
SkScalar specularExponent = SkFloatToScalar(-1000);
robertphillips 2013/11/14 14:21:41 This addresses two problems like: 120 (112 direct
+ SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
SkPaint paint;
paint.setImageFilter(SkLightingImageFilter::CreateSpotLitSpecular(
location, target, specularExponent, SkFloatToScalar(180),
0xFFFFFFFF, SK_Scalar1, SK_Scalar1, SK_Scalar1,
- new SkBitmapSource(bitmap)))->unref();
+ bmSrc))->unref();
SkCanvas canvas(result);
SkRect r = SkRect::MakeWH(SkIntToScalar(kBitmapSize),
SkIntToScalar(kBitmapSize));
@@ -144,9 +145,9 @@ public:
{
// This tests for scale bringing width to 0
SkSize scale = SkSize::Make(SkFloatToScalar(-0.001f), SK_Scalar1);
+ SkAutoTUnref<SkImageFilter> bmSrc(new SkBitmapSource(bitmap));
SkAutoTUnref<SkBicubicImageFilter> bicubic(
- SkBicubicImageFilter::CreateMitchell(
- scale, new SkBitmapSource(bitmap)));
+ SkBicubicImageFilter::CreateMitchell(scale, bmSrc));
SkBitmapDevice device(bitmap);
SkDeviceImageFilterProxy proxy(&device);
SkIPoint loc = SkIPoint::Make(0, 0);

Powered by Google App Engine
This is Rietveld 408576698