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

Unified Diff: gm/pictureshadertile.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/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..b6179f5421958188a54195bb231fc2723ee93250 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;
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