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

Unified Diff: samplecode/SampleUnpremul.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 | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleUnpremul.cpp
diff --git a/samplecode/SampleUnpremul.cpp b/samplecode/SampleUnpremul.cpp
index bfe69e0b50e2b3246e88227ba0940e32e94a5600..992444d05d060a426ec49f39afa24c2249d215e7 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -128,11 +128,7 @@ protected:
// Copy it to a bitmap which can be drawn, converting
// to premultiplied:
SkBitmap bm;
- if (!bm.allocN32Pixels(fBitmap.width(), fBitmap.height())) {
- SkString errMsg("allocPixels failed");
- canvas->drawText(errMsg.c_str(), errMsg.size(), 0, height, paint);
- return;
- }
+ bm.allocN32Pixels(fBitmap.width(), fBitmap.height());
for (int i = 0; i < fBitmap.width(); ++i) {
for (int j = 0; j < fBitmap.height(); ++j) {
*bm.getAddr32(i, j) = premultiply_unpmcolor(*fBitmap.getAddr32(i, j));
« no previous file with comments | « samplecode/SampleFilterFuzz.cpp ('k') | src/core/SkBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698