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

Unified Diff: gm/xfermodeimagefilter.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/verylargebitmap.cpp ('k') | include/core/SkSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/xfermodeimagefilter.cpp
diff --git a/gm/xfermodeimagefilter.cpp b/gm/xfermodeimagefilter.cpp
index 85bbf44765f080eb1cb97b2e2baacef7707f1215..805e2201ea286f5d4e4490aac8863f03465a8f85 100644
--- a/gm/xfermodeimagefilter.cpp
+++ b/gm/xfermodeimagefilter.cpp
@@ -37,11 +37,11 @@ protected:
void onOnceBeforeDraw() override {
fBitmap = sk_tool_utils::create_string_bitmap(80, 80, 0xD000D000, 15, 65, 96, "e");
- fCheckerboard.reset(SkImage::NewFromBitmap(
+ fCheckerboard = SkImage::MakeFromBitmap(
sk_tool_utils::create_checkerboard_bitmap(80, 80,
sk_tool_utils::color_to_565(0xFFA0A0A0),
sk_tool_utils::color_to_565(0xFF404040),
- 8)));
+ 8));
}
void onDraw(SkCanvas* canvas) override {
@@ -85,7 +85,7 @@ protected:
};
int x = 0, y = 0;
- SkAutoTUnref<SkImageFilter> background(SkImageSource::Create(fCheckerboard));
+ SkAutoTUnref<SkImageFilter> background(SkImageSource::Create(fCheckerboard.get()));
for (size_t i = 0; i < SK_ARRAY_COUNT(gModes); i++) {
SkAutoTUnref<SkXfermode> mode(SkXfermode::Create(gModes[i].fMode));
SkAutoTUnref<SkImageFilter> filter(SkXfermodeImageFilter::Create(mode, background));
@@ -119,8 +119,8 @@ protected:
SkRect clipRect = SkRect::MakeWH(SkIntToScalar(fBitmap.width() + 4),
SkIntToScalar(fBitmap.height() + 4));
// Test offsets on SrcMode (uses fixed-function blend)
- SkAutoTUnref<SkImage> bitmapImage(SkImage::NewFromBitmap(fBitmap));
- SkAutoTUnref<SkImageFilter> foreground(SkImageSource::Create(bitmapImage));
+ sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(fBitmap));
+ SkAutoTUnref<SkImageFilter> foreground(SkImageSource::Create(bitmapImage.get()));
SkAutoTUnref<SkImageFilter> offsetForeground(SkOffsetImageFilter::Create(
SkIntToScalar(4), SkIntToScalar(-4), foreground));
SkAutoTUnref<SkImageFilter> offsetBackground(SkOffsetImageFilter::Create(
@@ -213,8 +213,8 @@ private:
canvas->restore();
}
- SkBitmap fBitmap;
- SkAutoTUnref<SkImage> fCheckerboard;
+ SkBitmap fBitmap;
+ sk_sp<SkImage> fCheckerboard;
typedef GM INHERITED;
};
« no previous file with comments | « gm/verylargebitmap.cpp ('k') | include/core/SkSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698