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

Unified Diff: gm/surface.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/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 6874b5bea32e8ab4962a15e4276bb8f1533cfdf1..c3eaf9e8d2075a870ead5645c1e4e0e16c3c7f9f 100644
--- a/gm/surface.cpp
+++ b/gm/surface.cpp
@@ -13,12 +13,12 @@
#define W 200
#define H 100
-static sk_sp<SkShader> make_shader() {
+static 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::MakeLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
+ return SkGradientShader::CreateLinear(pts, colors, nullptr, 2, SkShader::kClamp_TileMode);
}
static SkSurface* make_surface(GrContext* ctx, const SkImageInfo& info, SkPixelGeometry geo,
@@ -46,7 +46,7 @@
paint.setLCDRenderText(true);
paint.setDither(true);
- paint.setShader(make_shader());
+ paint.setShader(make_shader())->unref();
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