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

Unified Diff: gm/colortypexfermode.cpp

Issue 1776973003: partial switch over to sp usage of shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: move into lua container 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/colortype.cpp ('k') | gm/composeshader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/colortypexfermode.cpp
diff --git a/gm/colortypexfermode.cpp b/gm/colortypexfermode.cpp
index 55d7697e3593ef68249be025b271bdbda7ce2901..3489f3655789f94c8284322a84a7bc12da4efa2c 100644
--- a/gm/colortypexfermode.cpp
+++ b/gm/colortypexfermode.cpp
@@ -35,15 +35,12 @@ protected:
};
SkMatrix local;
local.setRotate(180);
- SkShader* s = SkGradientShader::CreateSweep(0,0, colors, nullptr,
- SK_ARRAY_COUNT(colors), 0, &local);
-
SkPaint paint;
paint.setAntiAlias(true);
- paint.setShader(s)->unref();
+ paint.setShader(SkGradientShader::MakeSweep(0, 0, colors, nullptr, SK_ARRAY_COUNT(colors),
+ 0, &local));
- SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif",
- SkTypeface::kBold);
+ SkTypeface* orig = sk_tool_utils::create_portable_typeface("serif", SkTypeface::kBold);
if (nullptr == orig) {
orig = SkTypeface::RefDefault();
}
@@ -105,10 +102,8 @@ protected:
const SkScalar h = SkIntToScalar(H);
SkMatrix m;
m.setScale(SkIntToScalar(6), SkIntToScalar(6));
- SkShader* s = SkShader::CreateBitmapShader(fBG,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &m);
+ auto s = SkShader::MakeBitmapShader(fBG, SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode, &m);
SkPaint labelP;
labelP.setAntiAlias(true);
@@ -153,7 +148,6 @@ protected:
y += h + SkIntToScalar(30);
}
}
- s->unref();
}
private:
« no previous file with comments | « gm/colortype.cpp ('k') | gm/composeshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698