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

Unified Diff: ui/gfx/android/java_bitmap.cc

Issue 556463002: Revert of 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/skia_utils_mac.mm ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/android/java_bitmap.cc
diff --git a/ui/gfx/android/java_bitmap.cc b/ui/gfx/android/java_bitmap.cc
index 0f6f2ea06e1f02348abc71dbe6a3d4a1eab8190d..d1f644f4a4f67833bbca9cae15f811599886c7d6 100644
--- a/ui/gfx/android/java_bitmap.cc
+++ b/ui/gfx/android/java_bitmap.cc
@@ -117,9 +117,12 @@
gfx::Size src_size = jbitmap.size();
SkBitmap skbitmap;
- skbitmap.allocPixels(SkImageInfo::MakeN32Premul(src_size.width(),
- src_size.height()),
- jbitmap.stride());
+ if (!skbitmap.allocPixels(SkImageInfo::MakeN32Premul(src_size.width(),
+ src_size.height()),
+ jbitmap.stride())) {
+ LOG(FATAL) << " Failed to allocate bitmap of size " << src_size.width()
+ << "x" << src_size.height() << " stride=" << jbitmap.stride();
+ }
const void* src_pixels = jbitmap.pixels();
void* dst_pixels = skbitmap.getPixels();
memcpy(dst_pixels, src_pixels, skbitmap.getSize());
« no previous file with comments | « skia/ext/skia_utils_mac.mm ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698