OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright 2013 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #ifndef SkPDFDeviceFlattener_DEFINED | |
9 #define SkPDFDeviceFlattener_DEFINED | |
10 | |
11 #include "SkPDFDevice.h" | |
12 | |
13 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.
| |
14 private: | |
15 typedef SkPDFDevice INHERITED; | |
16 | |
17 SK_API SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect* trimBox = NULL); | |
18 | |
19 public: | |
20 SK_API virtual ~SkPDFDeviceFlattener(); | |
21 | |
22 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | |
23 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | |
24 size_t count, const SkPoint[], | |
25 const SkPaint& paint) SK_OVERRIDE; | |
26 virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint); | |
27 virtual void drawPath(const SkDraw&, const SkPath& origpath, | |
28 const SkPaint& paint, const SkMatrix* prePathMatrix, | |
29 bool pathIsMutable) SK_OVERRIDE; | |
30 virtual void drawText(const SkDraw&, const void* text, size_t len, | |
31 SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; | |
32 virtual void drawPosText(const SkDraw&, const void* text, size_t len, | |
33 const SkScalar pos[], SkScalar constY, | |
34 int scalarsPerPos, const SkPaint&) SK_OVERRIDE; | |
35 virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, | |
36 const SkPath& path, const SkMatrix* matrix, | |
37 const SkPaint& paint) SK_OVERRIDE; | |
38 virtual void drawVertices(const SkDraw&, SkCanvas::VertexMode, | |
39 int vertexCount, const SkPoint verts[], | |
40 const SkPoint texs[], const SkColor colors[], | |
41 SkXfermode* xmode, const uint16_t indices[], | |
42 int indexCount, const SkPaint& paint) SK_OVERRIDE; | |
43 virtual void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | |
44 const SkPaint&) SK_OVERRIDE; | |
45 private: | |
46 | |
47 bool mustFlatten(const SkDraw& d) const; | |
48 bool mustPathText(const SkDraw& d, const SkPaint& paint); | |
49 | |
50 friend class SkDocument_PDF; | |
51 }; | |
52 | |
53 #endif // SkPDFDeviceFlattener_DEFINED | |
OLD | NEW |