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

Unified Diff: src/gpu/GrSurface.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/GrSurface.cpp
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index a07fe67ae458dabd45e61305753dcf4cf9862aca..54497fe8c8a3018a98679be480b8ec7f15b72eeb 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -25,8 +25,7 @@ SkImageInfo GrSurface::info() const {
bool GrSurface::savePixels(const char* filename) {
SkBitmap bm;
- if (!bm.allocPixels(SkImageInfo::MakeN32Premul(this->width(),
- this->height()))) {
+ if (!bm.tryAllocPixels(SkImageInfo::MakeN32Premul(this->width(), this->height()))) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698