blob: 9e97f67f4e464665481f2e7d1549396ae158253f [file] [log] [blame]
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * Copyright 2011 Google Inc.
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00003 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00004 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +00006 */
7
8#ifndef SkPDFDevice_DEFINED
9#define SkPDFDevice_DEFINED
10
commit-bot@chromium.org5e009892013-10-14 13:42:12 +000011#include "SkBitmap.h"
halcanarya50151d2016-03-25 11:57:49 -070012#include "SkBitmapKey.h"
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +000013#include "SkCanvas.h"
bungemand3ebb482015-08-05 13:57:49 -070014#include "SkClipStack.h"
halcanary91fcb3e2016-03-04 13:53:22 -080015#include "SkData.h"
bungemand3ebb482015-08-05 13:57:49 -070016#include "SkDevice.h"
vandebo@chromium.orga5180862010-10-26 19:48:49 +000017#include "SkPaint.h"
18#include "SkPath.h"
commit-bot@chromium.org608ea652013-10-03 19:29:21 +000019#include "SkPicture.h"
vandebo@chromium.org238be8c2012-07-13 20:06:02 +000020#include "SkRect.h"
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +000021#include "SkRefCnt.h"
22#include "SkStream.h"
epoger@google.comb58772f2013-03-08 09:09:10 +000023#include "SkTDArray.h"
commit-bot@chromium.orge0294402013-08-29 22:14:04 +000024#include "SkTemplates.h"
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000025
halcanary2be7e012016-03-28 11:58:08 -070026#include "SkSinglyLinkedList.h"
27
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000028class SkPDFArray;
halcanarya1f1ee92015-02-20 06:17:26 -080029class SkPDFCanon;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000030class SkPDFDevice;
halcanary989da4a2016-03-21 14:33:17 -070031class SkPDFDocument;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000032class SkPDFDict;
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000033class SkPDFFont;
vandebo@chromium.org6112c212011-05-13 03:50:38 +000034class SkPDFFormXObject;
vandebo@chromium.org98594282011-07-25 22:34:12 +000035class SkPDFGlyphSetMap;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000036class SkPDFGraphicState;
37class SkPDFObject;
vandebo@chromium.orgda912d62011-03-08 18:31:02 +000038class SkPDFShader;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000039class SkPDFStream;
scroggo@google.coma8e33a92013-11-08 18:02:53 +000040class SkRRect;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000041
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000042/** \class SkPDFDevice
43
44 The drawing context for the PDF backend.
45*/
halcanary70d15542015-11-22 12:55:04 -080046class SkPDFDevice final : public SkBaseDevice {
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000047public:
halcanarya1f1ee92015-02-20 06:17:26 -080048 /** Create a PDF drawing context. SkPDFDevice applies a
49 * scale-and-translate transform to move the origin from the
50 * bottom left (PDF default) to the top left (Skia default).
51 * @param pageSize Page size in point units.
52 * 1 point == 127/360 mm == 1/72 inch
53 * @param rasterDpi the DPI at which features without native PDF
54 * support will be rasterized (e.g. draw image with
55 * perspective, draw text with perspective, ...). A
56 * larger DPI would create a PDF that reflects the
57 * original intent with better fidelity, but it can make
58 * for larger PDF files too, which would use more memory
59 * while rendering, and it would be slower to be processed
60 * or sent online or to printer. A good choice is
61 * SK_ScalarDefaultRasterDPI(72.0f).
halcanary989da4a2016-03-21 14:33:17 -070062 * @param SkPDFDocument. A non-null pointer back to the
63 * document. The document is repsonsible for
64 * de-duplicating across pages (via the SkPDFCanon) and
65 * for early serializing of large immutable objects, such
66 * as images (via SkPDFDocument::serialize()).
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000067 */
halcanarya1f1ee92015-02-20 06:17:26 -080068 static SkPDFDevice* Create(SkISize pageSize,
69 SkScalar rasterDpi,
halcanary989da4a2016-03-21 14:33:17 -070070 SkPDFDocument* doc) {
71 return new SkPDFDevice(pageSize, rasterDpi, doc, true);
halcanarya1f1ee92015-02-20 06:17:26 -080072 }
73
74 /** Create a PDF drawing context without fipping the y-axis. */
75 static SkPDFDevice* CreateUnflipped(SkISize pageSize,
76 SkScalar rasterDpi,
halcanary989da4a2016-03-21 14:33:17 -070077 SkPDFDocument* doc) {
78 return new SkPDFDevice(pageSize, rasterDpi, doc, false);
halcanarya1f1ee92015-02-20 06:17:26 -080079 }
80
81 virtual ~SkPDFDevice();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000082
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000083 /** These are called inside the per-device-layer loop for each draw call.
84 When these are called, we have already applied any saveLayer operations,
85 and are handling any looping from the paint, and any effects from the
86 DrawFilter.
87 */
mtklein36352bf2015-03-25 18:17:31 -070088 void drawPaint(const SkDraw&, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080089 void drawPoints(const SkDraw&, SkCanvas::PointMode mode,
90 size_t count, const SkPoint[],
mtklein36352bf2015-03-25 18:17:31 -070091 const SkPaint& paint) override;
92 void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) override;
93 void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) override;
94 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080095 void drawPath(const SkDraw&, const SkPath& origpath,
96 const SkPaint& paint, const SkMatrix* prePathMatrix,
mtklein36352bf2015-03-25 18:17:31 -070097 bool pathIsMutable) override;
reed562fe472015-07-28 07:35:14 -070098 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect* src,
99 const SkRect& dst, const SkPaint&, SkCanvas::SrcRectConstraint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800100 void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
mtklein36352bf2015-03-25 18:17:31 -0700101 const SkMatrix& matrix, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800102 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y,
mtklein36352bf2015-03-25 18:17:31 -0700103 const SkPaint& paint) override;
halcanary7a14b312015-10-01 07:28:13 -0700104 void drawImage(const SkDraw&,
105 const SkImage*,
106 SkScalar x,
107 SkScalar y,
108 const SkPaint&) override;
109 void drawImageRect(const SkDraw&,
110 const SkImage*,
111 const SkRect* src,
112 const SkRect& dst,
113 const SkPaint&,
114 SkCanvas::SrcRectConstraint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800115 void drawText(const SkDraw&, const void* text, size_t len,
mtklein36352bf2015-03-25 18:17:31 -0700116 SkScalar x, SkScalar y, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800117 void drawPosText(const SkDraw&, const void* text, size_t len,
118 const SkScalar pos[], int scalarsPerPos,
mtklein36352bf2015-03-25 18:17:31 -0700119 const SkPoint& offset, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800120 void drawVertices(const SkDraw&, SkCanvas::VertexMode,
121 int vertexCount, const SkPoint verts[],
122 const SkPoint texs[], const SkColor colors[],
123 SkXfermode* xmode, const uint16_t indices[],
mtklein36352bf2015-03-25 18:17:31 -0700124 int indexCount, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800125 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
mtklein36352bf2015-03-25 18:17:31 -0700126 const SkPaint&) override;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000127
mtklein36352bf2015-03-25 18:17:31 -0700128 void onAttachToCanvas(SkCanvas* canvas) override;
129 void onDetachFromCanvas() override;
130 SkImageInfo imageInfo() const override;
robertphillips@google.com40a1ae42012-07-13 15:36:15 +0000131
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000132 // PDF specific methods.
133
halcanary8103a342016-03-08 15:10:16 -0800134 /** Create the resource dictionary for this device. */
135 sk_sp<SkPDFDict> makeResourceDict() const;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000136
vandebo@chromium.orgf0ec2662011-05-29 05:55:42 +0000137 /** Get the fonts used on this device.
138 */
halcanary4e4e8162015-02-25 08:59:48 -0800139 const SkTDArray<SkPDFFont*>& getFontResources() const;
vandebo@chromium.orgf0ec2662011-05-29 05:55:42 +0000140
wangxianzhuef6c50a2015-09-17 20:38:02 -0700141 /** Add our annotations (link to urls and destinations) to the supplied
142 * array.
143 * @param array Array to add annotations to.
144 */
145 void appendAnnotations(SkPDFArray* array) const;
146
epoger@google.comb58772f2013-03-08 09:09:10 +0000147 /** Add our named destinations to the supplied dictionary.
148 * @param dict Dictionary to add destinations to.
149 * @param page The PDF object representing the page for this device.
150 */
halcanary6d622702015-03-25 08:45:42 -0700151 void appendDestinations(SkPDFDict* dict, SkPDFObject* page) const;
epoger@google.comb58772f2013-03-08 09:09:10 +0000152
halcanary8103a342016-03-08 15:10:16 -0800153 /** Returns a copy of the media box for this device. */
154 sk_sp<SkPDFArray> copyMediaBox() const;
halcanary51d04d32016-03-08 13:03:55 -0800155
halcanary8103a342016-03-08 15:10:16 -0800156 /** Returns a SkStream with the page contents.
halcanary51d04d32016-03-08 13:03:55 -0800157 */
mtklein5f939ab2016-03-16 10:28:35 -0700158 std::unique_ptr<SkStreamAsset> content() const;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000159
halcanary334fcbc2015-02-24 12:56:16 -0800160 /** Writes the page contents to the stream. */
halcanary4e4e8162015-02-25 08:59:48 -0800161 void writeContent(SkWStream*) const;
vandebo@chromium.org98594282011-07-25 22:34:12 +0000162
halcanary4e4e8162015-02-25 08:59:48 -0800163 const SkMatrix& initialTransform() const {
vandebo@chromium.org3509f052011-05-30 20:52:33 +0000164 return fInitialTransform;
165 }
vandebo@chromium.org61d26782011-05-24 23:02:07 +0000166
vandebo@chromium.org98594282011-07-25 22:34:12 +0000167 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font
168 * that shows on this device.
169 */
170 const SkPDFGlyphSetMap& getFontGlyphUsage() const {
171 return *(fFontGlyphUsage.get());
172 }
vandebo@chromium.org74b46192012-01-28 01:45:11 +0000173
halcanary989da4a2016-03-21 14:33:17 -0700174 SkPDFCanon* getCanon() const;
halcanary26b5d152015-03-25 08:38:03 -0700175
halcanary2be7e012016-03-28 11:58:08 -0700176 // It is important to not confuse GraphicStateEntry with SkPDFGraphicState, the
177 // later being our representation of an object in the PDF file.
178 struct GraphicStateEntry {
179 GraphicStateEntry();
180
181 // Compare the fields we care about when setting up a new content entry.
182 bool compareInitialState(const GraphicStateEntry& b);
183
184 SkMatrix fMatrix;
185 // We can't do set operations on Paths, though PDF natively supports
186 // intersect. If the clip stack does anything other than intersect,
187 // we have to fall back to the region. Treat fClipStack as authoritative.
188 // See https://bugs.skia.org/221
189 SkClipStack fClipStack;
190 SkRegion fClipRegion;
191
192 // When emitting the content entry, we will ensure the graphic state
193 // is set to these values first.
194 SkColor fColor;
195 SkScalar fTextScaleX; // Zero means we don't care what the value is.
196 SkPaint::Style fTextFill; // Only if TextScaleX is non-zero.
197 int fShaderIndex;
198 int fGraphicStateIndex;
199
200 // We may change the font (i.e. for Type1 support) within a
201 // ContentEntry. This is the one currently in effect, or nullptr if none.
202 SkPDFFont* fFont;
203 // In PDF, text size has no default value. It is only valid if fFont is
204 // not nullptr.
205 SkScalar fTextSize;
206 };
207
edisonn@google.com73a7ea32013-11-11 20:55:15 +0000208protected:
mtklein36352bf2015-03-25 18:17:31 -0700209 const SkBitmap& onAccessBitmap() override {
reed89443ab2014-06-27 11:34:19 -0700210 return fLegacyBitmap;
211 }
212
reede8f30622016-03-23 18:59:25 -0700213 sk_sp<SkSurface> makeSurface(const SkImageInfo&, const SkSurfaceProps&) override;
edisonn@google.com73a7ea32013-11-11 20:55:15 +0000214
reedf70b5312016-03-04 16:36:20 -0800215 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData* value) override;
216
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000217private:
halcanary91fcb3e2016-03-04 13:53:22 -0800218 struct RectWithData {
219 SkRect rect;
halcanaryd7b28852016-03-07 12:39:14 -0800220 sk_sp<SkData> data;
halcanary91fcb3e2016-03-04 13:53:22 -0800221 RectWithData(const SkRect& rect, SkData* data)
222 : rect(rect), data(SkRef(data)) {}
halcanaryd7b28852016-03-07 12:39:14 -0800223 RectWithData(RectWithData&& other)
224 : rect(other.rect), data(std::move(other.data)) {}
225 RectWithData& operator=(RectWithData&& other) {
226 rect = other.rect;
227 data = std::move(other.data);
228 return *this;
229 }
halcanary91fcb3e2016-03-04 13:53:22 -0800230 };
231
232 struct NamedDestination {
halcanaryd7b28852016-03-07 12:39:14 -0800233 sk_sp<SkData> nameData;
halcanary91fcb3e2016-03-04 13:53:22 -0800234 SkPoint point;
235 NamedDestination(SkData* nameData, const SkPoint& point)
236 : nameData(SkRef(nameData)), point(point) {}
halcanaryd7b28852016-03-07 12:39:14 -0800237 NamedDestination(NamedDestination&& other)
238 : nameData(std::move(other.nameData)), point(other.point) {}
239 NamedDestination& operator=(NamedDestination&& other) {
240 nameData = std::move(other.nameData);
241 point = other.point;
242 return *this;
243 }
halcanary91fcb3e2016-03-04 13:53:22 -0800244 };
245
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000246 // TODO(vandebo): push most of SkPDFDevice's state into a core object in
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000247 // order to get the right access levels without using friend.
vandebo@chromium.org13d14a92011-05-24 23:12:41 +0000248 friend class ScopedContentEntry;
vandebo@chromium.orga0c7edb2011-05-09 07:58:08 +0000249
ctguil@chromium.org15261292011-04-29 17:54:16 +0000250 SkISize fPageSize;
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000251 SkISize fContentSize;
vandebo@chromium.org75f97e42011-04-11 23:24:18 +0000252 SkMatrix fInitialTransform;
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000253 SkClipStack fExistingClipStack;
254 SkRegion fExistingClipRegion;
wangxianzhuef6c50a2015-09-17 20:38:02 -0700255
halcanary91fcb3e2016-03-04 13:53:22 -0800256 SkTArray<RectWithData> fLinkToURLs;
257 SkTArray<RectWithData> fLinkToDestinations;
258 SkTArray<NamedDestination> fNamedDestinations;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000259
halcanarybe27a112015-04-01 13:31:19 -0700260 SkTDArray<SkPDFObject*> fGraphicStateResources;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000261 SkTDArray<SkPDFObject*> fXObjectResources;
vandebo@chromium.org28be72b2010-11-11 21:37:00 +0000262 SkTDArray<SkPDFFont*> fFontResources;
vandebo@chromium.org421d6442011-07-20 17:39:01 +0000263 SkTDArray<SkPDFObject*> fShaderResources;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000264
halcanary2be7e012016-03-28 11:58:08 -0700265 struct ContentEntry {
266 GraphicStateEntry fState;
267 SkDynamicMemoryWStream fContent;
268 };
269 SkSinglyLinkedList<ContentEntry> fContentEntries;
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000270
robertphillips@google.com40a1ae42012-07-13 15:36:15 +0000271 const SkClipStack* fClipStack;
272
vandebo@chromium.org98594282011-07-25 22:34:12 +0000273 // Glyph ids used for each font on this device.
halcanaryb8fb9932016-03-28 07:58:30 -0700274 std::unique_ptr<SkPDFGlyphSetMap> fFontGlyphUsage;
vandebo@chromium.org98594282011-07-25 22:34:12 +0000275
commit-bot@chromium.org8c294902013-10-21 17:14:37 +0000276 SkScalar fRasterDpi;
edisonn@google.comd9dfa182013-04-24 13:01:01 +0000277
reed89443ab2014-06-27 11:34:19 -0700278 SkBitmap fLegacyBitmap;
279
halcanary989da4a2016-03-21 14:33:17 -0700280 SkPDFDocument* fDocument;
halcanarya1f1ee92015-02-20 06:17:26 -0800281 ////////////////////////////////////////////////////////////////////////////
282
283 SkPDFDevice(SkISize pageSize,
284 SkScalar rasterDpi,
halcanary989da4a2016-03-21 14:33:17 -0700285 SkPDFDocument* doc,
halcanarya1f1ee92015-02-20 06:17:26 -0800286 bool flip);
287
mtklein36352bf2015-03-25 18:17:31 -0700288 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
bsalomon@google.come97f0852011-06-17 13:10:25 +0000289
vandebo@chromium.org77bcaa32011-04-15 20:57:37 +0000290 void init();
vandebo@chromium.org98594282011-07-25 22:34:12 +0000291 void cleanUp(bool clearFontUsage);
reed@google.comfc641d02012-09-20 17:52:20 +0000292 SkPDFFormXObject* createFormXObjectFromDevice();
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000293
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000294 void drawFormXObjectWithMask(int xObjectIndex,
295 SkPDFFormXObject* mask,
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000296 const SkClipStack* clipStack,
297 const SkRegion& clipRegion,
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000298 SkXfermode::Mode mode,
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000299 bool invertClip);
vandebo@chromium.org466f3d62011-05-18 23:06:29 +0000300
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000301 // If the paint or clip is such that we shouldn't draw anything, this
halcanary96fcdcc2015-08-27 07:41:13 -0700302 // returns nullptr and does not create a content entry.
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000303 // setUpContentEntry and finishContentEntry can be used directly, but
vandebo@chromium.org13d14a92011-05-24 23:12:41 +0000304 // the preferred method is to use the ScopedContentEntry helper class.
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000305 ContentEntry* setUpContentEntry(const SkClipStack* clipStack,
306 const SkRegion& clipRegion,
307 const SkMatrix& matrix,
308 const SkPaint& paint,
309 bool hasText,
reed@google.comfc641d02012-09-20 17:52:20 +0000310 SkPDFFormXObject** dst);
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000311 void finishContentEntry(SkXfermode::Mode xfermode,
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000312 SkPDFFormXObject* dst,
313 SkPath* shape);
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000314 bool isContentEmpty();
315
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000316 void populateGraphicStateEntryFromPaint(const SkMatrix& matrix,
317 const SkClipStack& clipStack,
318 const SkRegion& clipRegion,
319 const SkPaint& paint,
320 bool hasText,
321 GraphicStateEntry* entry);
halcanarybe27a112015-04-01 13:31:19 -0700322 int addGraphicStateResource(SkPDFObject* gs);
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000323 int addXObjectResource(SkPDFObject* xObject);
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000324
robertphillips8e0c1502015-07-07 10:28:43 -0700325 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* contentEntry);
ctguil@chromium.org9db86bb2011-03-04 21:43:27 +0000326 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000327
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000328 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry);
halcanarya50151d2016-03-25 11:57:49 -0700329
330 void internalDrawImage(const SkMatrix& origMatrix,
halcanary7a14b312015-10-01 07:28:13 -0700331 const SkClipStack* clipStack,
halcanarya50151d2016-03-25 11:57:49 -0700332 const SkRegion& origClipRegion,
333 SkImageBitmap imageBitmap,
halcanary7a14b312015-10-01 07:28:13 -0700334 const SkPaint& paint);
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000335
commit-bot@chromium.org92ffe7d2013-07-31 22:54:31 +0000336 bool handleInversePath(const SkDraw& d, const SkPath& origPath,
edisonn@google.coma9ebd162013-10-07 13:22:21 +0000337 const SkPaint& paint, bool pathIsMutable,
halcanary96fcdcc2015-08-27 07:41:13 -0700338 const SkMatrix* prePathMatrix = nullptr);
reedf70b5312016-03-04 16:36:20 -0800339 void handlePointAnnotation(const SkPoint&, const SkMatrix&, const char key[], SkData* value);
340 void handlePathAnnotation(const SkPath&, const SkDraw& d, const char key[], SkData* value);
vandebo@chromium.org238be8c2012-07-13 20:06:02 +0000341
reed89443ab2014-06-27 11:34:19 -0700342 typedef SkBaseDevice INHERITED;
commit-bot@chromium.org5e009892013-10-14 13:42:12 +0000343
344 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
345 // an SkPDFDevice
346 //friend class SkDocument_PDF;
347 //friend class SkPDFImageShader;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000348};
349
350#endif