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

Unified Diff: skia/ext/bitmap_platform_device_skia.cc

Issue 331283002: stop calling deprecated setConfig (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
Index: skia/ext/bitmap_platform_device_skia.cc
diff --git a/skia/ext/bitmap_platform_device_skia.cc b/skia/ext/bitmap_platform_device_skia.cc
index 893c30663f295c559489791ea8db1f370584f1b5..cf505464b092f2d4117819266546e9449905a4e4 100644
--- a/skia/ext/bitmap_platform_device_skia.cc
+++ b/skia/ext/bitmap_platform_device_skia.cc
@@ -10,9 +10,7 @@ namespace skia {
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
bool is_opaque) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
- if (bitmap.allocPixels()) {
+ if (bitmap.allocN32Pixels(width, height, is_opaque)) {
// Follow the logic in SkCanvas::createDevice(), initialize the bitmap if it
// is not opaque.
if (!is_opaque)
@@ -35,8 +33,7 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
bool is_opaque,
uint8_t* data) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
+ bitmap.setInfo(SkImageInfo::MakeN32(width, height, is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
if (data)
bitmap.setPixels(data);
else if (!bitmap.allocPixels())
@@ -87,9 +84,7 @@ PlatformBitmap::~PlatformBitmap() {
}
bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
- bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height, 0,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
- if (!bitmap_.allocPixels())
+ if (!bitmap_.allocN32Pixels(width, height, is_opaque))
return false;
surface_ = bitmap_.getPixels();

Powered by Google App Engine
This is Rietveld 408576698