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)), |