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

Unified Diff: gm/lcdblendmodes.cpp

Issue 1790353002: Revert of more shader-->sp conversions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 c3fe9ff1493f39add95bdeaa719f15064a32abb2..d7a9024204bffbbfeea4abbe3269a6e51623fbb2 100644
--- a/gm/lcdblendmodes.cpp
+++ b/gm/lcdblendmodes.cpp
@@ -22,7 +22,7 @@
static const int kWidth = kColWidth * kNumCols;
static const int kHeight = 750;
-static sk_sp<SkShader> make_shader(const SkRect& bounds) {
+static SkShader* make_shader(const SkRect& bounds) {
const SkPoint pts[] = {
{ bounds.left(), bounds.top() },
{ bounds.right(), bounds.bottom() },
@@ -30,8 +30,9 @@
const SkColor colors[] = {
SK_ColorRED, SK_ColorGREEN,
};
- return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kRepeat_TileMode);
+ return SkGradientShader::CreateLinear(pts,
+ colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kRepeat_TileMode);
}
class LcdBlendGM : public skiagm::GM {
@@ -135,7 +136,7 @@
if (useGrad) {
SkRect r;
r.setXYWH(0, y - fTextHeight, SkIntToScalar(kColWidth), fTextHeight);
- paint.setShader(make_shader(r));
+ paint.setShader(make_shader(r))->unref();
}
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