Chromium Code Reviews| Index: include/pdf/SkPDFDevice.h |
| diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h |
| index 02acce365abcaa374be95c86f5285a89280c815b..8c3d7840366d65643a8d987097a3d95a96de7a40 100644 |
| --- a/include/pdf/SkPDFDevice.h |
| +++ b/include/pdf/SkPDFDevice.h |
| @@ -11,6 +11,7 @@ |
| #define SkPDFDevice_DEFINED |
| #include "SkBitmapDevice.h" |
| +#include "SkBitmap.h" |
| #include "SkCanvas.h" |
| #include "SkPaint.h" |
| #include "SkPath.h" |
| @@ -21,6 +22,7 @@ |
| #include "SkTDArray.h" |
| #include "SkTemplates.h" |
| +class CanvasTestStep; |
| class SkPDFArray; |
| class SkPDFDevice; |
| class SkPDFDict; |
| @@ -34,11 +36,20 @@ class SkPDFShader; |
| class SkPDFStream; |
| template <typename T> class SkTSet; |
| +namespace skiatest { |
| +class Reporter; |
|
reed1
2013/10/07 13:24:54
Why is this declared here?
edisonn
2013/10/07 19:29:06
test code, removed
|
| +} |
| + |
| +namespace sk_tools { |
| +class PdfRenderer; |
|
reed1
2013/10/07 13:24:54
Why is this declared here?
edisonn
2013/10/07 19:29:06
test code, removed
|
| +} |
| // Private classes. |
| struct ContentEntry; |
| struct GraphicStateEntry; |
| struct NamedDestination; |
| +typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, const SkIRect& rect); |
|
reed1
2013/10/07 13:24:54
Is this different form the EncodeProc type added t
edisonn
2013/10/07 19:29:06
Unused, removed
vandebo (ex-Chrome)
2013/10/07 22:34:10
remove?
edisonn
2013/10/08 17:55:30
removed
|
| + |
| /** \class SkPDFDevice |
| The drawing context for the PDF backend. |
| @@ -64,6 +75,7 @@ public: |
| * always does. |
| */ |
| // TODO(vandebo): The sizes should be SkSize and not SkISize. |
|
reed1
2013/10/07 13:24:54
lets remove the TODO if this is deprecated
edisonn
2013/10/07 19:29:06
Done.
|
| + // Deprecated, please use SkDocument::CreatePdf() instead. |
| SK_API SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize, |
| const SkMatrix& initialTransform); |
| SK_API virtual ~SkPDFDevice(); |
| @@ -197,6 +209,8 @@ protected: |
| virtual bool allowImageFilter(SkImageFilter*) SK_OVERRIDE; |
| private: |
| + SK_API SkPDFDevice(const SkSize& trimBox, const SkRect& mediaBox); |
| + |
| // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
| // order to get the right access levels without using friend. |
| friend class ScopedContentEntry; |
| @@ -310,6 +324,51 @@ private: |
| const SkMatrix& matrix); |
| typedef SkBitmapDevice INHERITED; |
| + |
| + // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create |
| + // an SkPDFDevice |
| + friend class SkDocument_PDF; |
| + friend class SkPDFImageShader; |
| +}; |
| + |
| +class SkPDFDeviceFlattener : public SkPDFDevice { |
|
reed1
2013/10/07 13:24:54
Does this class need to be in this header, or can
edisonn
2013/10/07 19:29:06
I could put all this logic inside PDF, but long te
vandebo (ex-Chrome)
2013/10/07 22:34:10
Flattener is a very generic name. Is this meant t
edisonn
2013/10/08 17:55:30
This class will flatten other properties unsuporte
|
| +private: |
| + typedef SkPDFDevice INHERITED; |
| + |
| + SK_API SkPDFDeviceFlattener(const SkSize& trimBox, const SkRect& mediaBox); |
| + |
| +public: |
| + SK_API virtual ~SkPDFDeviceFlattener(); |
| + |
| + virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; |
| + virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
| + size_t count, const SkPoint[], |
| + const SkPaint& paint) SK_OVERRIDE; |
| + virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint); |
| + virtual void drawPath(const SkDraw&, const SkPath& origpath, |
| + const SkPaint& paint, const SkMatrix* prePathMatrix, |
| + bool pathIsMutable) SK_OVERRIDE; |
| + virtual void drawText(const SkDraw&, const void* text, size_t len, |
| + SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; |
| + virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
| + const SkScalar pos[], SkScalar constY, |
| + int scalarsPerPos, const SkPaint&) SK_OVERRIDE; |
| + virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
| + const SkPath& path, const SkMatrix* matrix, |
| + const SkPaint& paint) SK_OVERRIDE; |
| + virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
| + int vertexCount, const SkPoint verts[], |
| + const SkPoint texs[], const SkColor colors[], |
| + SkXfermode* xmode, const uint16_t indices[], |
| + int indexCount, const SkPaint& paint) SK_OVERRIDE; |
| + virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
| + const SkPaint&) SK_OVERRIDE; |
| +private: |
| + |
| + bool mustFlatten(const SkDraw& d) const; |
| + bool mustPathText(const SkDraw& d, const SkPaint& paint); |
| + |
| + friend class SkDocument_PDF; |
| }; |
| #endif |