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

Unified Diff: gm/textbloblooper.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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/tablecolorfilter.cpp ('k') | gm/textblobshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/textbloblooper.cpp
diff --git a/gm/textbloblooper.cpp b/gm/textbloblooper.cpp
index fef3e248f49fe0c64c76cd534706bab745cf890e..8d462c9b0902658cd8d29dcd1bdf7824c615cc1f 100644
--- a/gm/textbloblooper.cpp
+++ b/gm/textbloblooper.cpp
@@ -80,7 +80,7 @@ static void path_effect(SkPaint* paint) {
paint->setPathEffect(make_tile_effect())->unref();
}
-static SkShader* make_shader(const SkRect& bounds) {
+static sk_sp<SkShader> make_shader(const SkRect& bounds) {
const SkPoint pts[] = {
{ bounds.left(), bounds.top() },
{ bounds.right(), bounds.bottom() },
@@ -89,15 +89,14 @@ static SkShader* make_shader(const SkRect& bounds) {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorBLACK,
SK_ColorCYAN, SK_ColorMAGENTA, SK_ColorYELLOW,
};
- return SkGradientShader::CreateLinear(pts,
- colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode);
}
static void color_filter(SkPaint* paint) {
SkRect r;
r.setWH(SkIntToScalar(kWidth), 50);
- paint->setShader(make_shader(r))->unref();
+ paint->setShader(make_shader(r));
paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(0xF0F0F0, 0))->unref();
}
« no previous file with comments | « gm/tablecolorfilter.cpp ('k') | gm/textblobshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698