use real pdfdevice behind SkDocument
authorreed <reed@google.com>
Thu, 9 Oct 2014 12:30:10 +0000 (05:30 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 9 Oct 2014 12:30:10 +0000 (05:30 -0700)
BUG=skia:
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/645563002

src/doc/SkDocument_PDF.cpp

index 142099375cbf3c5405c6c29d1db320780e170a41..781885dc1317a74fe1ddb883d7b361d5a851968a 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "SkDocument.h"
 #include "SkPDFDocument.h"
-#include "SkPDFDeviceFlattener.h"
+#include "SkPDFDevice.h"
 
 class SkDocument_PDF : public SkDocument {
 public:
@@ -33,10 +33,10 @@ protected:
         SkASSERT(NULL == fCanvas);
         SkASSERT(NULL == fDevice);
 
-        SkSize mediaBoxSize;
-        mediaBoxSize.set(width, height);
+        SkISize mediaBoxSize;
+        mediaBoxSize.set(SkScalarRoundToInt(width), SkScalarRoundToInt(height));
 
-        fDevice = SkNEW_ARGS(SkPDFDeviceFlattener, (mediaBoxSize, &trimBox));
+        fDevice = SkNEW_ARGS(SkPDFDevice, (mediaBoxSize, mediaBoxSize, SkMatrix::I()));
         if (fEncoder) {
             fDevice->setDCTEncoder(fEncoder);
         }
@@ -78,7 +78,7 @@ protected:
 
 private:
     SkPDFDocument*  fDoc;
-    SkPDFDeviceFlattener* fDevice;
+    SkPDFDevice*    fDevice;
     SkCanvas*       fCanvas;
     SkPicture::EncodeBitmap fEncoder;
     SkScalar        fRasterDpi;