Index: src/pdf/SkPDFDeviceFlattener.h |
diff --git a/src/pdf/SkPDFDeviceFlattener.h b/src/pdf/SkPDFDeviceFlattener.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..086e74e2086ddbea69d4b0dc9ee8b057b68a56ff |
--- /dev/null |
+++ b/src/pdf/SkPDFDeviceFlattener.h |
@@ -0,0 +1,53 @@ |
+/* |
+ * Copyright 2013 Google Inc. |
+ * |
+ * Use of this source code is governed by a BSD-style license that can be |
+ * found in the LICENSE file. |
+ */ |
+ |
+#ifndef SkPDFDeviceFlattener_DEFINED |
+#define SkPDFDeviceFlattener_DEFINED |
+ |
+#include "SkPDFDevice.h" |
+ |
+class SkPDFDeviceFlattener : public SkPDFDevice { |
vandebo (ex-Chrome)
2013/10/08 23:37:06
There's probably a better name for this: SkPerspec
edisonn
2013/10/09 13:25:55
As said before, this class will do more than flatt
vandebo (ex-Chrome)
2013/10/09 16:52:32
I must have missed that comment. This is a very g
edisonn
2013/10/10 18:35:15
Done.
|
+private: |
+ typedef SkPDFDevice INHERITED; |
+ |
+ SK_API SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect* trimBox = NULL); |
+ |
+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 // SkPDFDeviceFlattener_DEFINED |