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

Unified Diff: gm/shadows.cpp

Issue 232913003: Make sure SkDrawLooper objects can only be allocated on the heap. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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 | « gm/rects.cpp ('k') | gm/tilemodes_scaled.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/shadows.cpp
diff --git a/gm/shadows.cpp b/gm/shadows.cpp
index d0d23a8047364ca11fc02f00c17bf62faa1458ca..44fa8e22bfa423aa2d46c0e2c6bca9634f4b2e93 100644
--- a/gm/shadows.cpp
+++ b/gm/shadows.cpp
@@ -47,42 +47,42 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkBlurDrawLooper* shadowLoopers[5];
shadowLoopers[0] =
- new SkBlurDrawLooper (SK_ColorBLUE,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
- SkIntToScalar(5), SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkBlurDrawLooper::Create(SK_ColorBLUE,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
+ SkIntToScalar(5), SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
SkAutoUnref aurL0(shadowLoopers[0]);
shadowLoopers[1] =
- new SkBlurDrawLooper (SK_ColorBLUE,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
- SkIntToScalar(5), SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag);
+ SkBlurDrawLooper::Create(SK_ColorBLUE,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
+ SkIntToScalar(5), SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag);
SkAutoUnref aurL1(shadowLoopers[1]);
shadowLoopers[2] =
- new SkBlurDrawLooper (SK_ColorBLACK,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
- SkIntToScalar(5),
- SkIntToScalar(10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkBlurDrawLooper::Create(SK_ColorBLACK,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
+ SkIntToScalar(5),
+ SkIntToScalar(10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
SkAutoUnref aurL2(shadowLoopers[2]);
shadowLoopers[3] =
- new SkBlurDrawLooper (0x7FFF0000,
- SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
- SkIntToScalar(-5), SkIntToScalar(-10),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkBlurDrawLooper::Create(0x7FFF0000,
+ SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
+ SkIntToScalar(-5), SkIntToScalar(-10),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
SkAutoUnref aurL3(shadowLoopers[3]);
shadowLoopers[4] =
- new SkBlurDrawLooper (SK_ColorBLACK, SkIntToScalar(0),
- SkIntToScalar(5), SkIntToScalar(5),
- SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
+ SkBlurDrawLooper::Create(SK_ColorBLACK, SkIntToScalar(0),
+ SkIntToScalar(5), SkIntToScalar(5),
+ SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
+ SkBlurDrawLooper::kOverrideColor_BlurFlag |
+ SkBlurDrawLooper::kHighQuality_BlurFlag);
SkAutoUnref aurL4(shadowLoopers[4]);
static const struct {
« no previous file with comments | « gm/rects.cpp ('k') | gm/tilemodes_scaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698