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

Unified Diff: gm/blurs.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/blurroundrect.cpp ('k') | gm/circles.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/blurs.cpp
diff --git a/gm/blurs.cpp b/gm/blurs.cpp
index 8f2137eeabc651ca587bd941241a865a9489e1a7..8fa97b886b10fe9e617dc6071d9c907647371312 100644
--- a/gm/blurs.cpp
+++ b/gm/blurs.cpp
@@ -35,10 +35,9 @@ DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD
paint.setColor(SK_ColorBLUE);
for (size_t i = 0; i < SK_ARRAY_COUNT(gRecs); i++) {
if (gRecs[i].fStyle != NONE) {
- SkMaskFilter* mf = SkBlurMaskFilter::Create(gRecs[i].fStyle,
+ paint.setMaskFilter(SkBlurMaskFilter::Make(gRecs[i].fStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(20)),
- flags);
- paint.setMaskFilter(mf)->unref();
+ flags));
} else {
paint.setMaskFilter(nullptr);
}
@@ -49,10 +48,9 @@ DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD
}
// draw text
{
- SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
+ paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle,
SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(4)),
- flags);
- paint.setMaskFilter(mf)->unref();
+ flags));
SkScalar x = SkIntToScalar(70);
SkScalar y = SkIntToScalar(400);
paint.setColor(SK_ColorBLACK);
@@ -82,8 +80,7 @@ DEF_SIMPLE_GM_BG(blurs, canvas, 700, 500, sk_tool_utils::color_to_565(0xFFDDDDDD
DEF_SIMPLE_GM(blur2rects, canvas, 700, 500) {
SkPaint paint;
- paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
- 2.3f))->unref();
+ paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, 2.3f));
SkRect outer = SkRect::MakeXYWH(10.125f, 10.125f, 100.125f, 100);
SkRect inner = SkRect::MakeXYWH(20.25f, 20.125f, 80, 80);
@@ -101,8 +98,7 @@ DEF_SIMPLE_GM(blur2rects, canvas, 700, 500) {
DEF_SIMPLE_GM(blur2rectsnonninepatch, canvas, 700, 500) {
SkPaint paint;
- paint.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle,
- 4.3f))->unref();
+ paint.setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle, 4.3f));
SkRect outer = SkRect::MakeXYWH(10, 110, 100, 100);
SkRect inner = SkRect::MakeXYWH(50, 150, 10, 10);
« no previous file with comments | « gm/blurroundrect.cpp ('k') | gm/circles.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698