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

Unified Diff: gm/pictureshader.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder 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/pictureimagegenerator.cpp ('k') | gm/pictureshadertile.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 f27c4eda4780317400d0c40d4f82751b2152f77c..0916744c694c1f273088e57b39cbc1a7e036c932 100644
--- a/gm/pictureshader.cpp
+++ b/gm/pictureshader.cpp
@@ -35,7 +35,7 @@ public:
SkPictureRecorder recorder;
SkCanvas* pictureCanvas = recorder.beginRecording(fTileSize, fTileSize, nullptr, 0);
this->drawTile(pictureCanvas);
- fPicture.reset(recorder.endRecording());
+ fPicture = recorder.finishRecordingAsPicture();
// Build a reference bitmap.
fBitmap.allocN32Pixels(SkScalarCeilToInt(fTileSize), SkScalarCeilToInt(fTileSize));
@@ -193,7 +193,7 @@ DEF_SIMPLE_GM(tiled_picture_shader, canvas, 400, 400) {
p.setStrokeWidth(10);
c->drawLine(20, 20, 80, 80, p);
- sk_sp<SkPicture> picture(recorder.endRecording());
+ sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
sk_sp<SkShader> shader(SkShader::MakePictureShader(picture, SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode,
nullptr, nullptr));
« no previous file with comments | « gm/pictureimagegenerator.cpp ('k') | gm/pictureshadertile.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698