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

Unified Diff: src/utils/mac/SkCreateCGImageRef.cpp

Issue 510423005: make allocPixels throw on failure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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 | « src/utils/SkPDFRasterizer.cpp ('k') | tests/ARGBImageEncoderTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/mac/SkCreateCGImageRef.cpp
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index 01b774df09f4fba8ce6a79a54d7c74f0ba7a81c8..14a24d87104dbf0baa8c12966fb3e44c20b2448c 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -221,7 +221,7 @@ bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output) {
int h = (int)CGRectGetHeight(bounds);
SkBitmap bitmap;
- if (!bitmap.allocPixels(SkImageInfo::MakeN32Premul(w, h))) {
+ if (!bitmap.tryAllocN32Pixels(w, h)) {
return false;
}
bitmap.eraseColor(SK_ColorWHITE);
@@ -287,7 +287,7 @@ bool SkCreateBitmapFromCGImage(SkBitmap* dst, CGImageRef image, SkISize* scaleTo
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
SkBitmap tmp;
- if (!tmp.allocPixels(info)) {
+ if (!tmp.tryAllocPixels(info)) {
return false;
}
« no previous file with comments | « src/utils/SkPDFRasterizer.cpp ('k') | tests/ARGBImageEncoderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698