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

Unified Diff: gm/hairmodes.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/gradtext.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/hairmodes.cpp
diff --git a/gm/hairmodes.cpp b/gm/hairmodes.cpp
index 4f85c198836d5d3c607c63799b109d30c27e5df6..15e75fe847fa5a74c278857ec732ca6d1f6dfc3a 100644
--- a/gm/hairmodes.cpp
+++ b/gm/hairmodes.cpp
@@ -58,7 +58,7 @@ static SkScalar drawCell(SkCanvas* canvas, SkXfermode* mode, SkAlpha a0, SkAlpha
return H;
}
-static SkShader* make_bg_shader() {
+static sk_sp<SkShader> make_bg_shader() {
SkBitmap bm;
bm.allocN32Pixels(2, 2);
*bm.getAddr32(0, 0) = *bm.getAddr32(1, 1) = 0xFFFFFFFF;
@@ -66,10 +66,8 @@ static SkShader* make_bg_shader() {
SkMatrix m;
m.setScale(SkIntToScalar(6), SkIntToScalar(6));
- return SkShader::CreateBitmapShader(bm,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &m);
+ return SkShader::MakeBitmapShader(bm,
+ SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &m);
}
namespace skiagm {
@@ -85,7 +83,7 @@ namespace skiagm {
virtual SkISize onISize() override { return SkISize::Make(640, 480); }
void onOnceBeforeDraw() override {
- fBGPaint.setShader(make_bg_shader())->unref();
+ fBGPaint.setShader(make_bg_shader());
}
void onDraw(SkCanvas* canvas) override {
« no previous file with comments | « gm/gradtext.cpp ('k') | gm/imagefiltersclipped.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698