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

Unified Diff: gm/lcdblendmodes.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/imagetoyuvplanes.cpp ('k') | gm/lumafilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/lcdblendmodes.cpp
diff --git a/gm/lcdblendmodes.cpp b/gm/lcdblendmodes.cpp
index d7a9024204bffbbfeea4abbe3269a6e51623fbb2..c3fe9ff1493f39add95bdeaa719f15064a32abb2 100644
--- a/gm/lcdblendmodes.cpp
+++ b/gm/lcdblendmodes.cpp
@@ -22,7 +22,7 @@ static const int kNumCols = 4;
static const int kWidth = kColWidth * kNumCols;
static const int kHeight = 750;
-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() },
@@ -30,9 +30,8 @@ static SkShader* make_shader(const SkRect& bounds) {
const SkColor colors[] = {
SK_ColorRED, SK_ColorGREEN,
};
- return SkGradientShader::CreateLinear(pts,
- colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kRepeat_TileMode);
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kRepeat_TileMode);
}
class LcdBlendGM : public skiagm::GM {
@@ -136,7 +135,7 @@ protected:
if (useGrad) {
SkRect r;
r.setXYWH(0, y - fTextHeight, SkIntToScalar(kColWidth), fTextHeight);
- paint.setShader(make_shader(r))->unref();
+ paint.setShader(make_shader(r));
}
SkString string(gModes[m].fLabel);
canvas->drawText(gModes[m].fLabel, string.size(), 0, y, paint);
« no previous file with comments | « gm/imagetoyuvplanes.cpp ('k') | gm/lumafilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698