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

Unified Diff: skia/ext/skia_utils_mac.mm

Issue 331283002: stop calling deprecated setConfig (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + android typo 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
« no previous file with comments | « skia/ext/pixel_ref_utils.cc ('k') | skia/ext/skia_utils_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_mac.mm
diff --git a/skia/ext/skia_utils_mac.mm b/skia/ext/skia_utils_mac.mm
index 6a624a8e69a0f06352dcd58e37d4e6a6cd8a76e7..f67d3c1c02de34ec181e768770ab2db6fab9650c 100644
--- a/skia/ext/skia_utils_mac.mm
+++ b/skia/ext/skia_utils_mac.mm
@@ -27,13 +27,7 @@ SkBitmap NSImageOrNSImageRepToSkBitmapWithColorSpace(
DCHECK((image != 0) ^ (image_rep != 0));
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- size.width,
- size.height,
- 0,
- is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
-
- if (!bitmap.allocPixels())
+ if (!bitmap.allocN32Pixels(size.width, size.height, is_opaque))
return bitmap; // Return |bitmap| which should respond true to isNull().
@@ -381,9 +375,8 @@ CGContextRef SkiaBitLocker::cgContext() {
bitmap_ = deviceBits;
bitmap_.lockPixels();
} else {
- bitmap_.setConfig(
- SkBitmap::kARGB_8888_Config, deviceBits.width(), deviceBits.height());
- bitmap_.allocPixels();
+ if (!bitmap_.allocN32Pixels(deviceBits.width(), deviceBits.height()))
+ return 0;
bitmap_.eraseColor(0);
}
base::ScopedCFTypeRef<CGColorSpaceRef> colorSpace(
« no previous file with comments | « skia/ext/pixel_ref_utils.cc ('k') | skia/ext/skia_utils_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698