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

Unified Diff: gm/pictureshader.cpp

Issue 1829303002: move setshader to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: addressing comments from #8 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/perlinnoise.cpp ('k') | gm/samplerstress.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pictureshader.cpp
diff --git a/gm/pictureshader.cpp b/gm/pictureshader.cpp
index 0916744c694c1f273088e57b39cbc1a7e036c932..d54144f938114c79b6d00460369020a9ae0c1890 100644
--- a/gm/pictureshader.cpp
+++ b/gm/pictureshader.cpp
@@ -194,9 +194,6 @@ DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) {
c->drawLine(20, 20, 80, 80, p);
sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
- sk_sp<SkShader> shader(SkShader::MakePictureShader(picture, SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- nullptr, nullptr));
p.setColor(sk_tool_utils::color_to_565(0xFF8BC34A)); // green
canvas->drawPaint(p);
@@ -204,7 +201,9 @@ DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) {
canvas->clipRect(SkRect::MakeXYWH(0, 0, 400, 350));
p.setColor(sk_tool_utils::color_to_565(0xFFB6B6B6)); // gray
canvas->drawPaint(p);
- p.setShader(shader.get());
+ p.setShader(SkShader::MakePictureShader(std::move(picture), SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode,
+ nullptr, nullptr));
canvas->drawPaint(p);
}
« no previous file with comments | « gm/perlinnoise.cpp ('k') | gm/samplerstress.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698