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

Unified Diff: samplecode/SampleUnpremul.cpp

Issue 169063002: use SkColorType instead of SkBitmap::Config in samplecode (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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/SampleTinyBitmap.cpp ('k') | samplecode/SampleVertices.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 58d8ec248c3cb9ac47814b4b5af986b61984ab53..f2f60cc3129e7c3798ba35ccd66f3bcb157fb644 100644
--- a/samplecode/SampleUnpremul.cpp
+++ b/samplecode/SampleUnpremul.cpp
@@ -125,10 +125,7 @@ protected:
// Copy it to a bitmap which can be drawn, converting
// to premultiplied:
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config, fBitmap.width(),
- fBitmap.height());
- SkASSERT(fBitmap.config() == SkBitmap::kARGB_8888_Config);
- if (!bm.allocPixels()) {
+ if (!bm.allocN32Pixels(fBitmap.width(), fBitmap.height())) {
SkString errMsg("allocPixels failed");
canvas->drawText(errMsg.c_str(), errMsg.size(), 0, height, paint);
return;
« no previous file with comments | « samplecode/SampleTinyBitmap.cpp ('k') | samplecode/SampleVertices.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698