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

Unified Diff: gm/imagefiltersclipped.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/imagefilters.cpp ('k') | gm/imagefilterscropexpand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersclipped.cpp
diff --git a/gm/imagefiltersclipped.cpp b/gm/imagefiltersclipped.cpp
index 033b80638f63a72b8ebd4a7f4856759ad2287f1e..26ee24b1d45daef2daa0ca139570bbcd762ecaed 100644
--- a/gm/imagefiltersclipped.cpp
+++ b/gm/imagefiltersclipped.cpp
@@ -57,7 +57,7 @@ protected:
paint.setShader(SkGradientShader::MakeRadial(SkPoint::Make(x, y), radius, colors, nullptr,
2, SkShader::kClamp_TileMode));
canvas->drawCircle(x, y, radius, paint);
- fGradientCircle.reset(surface->newImageSnapshot());
+ fGradientCircle = surface->makeImageSnapshot();
}
static void draw_clipped_filter(SkCanvas* canvas, SkImageFilter* filter, size_t i,
@@ -80,16 +80,16 @@ protected:
}
void onOnceBeforeDraw() override {
- fCheckerboard.reset(SkImage::NewFromBitmap
- (sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF404040, 8)));
+ fCheckerboard = SkImage::MakeFromBitmap
+ (sk_tool_utils::create_checkerboard_bitmap(64, 64, 0xFFA0A0A0, 0xFF404040, 8));
this->makeGradientCircle(64, 64);
}
void onDraw(SkCanvas* canvas) override {
canvas->clear(SK_ColorBLACK);
- SkAutoTUnref<SkImageFilter> gradient(SkImageSource::Create(fGradientCircle));
- SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerboard));
+ SkAutoTUnref<SkImageFilter> gradient(SkImageSource::Create(fGradientCircle.get()));
+ SkAutoTUnref<SkImageFilter> checkerboard(SkImageSource::Create(fCheckerboard.get()));
SkAutoTUnref<SkShader> noise(SkPerlinNoiseShader::CreateFractalNoise(
SkDoubleToScalar(0.1), SkDoubleToScalar(0.05), 1, 0));
SkMatrix resizeMatrix;
@@ -148,7 +148,7 @@ protected:
}
private:
- SkAutoTUnref<SkImage> fCheckerboard, fGradientCircle;
+ sk_sp<SkImage> fCheckerboard, fGradientCircle;
typedef GM INHERITED;
};
« no previous file with comments | « gm/imagefilters.cpp ('k') | gm/imagefilterscropexpand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698