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

Unified Diff: skia/ext/bitmap_platform_device_skia.cc

Issue 545513002: tryAllocPixels returns bool, allocPixels requires success (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/bitmap_platform_device_mac.cc ('k') | skia/ext/skia_utils_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0255444091548ffcd4dc129433c3c02fa79dbf97..ee44e26af828437d5fe4a47b2cbb8b9e3c997834 100644
--- a/skia/ext/bitmap_platform_device_skia.cc
+++ b/skia/ext/bitmap_platform_device_skia.cc
@@ -10,7 +10,7 @@ namespace skia {
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
bool is_opaque) {
SkBitmap bitmap;
- if (bitmap.allocN32Pixels(width, height, is_opaque)) {
+ if (bitmap.tryAllocN32Pixels(width, height, is_opaque)) {
// Follow the logic in SkCanvas::createDevice(), initialize the bitmap if it
// is not opaque.
if (!is_opaque)
@@ -37,7 +37,7 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
is_opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType));
if (data)
bitmap.setPixels(data);
- else if (!bitmap.allocPixels())
+ else if (!bitmap.tryAllocPixels())
return NULL;
return new BitmapPlatformDevice(bitmap);
@@ -85,7 +85,7 @@ PlatformBitmap::~PlatformBitmap() {
}
bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
- if (!bitmap_.allocN32Pixels(width, height, is_opaque))
+ if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque))
return false;
surface_ = bitmap_.getPixels();
« no previous file with comments | « skia/ext/bitmap_platform_device_mac.cc ('k') | skia/ext/skia_utils_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698