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

Unified Diff: gm/megalooper.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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/largeglyphblur.cpp ('k') | gm/rects.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/megalooper.cpp
diff --git a/gm/megalooper.cpp b/gm/megalooper.cpp
index 6f5640272fc068de9f84b80341c69c3c8c77b7c3..385c60efb10869a4a0567e0c7e5c4e533661a26e 100644
--- a/gm/megalooper.cpp
+++ b/gm/megalooper.cpp
@@ -96,7 +96,7 @@ private:
SkPaint paint;
paint.setAntiAlias(true);
- paint.setMaskFilter(createBlur())->unref();
+ paint.setMaskFilter(MakeBlur());
for (int i = 0; i < 4; ++i) {
paint.setColor(gColors[i]);
@@ -110,11 +110,11 @@ private:
canvas->restore();
}
- SkMaskFilter* createBlur() {
+ static sk_sp<SkMaskFilter> MakeBlur() {
static const SkScalar kBlurSigma = SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(25));
- return SkBlurMaskFilter::Create(kNormal_SkBlurStyle, kBlurSigma,
- SkBlurMaskFilter::kHighQuality_BlurFlag);
+ return SkBlurMaskFilter::Make(kNormal_SkBlurStyle, kBlurSigma,
+ SkBlurMaskFilter::kHighQuality_BlurFlag);
}
// This draws 4 blurred shadows around a single square (centered at x, y).
@@ -173,7 +173,7 @@ private:
SkPaint* paint = looperBuilder.addLayer(info);
- paint->setMaskFilter(this->createBlur())->unref();
+ paint->setMaskFilter(MakeBlur());
paint->setColorFilter(SkColorFilter::MakeModeFilter(color, SkXfermode::kSrcIn_Mode));
@@ -219,7 +219,7 @@ private:
info.fOffset.set(xOff+gBlurOffsets[i].fX, yOff+gBlurOffsets[i].fY);
paint = looperBuilder.addLayer(info);
- paint->setMaskFilter(this->createBlur())->unref();
+ paint->setMaskFilter(MakeBlur());
paint->setColorFilter(SkColorFilter::MakeModeFilter(gColors[i],
SkXfermode::kSrcIn_Mode));
« no previous file with comments | « gm/largeglyphblur.cpp ('k') | gm/rects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698