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

Unified Diff: skia/ext/bitmap_platform_device_mac.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_mac.cc
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 954abce2bff6be7a42234db77014579f21e5ef14..f30a405a2689fec3543b145909efa38b55cb41a5 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -103,8 +103,7 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(CGContextRef context,
SkBitmap bitmap;
// TODO: verify that the CG Context's pixels will have tight rowbytes or pass in the correct
// rowbytes for the case when context != NULL.
- 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));
void* data;
if (context) {
@@ -272,10 +271,8 @@ bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
if (RasterDeviceTooBigToAllocate(width, height))
return false;
- bitmap_.setConfig(SkBitmap::kARGB_8888_Config, width, height, width * 4,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
- if (!bitmap_.allocPixels())
- return false;
+ if (!bitmap_.allocN32Pixels(width, height, is_opaque))
+ return false;
if (!is_opaque)
bitmap_.eraseColor(0);

Powered by Google App Engine
This is Rietveld 408576698