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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 510423005: make allocPixels throw on failure (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: can't use (void) to suppress the "must check return result" 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
Index: src/gpu/SkGrPixelRef.cpp
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index d378032c062dd243a6021185499d7afce0447a5f..2371ea72e377b53a5cc571ca5992dd94c6063acc 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -170,7 +170,7 @@ bool SkGrPixelRef::onReadPixels(SkBitmap* dst, const SkIRect* subset) {
top = 0;
height = this->info().fHeight;
}
- if (!dst->allocPixels(SkImageInfo::MakeN32Premul(width, height))) {
+ if (!dst->tryAllocN32Pixels(width, height)) {
SkDebugf("SkGrPixelRef::onReadPixels failed to alloc bitmap for result!\n");
return false;
}

Powered by Google App Engine
This is Rietveld 408576698