Index: tools/PdfRenderer.h |
diff --git a/tools/PdfRenderer.h b/tools/PdfRenderer.h |
index be338e9ea3dd2787aa8832f3be945fd046fe8fbe..d70c458c74877918f777b7412b958386ff3f8cbd 100644 |
--- a/tools/PdfRenderer.h |
+++ b/tools/PdfRenderer.h |
@@ -13,8 +13,8 @@ |
// An SkPicture can be built manually, or read from an SKP file. |
// |
+#include "SkDocument.h" |
#include "SkMath.h" |
-#include "SkPDFDevice.h" |
#include "SkPicture.h" |
#include "SkTypes.h" |
#include "SkTDArray.h" |
@@ -23,32 +23,30 @@ |
class SkBitmap; |
class SkCanvas; |
+class SkWStream; |
namespace sk_tools { |
class PdfRenderer : public SkRefCnt { |
public: |
- virtual void init(SkPicture* pict); |
+ virtual void init(SkPicture* pict, SkWStream* stream); |
virtual void setup() {} |
- virtual void render() = 0; |
+ virtual bool render() = 0; |
virtual void end(); |
PdfRenderer(SkPicture::EncodeBitmap encoder) |
: fPicture(NULL) |
- , fPDFDevice(NULL) |
, fEncoder(encoder) |
+ , fPdfDoc(NULL) |
{} |
- void write(SkWStream* stream) const; |
- |
protected: |
- SkCanvas* setupCanvas(); |
- SkCanvas* setupCanvas(int width, int height); |
+ SkCanvas* setupCanvas(SkWStream* stream, int width, int height); |
SkAutoTUnref<SkCanvas> fCanvas; |
SkPicture* fPicture; |
- SkPDFDevice* fPDFDevice; |
SkPicture::EncodeBitmap fEncoder; |
+ SkAutoTUnref<SkDocument> fPdfDoc; |
private: |
typedef SkRefCnt INHERITED; |
@@ -58,7 +56,7 @@ class SimplePdfRenderer : public PdfRenderer { |
public: |
SimplePdfRenderer(SkPicture::EncodeBitmap encoder) |
: PdfRenderer(encoder) {} |
- virtual void render() SK_OVERRIDE; |
+ virtual bool render() SK_OVERRIDE; |
private: |
typedef PdfRenderer INHERITED; |