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

Unified Diff: gm/tablecolorfilter.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/surface.cpp ('k') | gm/textbloblooper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/tablecolorfilter.cpp
diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp
index dcc29f37cf3d8de45cb099f15a8f3aff0259c55a..1053bb25181bc71bbd3af3eb1ecd40f906d0db6e 100644
--- a/gm/tablecolorfilter.cpp
+++ b/gm/tablecolorfilter.cpp
@@ -11,14 +11,14 @@
#include "SkGradientShader.h"
#include "SkTableColorFilter.h"
-static sk_sp<SkShader> make_shader0(int w, int h) {
+static SkShader* make_shader0(int w, int h) {
SkPoint pts[] = { {0, 0}, {SkIntToScalar(w), SkIntToScalar(h)} };
SkColor colors[] = {
SK_ColorBLACK, SK_ColorGREEN, SK_ColorCYAN,
SK_ColorRED, 0, SK_ColorBLUE, SK_ColorWHITE
};
- return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
- SkShader::kClamp_TileMode);
+ return SkGradientShader::CreateLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors),
+ SkShader::kClamp_TileMode);
}
static void make_bm0(SkBitmap* bm) {
int W = 120;
@@ -28,17 +28,17 @@
SkCanvas canvas(*bm);
SkPaint paint;
- paint.setShader(make_shader0(W, H));
+ paint.setShader(make_shader0(W, H))->unref();
canvas.drawPaint(paint);
}
-static sk_sp<SkShader> make_shader1(int w, int h) {
+static SkShader* make_shader1(int w, int h) {
SkScalar cx = SkIntToScalar(w)/2;
SkScalar cy = SkIntToScalar(h)/2;
SkColor colors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE,
};
- return SkGradientShader::MakeRadial(SkPoint::Make(cx, cy), cx, colors, nullptr,
- SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode);
+ return SkGradientShader::CreateRadial(SkPoint::Make(cx, cy), cx, colors, nullptr,
+ SK_ARRAY_COUNT(colors), SkShader::kClamp_TileMode);
}
static void make_bm1(SkBitmap* bm) {
int W = 120;
@@ -50,7 +50,7 @@
SkCanvas canvas(*bm);
SkPaint paint;
- paint.setShader(make_shader1(W, H));
+ paint.setShader(make_shader1(W, H))->unref();
paint.setAntiAlias(true);
canvas.drawCircle(cx, cy, cx, paint);
}
@@ -234,7 +234,7 @@
}
SkPaint paint;
- paint.setShader(make_shader1(50, 50));
+ paint.setShader(make_shader1(50, 50))->unref();
SkRect r = SkRect::MakeWH(50, 50);
const SkScalar spacer = 10;
« no previous file with comments | « gm/surface.cpp ('k') | gm/textbloblooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698