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

Unified Diff: gm/pictureshadertile.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/pictureshader.cpp ('k') | gm/rectangletexture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/pictureshadertile.cpp
diff --git a/gm/pictureshadertile.cpp b/gm/pictureshadertile.cpp
index 68e65f87bb99663c361baf0fac0b14215de23776..30776c338b4e1c939808a68437bfa13741609bfe 100644
--- a/gm/pictureshadertile.cpp
+++ b/gm/pictureshadertile.cpp
@@ -95,14 +95,14 @@
SkPictureRecorder recorder;
SkCanvas* pictureCanvas = recorder.beginRecording(kPictureSize, kPictureSize);
draw_scene(pictureCanvas, kPictureSize);
- sk_sp<SkPicture> picture(recorder.endRecording());
+ SkAutoTUnref<SkPicture> picture(recorder.endRecording());
SkPoint offset = SkPoint::Make(100, 100);
pictureCanvas = recorder.beginRecording(SkRect::MakeXYWH(offset.x(), offset.y(),
kPictureSize, kPictureSize));
pictureCanvas->translate(offset.x(), offset.y());
draw_scene(pictureCanvas, kPictureSize);
- sk_sp<SkPicture> offsetPicture(recorder.endRecording());
+ SkAutoTUnref<SkPicture> offsetPicture(recorder.endRecording());
for (unsigned i = 0; i < SK_ARRAY_COUNT(tiles); ++i) {
SkRect tile = SkRect::MakeXYWH(tiles[i].x * kPictureSize,
@@ -115,18 +115,20 @@
localMatrix.postScale(kFillSize / (2 * kPictureSize),
kFillSize / (2 * kPictureSize));
- sk_sp<SkPicture>& pictureRef = picture;
+ SkPicture* picturePtr = picture.get();
SkRect* tilePtr = &tile;
if (tile == SkRect::MakeWH(kPictureSize, kPictureSize)) {
// When the tile == picture bounds, exercise the picture + offset path.
- pictureRef = offsetPicture;
+ picturePtr = offsetPicture.get();
tilePtr = nullptr;
}
- fShaders[i] = SkShader::MakePictureShader(pictureRef, SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode, &localMatrix,
- tilePtr);
+ fShaders[i].reset(SkShader::CreatePictureShader(picturePtr,
+ SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode,
+ &localMatrix,
+ tilePtr));
}
}
@@ -148,7 +150,7 @@
}
private:
- sk_sp<SkShader> fShaders[SK_ARRAY_COUNT(tiles)];
+ SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)];
typedef GM INHERITED;
};
« no previous file with comments | « gm/pictureshader.cpp ('k') | gm/rectangletexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698