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

Unified Diff: gm/shadows.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard google3 Created 4 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 | « gm/rects.cpp ('k') | gm/textbloblooper.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 5696240d21ed3ca00b7603b0b8ce0ff53b6e3c85..6263af29bf6334272c281720765016379000f9f4 100644
--- a/gm/shadows.cpp
+++ b/gm/shadows.cpp
@@ -54,45 +54,36 @@ protected:
}
void onDraw(SkCanvas* canvas) override {
- SkDrawLooper* shadowLoopers[5];
- shadowLoopers[0] =
- SkBlurDrawLooper::Create(SK_ColorBLUE,
+ sk_sp<SkDrawLooper> shadowLoopers[] = {
+ SkBlurDrawLooper::Make(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] =
- SkBlurDrawLooper::Create(SK_ColorBLUE,
+ SkBlurDrawLooper::kHighQuality_BlurFlag),
+ SkBlurDrawLooper::Make(SK_ColorBLUE,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(10)),
SkIntToScalar(5), SkIntToScalar(10),
SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kOverrideColor_BlurFlag);
- SkAutoUnref aurL1(shadowLoopers[1]);
- shadowLoopers[2] =
- SkBlurDrawLooper::Create(SK_ColorBLACK,
+ SkBlurDrawLooper::kOverrideColor_BlurFlag),
+ SkBlurDrawLooper::Make(SK_ColorBLACK,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
SkIntToScalar(5),
SkIntToScalar(10),
SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL2(shadowLoopers[2]);
- shadowLoopers[3] =
- SkBlurDrawLooper::Create(0x7FFF0000,
+ SkBlurDrawLooper::kHighQuality_BlurFlag),
+ SkBlurDrawLooper::Make(0x7FFF0000,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
SkIntToScalar(-5), SkIntToScalar(-10),
SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL3(shadowLoopers[3]);
- shadowLoopers[4] =
- SkBlurDrawLooper::Create(SK_ColorBLACK, SkIntToScalar(0),
+ SkBlurDrawLooper::kHighQuality_BlurFlag),
+ SkBlurDrawLooper::Make(SK_ColorBLACK, SkIntToScalar(0),
SkIntToScalar(5), SkIntToScalar(5),
SkBlurDrawLooper::kIgnoreTransform_BlurFlag |
SkBlurDrawLooper::kOverrideColor_BlurFlag |
- SkBlurDrawLooper::kHighQuality_BlurFlag);
- SkAutoUnref aurL4(shadowLoopers[4]);
+ SkBlurDrawLooper::kHighQuality_BlurFlag),
+ };
static const struct {
SkColor fColor;
« no previous file with comments | « gm/rects.cpp ('k') | gm/textbloblooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698