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

Unified Diff: src/image/SkImage.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/gpu/SkGrPixelRef.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 795b8420e6e8cbdff7e3a8d635f79f1902ddc742..a6063846c7851711503d7c6a1d262c2ec62efbfb 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -117,9 +117,8 @@ bool SkImage_Base::onReadPixels(SkBitmap* bitmap, const SkIRect& subset) const {
return false;
}
} else {
- const SkImageInfo info = SkImageInfo::MakeN32Premul(subset.width(), subset.height());
SkBitmap tmp;
- if (!tmp.allocPixels(info)) {
+ if (!tmp.tryAllocN32Pixels(subset.width(), subset.height())) {
return false;
}
*bitmap = tmp;
« no previous file with comments | « src/gpu/SkGrPixelRef.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698