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

Unified Diff: gm/surface.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/srcmode.cpp ('k') | gm/tablecolorfilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/surface.cpp
diff --git a/gm/surface.cpp b/gm/surface.cpp
index c3eaf9e8d2075a870ead5645c1e4e0e16c3c7f9f..6874b5bea32e8ab4962a15e4276bb8f1533cfdf1 100644
--- a/gm/surface.cpp
+++ b/gm/surface.cpp
@@ -13,12 +13,12 @@
#define W 200
#define H 100
-static SkShader* make_shader() {
+static sk_sp<SkShader> make_shader() {
int a = 0x99;
int b = 0xBB;
SkPoint pts[] = { { 0, 0 }, { W, H } };
SkColor colors[] = { SkColorSetRGB(a, a, a), SkColorSetRGB(b, b, b) };
- return SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
+ return SkGradientShader::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
}
static SkSurface* make_surface(GrContext* ctx, const SkImageInfo& info, SkPixelGeometry geo,
@@ -46,7 +46,7 @@ static void test_draw(SkCanvas* canvas, const char label[]) {
paint.setLCDRenderText(true);
paint.setDither(true);
- paint.setShader(make_shader())->unref();
+ paint.setShader(make_shader());
canvas->drawRect(SkRect::MakeWH(W, H), paint);
paint.setShader(nullptr);
« no previous file with comments | « gm/srcmode.cpp ('k') | gm/tablecolorfilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698