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

Unified Diff: src/pdf/SkPDFDevice.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/lazy/SkDiscardablePixelRef.cpp ('k') | src/utils/SkPDFRasterizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index a9ad49e9ee19d422544824552365c0f11faf10bb..ff83aadeee7b8a27b71b52542625947553dbb8a2 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -2250,13 +2250,11 @@ void SkPDFDevice::internalDrawBitmap(const SkMatrix& origMatrix,
// the image. Avoiding alpha will reduce the pdf size and generation
// CPU time some.
- perspectiveBitmap.setConfig(
- SkBitmap::kARGB_8888_Config,
- SkScalarCeilToInt(
- physicalPerspectiveOutline.getBounds().width()),
- SkScalarCeilToInt(
- physicalPerspectiveOutline.getBounds().height()));
- perspectiveBitmap.allocPixels();
+ const int w = SkScalarCeilToInt(physicalPerspectiveOutline.getBounds().width());
+ const int h = SkScalarCeilToInt(physicalPerspectiveOutline.getBounds().height());
+ if (!perspectiveBitmap.allocPixels(SkImageInfo::MakeN32Premul(w, h))) {
+ return;
+ }
perspectiveBitmap.eraseColor(SK_ColorTRANSPARENT);
SkBitmapDevice device(perspectiveBitmap);
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.cpp ('k') | src/utils/SkPDFRasterizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698