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

Unified Diff: src/utils/mac/SkCreateCGImageRef.cpp

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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 | « src/utils/debugger/SkDebugCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/mac/SkCreateCGImageRef.cpp
diff --git a/src/utils/mac/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
index 0677b7bc304399b4aa6ffebd56992d16c99252fd..1b52ba31a695300f63933426d8f0187e40a9c8b6 100644
--- a/src/utils/mac/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -209,8 +209,9 @@ bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output) {
int h = (int)CGRectGetHeight(bounds);
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, w, h);
- bitmap.allocPixels();
+ if (!bitmap.allocPixels(SkImageInfo::MakeN32Premul(w, h))) {
+ return false;
+ }
bitmap.eraseColor(SK_ColorWHITE);
size_t bitsPerComponent;
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698