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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 173893002: use colortype instead of config (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 | « src/lazy/SkDiscardablePixelRef.cpp ('k') | src/utils/SkPictureUtils.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 a7ef08d21d56c22c8f20490896b1f6b9ac35b3de..ff3878b803189d336541230425c87c847b0be631 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -704,7 +704,7 @@ private:
static inline SkBitmap makeContentBitmap(const SkISize& contentSize,
const SkMatrix* initialTransform) {
- SkBitmap bitmap;
+ SkImageInfo info;
if (initialTransform) {
// Compute the size of the drawing area.
SkVector drawingSize;
@@ -718,17 +718,19 @@ static inline SkBitmap makeContentBitmap(const SkISize& contentSize,
}
inverse.mapVectors(&drawingSize, 1);
SkISize size = SkSize::Make(drawingSize.fX, drawingSize.fY).toRound();
- bitmap.setConfig(SkBitmap::kNo_Config, abs(size.fWidth),
- abs(size.fHeight));
+ info = SkImageInfo::MakeUnknown(abs(size.fWidth), abs(size.fHeight));
} else {
- bitmap.setConfig(SkBitmap::kNo_Config, abs(contentSize.fWidth),
- abs(contentSize.fHeight));
+ info = SkImageInfo::MakeUnknown(abs(contentSize.fWidth),
+ abs(contentSize.fHeight));
}
+ SkBitmap bitmap;
+ bitmap.setConfig(info);
return bitmap;
}
// TODO(vandebo) change pageSize to SkSize.
+// TODO: inherit from SkBaseDevice instead of SkBitmapDevice
SkPDFDevice::SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize,
const SkMatrix& initialTransform)
: SkBitmapDevice(makeContentBitmap(contentSize, &initialTransform)),
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.cpp ('k') | src/utils/SkPictureUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698