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

Unified Diff: gm/all_bitmap_configs.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/SkLinearBitmapPipelineGM.cpp ('k') | gm/astcbitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/all_bitmap_configs.cpp
diff --git a/gm/all_bitmap_configs.cpp b/gm/all_bitmap_configs.cpp
index 46c5d5eed5a432b6e1319564bfed9029dec067a8..c533b6fcae417710182178a47c03f21d1184eaaa 100644
--- a/gm/all_bitmap_configs.cpp
+++ b/gm/all_bitmap_configs.cpp
@@ -192,7 +192,7 @@ DEF_SIMPLE_GM(all_bitmap_configs, canvas, SCALE, 6 * SCALE) {
}
// Works on Ganesh, fails on Raster.
-SkImage* make_not_native32_color_wheel() {
+sk_sp<SkImage> make_not_native32_color_wheel() {
SkBitmap n32bitmap, notN32bitmap;
n32bitmap.allocN32Pixels(SCALE, SCALE);
n32bitmap.eraseColor(SK_ColorTRANSPARENT);
@@ -207,12 +207,12 @@ SkImage* make_not_native32_color_wheel() {
static_assert(ct != kN32_SkColorType, "BRGA!=RGBA");
SkAssertResult(n32bitmap.copyTo(&notN32bitmap, ct));
SkASSERT(notN32bitmap.colorType() == ct);
- return SkImage::NewFromBitmap(notN32bitmap);
+ return SkImage::MakeFromBitmap(notN32bitmap);
}
DEF_SIMPLE_GM(not_native32_bitmap_config, canvas, SCALE, SCALE) {
- SkAutoTUnref<SkImage> notN32image(make_not_native32_color_wheel());
+ sk_sp<SkImage> notN32image(make_not_native32_color_wheel());
SkASSERT(notN32image);
sk_tool_utils::draw_checkerboard(canvas, SK_ColorLTGRAY, SK_ColorWHITE, 8);
- canvas->drawImage(notN32image, 0.0f, 0.0f);
+ canvas->drawImage(notN32image.get(), 0.0f, 0.0f);
}
« no previous file with comments | « gm/SkLinearBitmapPipelineGM.cpp ('k') | gm/astcbitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698