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

Unified Diff: samplecode/SampleApp.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 | « include/core/SkBitmap.h ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 34d1b9736047807fbe671b2a7d53eca88aea7835..e8d6d9911ece39a62250712009b0a11b148e9d6b 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -999,7 +999,7 @@ void SampleWindow::listTitles() {
static SkBitmap capture_bitmap(SkCanvas* canvas) {
SkBitmap bm;
- if (bm.allocPixels(canvas->imageInfo())) {
+ if (bm.tryAllocPixels(canvas->imageInfo())) {
canvas->readPixels(&bm, 0, 0);
}
return bm;
« no previous file with comments | « include/core/SkBitmap.h ('k') | samplecode/SampleFilterFuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698