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

Unified Diff: gm/imagefiltersgraph.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/imagefilterscropexpand.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersgraph.cpp
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 26ebc4df7dd7982cb2b8633023763c6d41d0c1a7..fa9c512591a06d9130b01bc0b4b3aabf922332cb 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -111,14 +111,14 @@ protected:
SkISize onISize() override { return SkISize::Make(600, 150); }
void onOnceBeforeDraw() override {
- fImage.reset(SkImage::NewFromBitmap(
- sk_tool_utils::create_string_bitmap(100, 100, SK_ColorWHITE, 20, 70, 96, "e")));
+ fImage = SkImage::MakeFromBitmap(
+ sk_tool_utils::create_string_bitmap(100, 100, SK_ColorWHITE, 20, 70, 96, "e"));
}
void onDraw(SkCanvas* canvas) override {
canvas->clear(SK_ColorBLACK);
{
- SkAutoTUnref<SkImageFilter> bitmapSource(SkImageSource::Create(fImage));
+ SkAutoTUnref<SkImageFilter> bitmapSource(SkImageSource::Create(fImage.get()));
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(SK_ColorRED,
SkXfermode::kSrcIn_Mode));
SkAutoTUnref<SkImageFilter> blur(SkBlurImageFilter::Create(4.0f, 4.0f, bitmapSource));
@@ -146,7 +146,7 @@ protected:
SkPaint paint;
paint.setImageFilter(blendColor);
- DrawClippedImage(canvas, fImage, paint);
+ DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
{
@@ -165,7 +165,7 @@ protected:
SkPaint paint;
paint.setImageFilter(arithFilter);
- DrawClippedImage(canvas, fImage, paint);
+ DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
{
@@ -179,7 +179,7 @@ protected:
SkPaint paint;
paint.setImageFilter(blend);
- DrawClippedImage(canvas, fImage, paint);
+ DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
{
@@ -213,7 +213,7 @@ protected:
SkPaint paint;
paint.setImageFilter(convolve);
- DrawClippedImage(canvas, fImage, paint);
+ DrawClippedImage(canvas, fImage.get(), paint);
canvas->translate(SkIntToScalar(100), 0);
}
{
@@ -245,7 +245,7 @@ private:
canvas->restore();
}
- SkAutoTUnref<SkImage> fImage;
+ sk_sp<SkImage> fImage;
typedef GM INHERITED;
};
« no previous file with comments | « gm/imagefilterscropexpand.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698