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

Unified Diff: gm/bleed.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/bigtileimagefilter.cpp ('k') | gm/colorfilterimagefilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/bleed.cpp
diff --git a/gm/bleed.cpp b/gm/bleed.cpp
index 5a0416293887e072770f05b13c409ef9ceeabd40..c3d026a6e8ff03ae9ebf4487bc2029bc1f566310 100644
--- a/gm/bleed.cpp
+++ b/gm/bleed.cpp
@@ -27,10 +27,10 @@ struct TestPixels {
kBitmap,
kImage
};
- Type fType;
- SkBitmap fBitmap;
- SkAutoTUnref<SkImage> fImage;
- SkIRect fRect; // The region of the bitmap/image that should be rendered.
+ Type fType;
+ SkBitmap fBitmap;
+ sk_sp<SkImage> fImage;
+ SkIRect fRect; // The region of the bitmap/image that should be rendered.
};
/** Creates a bitmap with two one-pixel rings around a checkerboard. The checkerboard is 2x2
@@ -130,7 +130,7 @@ static bool make_ringed_alpha_bitmap(GrContext* ctx, TestPixels* result, int wid
/** Helper to reuse above functions to produce images rather than bmps */
static void bmp_to_image(TestPixels* result) {
SkASSERT(TestPixels::kBitmap == result->fType);
- result->fImage.reset(SkImage::NewFromBitmap(result->fBitmap));
+ result->fImage = SkImage::MakeFromBitmap(result->fBitmap);
SkASSERT(result->fImage);
result->fType = TestPixels::kImage;
result->fBitmap.reset();
@@ -345,7 +345,7 @@ protected:
if (TestPixels::kBitmap == pixels.fType) {
canvas->drawBitmapRect(pixels.fBitmap, src, dst, paint, constraint);
} else {
- canvas->drawImageRect(pixels.fImage, src, dst, paint, constraint);
+ canvas->drawImageRect(pixels.fImage.get(), src, dst, paint, constraint);
}
}
« no previous file with comments | « gm/bigtileimagefilter.cpp ('k') | gm/colorfilterimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698