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

Unified Diff: gm/pictureshadertile.cpp

Issue 1789633002: 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 30776c338b4e1c939808a68437bfa13741609bfe..68e65f87bb99663c361baf0fac0b14215de23776 100644
--- a/gm/pictureshadertile.cpp
+++ b/gm/pictureshadertile.cpp
@@ -95,14 +95,14 @@ protected:
SkPictureRecorder recorder;
SkCanvas* pictureCanvas = recorder.beginRecording(kPictureSize, kPictureSize);
draw_scene(pictureCanvas, kPictureSize);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ sk_sp<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);
- SkAutoTUnref<SkPicture> offsetPicture(recorder.endRecording());
+ sk_sp<SkPicture> offsetPicture(recorder.endRecording());
for (unsigned i = 0; i < SK_ARRAY_COUNT(tiles); ++i) {
SkRect tile = SkRect::MakeXYWH(tiles[i].x * kPictureSize,
@@ -115,20 +115,18 @@ protected:
localMatrix.postScale(kFillSize / (2 * kPictureSize),
kFillSize / (2 * kPictureSize));
- SkPicture* picturePtr = picture.get();
+ sk_sp<SkPicture>& pictureRef = picture;
SkRect* tilePtr = &tile;
if (tile == SkRect::MakeWH(kPictureSize, kPictureSize)) {
// When the tile == picture bounds, exercise the picture + offset path.
- picturePtr = offsetPicture.get();
+ pictureRef = offsetPicture;
f(malita) 2016/03/13 20:25:50 Heh, yeah, this is assigning offsetPicture -> pict
tilePtr = nullptr;
}
- fShaders[i].reset(SkShader::CreatePictureShader(picturePtr,
- SkShader::kRepeat_TileMode,
- SkShader::kRepeat_TileMode,
- &localMatrix,
- tilePtr));
+ fShaders[i] = SkShader::MakePictureShader(pictureRef, SkShader::kRepeat_TileMode,
+ SkShader::kRepeat_TileMode, &localMatrix,
+ tilePtr);
}
}
@@ -150,7 +148,7 @@ protected:
}
private:
- SkAutoTUnref<SkShader> fShaders[SK_ARRAY_COUNT(tiles)];
+ sk_sp<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