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

Unified Diff: gm/imagefilterscropexpand.cpp

Issue 1810813003: update callsites for Make image factories (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: start to take advantage of sk_sp drawImage 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/imagefiltersclipped.cpp ('k') | gm/imagefiltersgraph.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefilterscropexpand.cpp
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index 185bbde0a6628c7103a73b1c8fe9426f8303a51d..f3ca4d32a6b872aeb24b6c6085322f9082860c72 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -46,12 +46,12 @@ protected:
SkRect::Make(SkIRect::MakeXYWH(10, 10, 44, 44)),
SkImageFilter::CropRect::kHasAll_CropEdge);
- SkAutoTUnref<SkImage> gradientCircle(MakeGradientCircle(64, 64));
+ sk_sp<SkImage> gradientCircle(MakeGradientCircle(64, 64));
SkBitmap checkerboard;
MakeCheckerboard(&checkerboard);
SkAutoTUnref<SkImageFilter> gradientCircleSource(
- SkImageSource::Create(gradientCircle));
+ SkImageSource::Create(gradientCircle.get()));
SkAutoTUnref<SkImageFilter> noopCropped(
SkOffsetImageFilter::Create(0, 0, nullptr, &cropRect));
SkScalar sk255 = SkIntToScalar(255);
@@ -141,7 +141,7 @@ private:
}
}
- static SkImage* MakeGradientCircle(int width, int height) {
+ static sk_sp<SkImage> MakeGradientCircle(int width, int height) {
SkScalar x = SkIntToScalar(width / 2);
SkScalar y = SkIntToScalar(height / 2);
SkScalar radius = SkMinScalar(x, y) * 0.8f;
@@ -156,7 +156,7 @@ private:
2, SkShader::kClamp_TileMode));
canvas->drawCircle(x, y, radius, paint);
- return surface->newImageSnapshot();
+ return surface->makeImageSnapshot();
}
static void Draw(SkCanvas* canvas, const SkBitmap& bitmap, const SkRect& rect, SkImageFilter* filter) {
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gm/imagefiltersgraph.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698