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

Unified Diff: gm/imagesource.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/imagescalealigned.cpp ('k') | gm/imagesource2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagesource.cpp
diff --git a/gm/imagesource.cpp b/gm/imagesource.cpp
index f4574d267c6f7b5a18f63aa9ed7b9878e54fd60b..973dc0c6eaa81b339df1b8ff2ce5caa7ab1963e0 100644
--- a/gm/imagesource.cpp
+++ b/gm/imagesource.cpp
@@ -25,7 +25,7 @@ protected:
void onOnceBeforeDraw() override {
SkBitmap bm = sk_tool_utils::create_string_bitmap(100, 100, 0xFFFFFFFF, 20, 70, 96, "e");
- fImage.reset(SkImage::NewFromBitmap(bm));
+ fImage = SkImage::MakeFromBitmap(bm);
}
static void FillRectFiltered(SkCanvas* canvas, const SkRect& clipRect, SkImageFilter* filter) {
@@ -44,13 +44,13 @@ protected:
SkRect dstRect = SkRect::MakeXYWH(0, 10, 60, 60);
SkRect clipRect = SkRect::MakeXYWH(0, 0, 100, 100);
SkRect bounds = SkRect::MakeIWH(fImage->width(), fImage->height());
- SkAutoTUnref<SkImageFilter> imageSource(SkImageSource::Create(fImage));
+ SkAutoTUnref<SkImageFilter> imageSource(SkImageSource::Create(fImage.get()));
SkAutoTUnref<SkImageFilter> imageSourceSrcRect(
- SkImageSource::Create(fImage, srcRect, srcRect, kHigh_SkFilterQuality));
+ SkImageSource::Create(fImage.get(), srcRect, srcRect, kHigh_SkFilterQuality));
SkAutoTUnref<SkImageFilter> imageSourceSrcRectDstRect(
- SkImageSource::Create(fImage, srcRect, dstRect, kHigh_SkFilterQuality));
+ SkImageSource::Create(fImage.get(), srcRect, dstRect, kHigh_SkFilterQuality));
SkAutoTUnref<SkImageFilter> imageSourceDstRectOnly(
- SkImageSource::Create(fImage, bounds, dstRect, kHigh_SkFilterQuality));
+ SkImageSource::Create(fImage.get(), bounds, dstRect, kHigh_SkFilterQuality));
// Draw an unscaled bitmap.
FillRectFiltered(canvas, clipRect, imageSource);
@@ -71,7 +71,7 @@ protected:
}
private:
- SkAutoTUnref<SkImage> fImage;
+ sk_sp<SkImage> fImage;
typedef GM INHERITED;
};
« no previous file with comments | « gm/imagescalealigned.cpp ('k') | gm/imagesource2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698