blob: 310807d86ec4e54c1525519c2e7959e9599cadc0 [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"
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +000012#include "SkCanvas.h"
bungemand3ebb482015-08-05 13:57:49 -070013#include "SkClipStack.h"
halcanary91fcb3e2016-03-04 13:53:22 -080014#include "SkData.h"
bungemand3ebb482015-08-05 13:57:49 -070015#include "SkDevice.h"
vandebo@chromium.orga5180862010-10-26 19:48:49 +000016#include "SkPaint.h"
17#include "SkPath.h"
commit-bot@chromium.org608ea652013-10-03 19:29:21 +000018#include "SkPicture.h"
vandebo@chromium.org238be8c2012-07-13 20:06:02 +000019#include "SkRect.h"
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +000020#include "SkRefCnt.h"
21#include "SkStream.h"
epoger@google.comb58772f2013-03-08 09:09:10 +000022#include "SkTDArray.h"
commit-bot@chromium.orge0294402013-08-29 22:14:04 +000023#include "SkTemplates.h"
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000024
25class SkPDFArray;
halcanarya1f1ee92015-02-20 06:17:26 -080026class SkPDFCanon;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000027class SkPDFDevice;
28class SkPDFDict;
vandebo@chromium.org28be72b2010-11-11 21:37:00 +000029class SkPDFFont;
vandebo@chromium.org6112c212011-05-13 03:50:38 +000030class SkPDFFormXObject;
vandebo@chromium.org98594282011-07-25 22:34:12 +000031class SkPDFGlyphSetMap;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000032class SkPDFGraphicState;
33class SkPDFObject;
vandebo@chromium.orgda912d62011-03-08 18:31:02 +000034class SkPDFShader;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000035class SkPDFStream;
scroggo@google.coma8e33a92013-11-08 18:02:53 +000036class SkRRect;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000037
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +000038// Private classes.
39struct ContentEntry;
40struct GraphicStateEntry;
41
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).
62 * @param SkPDFCanon. Should be non-null, and shared by all
63 * devices in a document.
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000064 */
halcanarya1f1ee92015-02-20 06:17:26 -080065 static SkPDFDevice* Create(SkISize pageSize,
66 SkScalar rasterDpi,
67 SkPDFCanon* canon) {
halcanary385fe4d2015-08-26 13:07:48 -070068 return new SkPDFDevice(pageSize, rasterDpi, canon, true);
halcanarya1f1ee92015-02-20 06:17:26 -080069 }
70
71 /** Create a PDF drawing context without fipping the y-axis. */
72 static SkPDFDevice* CreateUnflipped(SkISize pageSize,
73 SkScalar rasterDpi,
74 SkPDFCanon* canon) {
halcanary385fe4d2015-08-26 13:07:48 -070075 return new SkPDFDevice(pageSize, rasterDpi, canon, false);
halcanarya1f1ee92015-02-20 06:17:26 -080076 }
77
78 virtual ~SkPDFDevice();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000079
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +000080 /** These are called inside the per-device-layer loop for each draw call.
81 When these are called, we have already applied any saveLayer operations,
82 and are handling any looping from the paint, and any effects from the
83 DrawFilter.
84 */
mtklein36352bf2015-03-25 18:17:31 -070085 void drawPaint(const SkDraw&, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080086 void drawPoints(const SkDraw&, SkCanvas::PointMode mode,
87 size_t count, const SkPoint[],
mtklein36352bf2015-03-25 18:17:31 -070088 const SkPaint& paint) override;
89 void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) override;
90 void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) override;
91 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080092 void drawPath(const SkDraw&, const SkPath& origpath,
93 const SkPaint& paint, const SkMatrix* prePathMatrix,
mtklein36352bf2015-03-25 18:17:31 -070094 bool pathIsMutable) override;
reed562fe472015-07-28 07:35:14 -070095 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, const SkRect* src,
96 const SkRect& dst, const SkPaint&, SkCanvas::SrcRectConstraint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080097 void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
mtklein36352bf2015-03-25 18:17:31 -070098 const SkMatrix& matrix, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -080099 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y,
mtklein36352bf2015-03-25 18:17:31 -0700100 const SkPaint& paint) override;
halcanary7a14b312015-10-01 07:28:13 -0700101 void drawImage(const SkDraw&,
102 const SkImage*,
103 SkScalar x,
104 SkScalar y,
105 const SkPaint&) override;
106 void drawImageRect(const SkDraw&,
107 const SkImage*,
108 const SkRect* src,
109 const SkRect& dst,
110 const SkPaint&,
111 SkCanvas::SrcRectConstraint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800112 void drawText(const SkDraw&, const void* text, size_t len,
mtklein36352bf2015-03-25 18:17:31 -0700113 SkScalar x, SkScalar y, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800114 void drawPosText(const SkDraw&, const void* text, size_t len,
115 const SkScalar pos[], int scalarsPerPos,
mtklein36352bf2015-03-25 18:17:31 -0700116 const SkPoint& offset, const SkPaint&) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800117 void drawVertices(const SkDraw&, SkCanvas::VertexMode,
118 int vertexCount, const SkPoint verts[],
119 const SkPoint texs[], const SkColor colors[],
120 SkXfermode* xmode, const uint16_t indices[],
mtklein36352bf2015-03-25 18:17:31 -0700121 int indexCount, const SkPaint& paint) override;
tfarinafa4f6cb2014-12-21 10:27:07 -0800122 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
mtklein36352bf2015-03-25 18:17:31 -0700123 const SkPaint&) override;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000124
mtklein36352bf2015-03-25 18:17:31 -0700125 void onAttachToCanvas(SkCanvas* canvas) override;
126 void onDetachFromCanvas() override;
127 SkImageInfo imageInfo() const override;
robertphillips@google.com40a1ae42012-07-13 15:36:15 +0000128
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000129 enum DrawingArea {
ctguil@chromium.org9510ccc2011-07-27 00:10:51 +0000130 kContent_DrawingArea, // Drawing area for the page content.
131 kMargin_DrawingArea, // Drawing area for the margin content.
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000132 };
133
134 /** Sets the drawing area for the device. Subsequent draw calls are directed
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000135 * to the specific drawing area (margin or content). The default drawing
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000136 * area is the content drawing area.
ctguil@chromium.org9510ccc2011-07-27 00:10:51 +0000137 *
138 * Currently if margin content is drawn and then a complex (for PDF) xfer
139 * mode is used, like SrcIn, Clear, etc, the margin content will get
140 * clipped. A simple way to avoid the bug is to always draw the margin
141 * content last.
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000142 */
halcanary4e4e8162015-02-25 08:59:48 -0800143 void setDrawingArea(DrawingArea drawingArea);
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000144
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000145 // PDF specific methods.
146
halcanary51d04d32016-03-08 13:03:55 -0800147 /** Create the resource dictionary for this device.
148 */
149 SkPDFDict* createResourceDict() const;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000150
vandebo@chromium.orgf0ec2662011-05-29 05:55:42 +0000151 /** Get the fonts used on this device.
152 */
halcanary4e4e8162015-02-25 08:59:48 -0800153 const SkTDArray<SkPDFFont*>& getFontResources() const;
vandebo@chromium.orgf0ec2662011-05-29 05:55:42 +0000154
wangxianzhuef6c50a2015-09-17 20:38:02 -0700155 /** Add our annotations (link to urls and destinations) to the supplied
156 * array.
157 * @param array Array to add annotations to.
158 */
159 void appendAnnotations(SkPDFArray* array) const;
160
epoger@google.comb58772f2013-03-08 09:09:10 +0000161 /** Add our named destinations to the supplied dictionary.
162 * @param dict Dictionary to add destinations to.
163 * @param page The PDF object representing the page for this device.
164 */
halcanary6d622702015-03-25 08:45:42 -0700165 void appendDestinations(SkPDFDict* dict, SkPDFObject* page) const;
epoger@google.comb58772f2013-03-08 09:09:10 +0000166
halcanary51d04d32016-03-08 13:03:55 -0800167 /** Returns a copy of the media box for this device. The caller is required
168 * to unref() this when it is finished.
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000169 */
halcanary51d04d32016-03-08 13:03:55 -0800170 SkPDFArray* copyMediaBox() const;
171
172 /** Returns a SkStream with the page contents. The caller is responsible
173 * for a deleting the returned value.
174 */
175 SkStreamAsset* content() const;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000176
halcanary334fcbc2015-02-24 12:56:16 -0800177 /** Writes the page contents to the stream. */
halcanary4e4e8162015-02-25 08:59:48 -0800178 void writeContent(SkWStream*) const;
vandebo@chromium.org98594282011-07-25 22:34:12 +0000179
halcanary4e4e8162015-02-25 08:59:48 -0800180 const SkMatrix& initialTransform() const {
vandebo@chromium.org3509f052011-05-30 20:52:33 +0000181 return fInitialTransform;
182 }
vandebo@chromium.org61d26782011-05-24 23:02:07 +0000183
vandebo@chromium.org98594282011-07-25 22:34:12 +0000184 /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font
185 * that shows on this device.
186 */
187 const SkPDFGlyphSetMap& getFontGlyphUsage() const {
188 return *(fFontGlyphUsage.get());
189 }
vandebo@chromium.org74b46192012-01-28 01:45:11 +0000190
halcanary26b5d152015-03-25 08:38:03 -0700191 SkPDFCanon* getCanon() const { return fCanon; }
halcanary26b5d152015-03-25 08:38:03 -0700192
edisonn@google.com73a7ea32013-11-11 20:55:15 +0000193protected:
mtklein36352bf2015-03-25 18:17:31 -0700194 const SkBitmap& onAccessBitmap() override {
reed89443ab2014-06-27 11:34:19 -0700195 return fLegacyBitmap;
196 }
197
mtklein36352bf2015-03-25 18:17:31 -0700198 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override;
edisonn@google.com73a7ea32013-11-11 20:55:15 +0000199
reedf70b5312016-03-04 16:36:20 -0800200 void drawAnnotation(const SkDraw&, const SkRect&, const char key[], SkData* value) override;
201
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000202private:
halcanary91fcb3e2016-03-04 13:53:22 -0800203 struct RectWithData {
204 SkRect rect;
halcanaryd7b28852016-03-07 12:39:14 -0800205 sk_sp<SkData> data;
halcanary91fcb3e2016-03-04 13:53:22 -0800206 RectWithData(const SkRect& rect, SkData* data)
207 : rect(rect), data(SkRef(data)) {}
halcanaryd7b28852016-03-07 12:39:14 -0800208 RectWithData(RectWithData&& other)
209 : rect(other.rect), data(std::move(other.data)) {}
210 RectWithData& operator=(RectWithData&& other) {
211 rect = other.rect;
212 data = std::move(other.data);
213 return *this;
214 }
halcanary91fcb3e2016-03-04 13:53:22 -0800215 };
216
217 struct NamedDestination {
halcanaryd7b28852016-03-07 12:39:14 -0800218 sk_sp<SkData> nameData;
halcanary91fcb3e2016-03-04 13:53:22 -0800219 SkPoint point;
220 NamedDestination(SkData* nameData, const SkPoint& point)
221 : nameData(SkRef(nameData)), point(point) {}
halcanaryd7b28852016-03-07 12:39:14 -0800222 NamedDestination(NamedDestination&& other)
223 : nameData(std::move(other.nameData)), point(other.point) {}
224 NamedDestination& operator=(NamedDestination&& other) {
225 nameData = std::move(other.nameData);
226 point = other.point;
227 return *this;
228 }
halcanary91fcb3e2016-03-04 13:53:22 -0800229 };
230
ctguil@chromium.org769fa6a2011-08-20 00:36:18 +0000231 // TODO(vandebo): push most of SkPDFDevice's state into a core object in
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000232 // order to get the right access levels without using friend.
vandebo@chromium.org13d14a92011-05-24 23:12:41 +0000233 friend class ScopedContentEntry;
vandebo@chromium.orga0c7edb2011-05-09 07:58:08 +0000234
ctguil@chromium.org15261292011-04-29 17:54:16 +0000235 SkISize fPageSize;
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000236 SkISize fContentSize;
vandebo@chromium.org75f97e42011-04-11 23:24:18 +0000237 SkMatrix fInitialTransform;
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000238 SkClipStack fExistingClipStack;
239 SkRegion fExistingClipRegion;
wangxianzhuef6c50a2015-09-17 20:38:02 -0700240
halcanary91fcb3e2016-03-04 13:53:22 -0800241 SkTArray<RectWithData> fLinkToURLs;
242 SkTArray<RectWithData> fLinkToDestinations;
243 SkTArray<NamedDestination> fNamedDestinations;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000244
halcanarybe27a112015-04-01 13:31:19 -0700245 SkTDArray<SkPDFObject*> fGraphicStateResources;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000246 SkTDArray<SkPDFObject*> fXObjectResources;
vandebo@chromium.org28be72b2010-11-11 21:37:00 +0000247 SkTDArray<SkPDFFont*> fFontResources;
vandebo@chromium.org421d6442011-07-20 17:39:01 +0000248 SkTDArray<SkPDFObject*> fShaderResources;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000249
commit-bot@chromium.orge0294402013-08-29 22:14:04 +0000250 SkAutoTDelete<ContentEntry> fContentEntries;
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000251 ContentEntry* fLastContentEntry;
commit-bot@chromium.orge0294402013-08-29 22:14:04 +0000252 SkAutoTDelete<ContentEntry> fMarginContentEntries;
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000253 ContentEntry* fLastMarginContentEntry;
254 DrawingArea fDrawingArea;
255
robertphillips@google.com40a1ae42012-07-13 15:36:15 +0000256 const SkClipStack* fClipStack;
257
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000258 // Accessor and setter functions based on the current DrawingArea.
commit-bot@chromium.orge0294402013-08-29 22:14:04 +0000259 SkAutoTDelete<ContentEntry>* getContentEntries();
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000260
vandebo@chromium.org98594282011-07-25 22:34:12 +0000261 // Glyph ids used for each font on this device.
commit-bot@chromium.orge0294402013-08-29 22:14:04 +0000262 SkAutoTDelete<SkPDFGlyphSetMap> fFontGlyphUsage;
vandebo@chromium.org98594282011-07-25 22:34:12 +0000263
commit-bot@chromium.org8c294902013-10-21 17:14:37 +0000264 SkScalar fRasterDpi;
edisonn@google.comd9dfa182013-04-24 13:01:01 +0000265
reed89443ab2014-06-27 11:34:19 -0700266 SkBitmap fLegacyBitmap;
267
halcanarya1f1ee92015-02-20 06:17:26 -0800268 SkPDFCanon* fCanon; // Owned by SkDocument_PDF
269 ////////////////////////////////////////////////////////////////////////////
270
271 SkPDFDevice(SkISize pageSize,
272 SkScalar rasterDpi,
273 SkPDFCanon* canon,
274 bool flip);
275
276 ContentEntry* getLastContentEntry();
277 void setLastContentEntry(ContentEntry* contentEntry);
vandebo@chromium.orga0c7edb2011-05-09 07:58:08 +0000278
mtklein36352bf2015-03-25 18:17:31 -0700279 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
bsalomon@google.come97f0852011-06-17 13:10:25 +0000280
vandebo@chromium.org77bcaa32011-04-15 20:57:37 +0000281 void init();
vandebo@chromium.org98594282011-07-25 22:34:12 +0000282 void cleanUp(bool clearFontUsage);
reed@google.comfc641d02012-09-20 17:52:20 +0000283 SkPDFFormXObject* createFormXObjectFromDevice();
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000284
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000285 void drawFormXObjectWithMask(int xObjectIndex,
286 SkPDFFormXObject* mask,
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000287 const SkClipStack* clipStack,
288 const SkRegion& clipRegion,
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000289 SkXfermode::Mode mode,
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000290 bool invertClip);
vandebo@chromium.org466f3d62011-05-18 23:06:29 +0000291
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000292 // If the paint or clip is such that we shouldn't draw anything, this
halcanary96fcdcc2015-08-27 07:41:13 -0700293 // returns nullptr and does not create a content entry.
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000294 // setUpContentEntry and finishContentEntry can be used directly, but
vandebo@chromium.org13d14a92011-05-24 23:12:41 +0000295 // the preferred method is to use the ScopedContentEntry helper class.
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000296 ContentEntry* setUpContentEntry(const SkClipStack* clipStack,
297 const SkRegion& clipRegion,
298 const SkMatrix& matrix,
299 const SkPaint& paint,
300 bool hasText,
reed@google.comfc641d02012-09-20 17:52:20 +0000301 SkPDFFormXObject** dst);
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000302 void finishContentEntry(SkXfermode::Mode xfermode,
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000303 SkPDFFormXObject* dst,
304 SkPath* shape);
vandebo@chromium.org481aef62011-05-24 16:39:05 +0000305 bool isContentEmpty();
306
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000307 void populateGraphicStateEntryFromPaint(const SkMatrix& matrix,
308 const SkClipStack& clipStack,
309 const SkRegion& clipRegion,
310 const SkPaint& paint,
311 bool hasText,
312 GraphicStateEntry* entry);
halcanarybe27a112015-04-01 13:31:19 -0700313 int addGraphicStateResource(SkPDFObject* gs);
vandebo@chromium.org3b416212013-10-30 20:48:05 +0000314 int addXObjectResource(SkPDFObject* xObject);
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000315
robertphillips8e0c1502015-07-07 10:28:43 -0700316 void updateFont(const SkPaint& paint, uint16_t glyphID, ContentEntry* contentEntry);
ctguil@chromium.org9db86bb2011-03-04 21:43:27 +0000317 int getFontResourceIndex(SkTypeface* typeface, uint16_t glyphID);
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000318
vandebo@chromium.orgb069c8c2011-05-24 17:19:38 +0000319 void internalDrawPaint(const SkPaint& paint, ContentEntry* contentEntry);
halcanary7a14b312015-10-01 07:28:13 -0700320 void internalDrawImage(const SkMatrix& matrix,
321 const SkClipStack* clipStack,
322 const SkRegion& clipRegion,
323 const SkImage* image,
324 const SkIRect* srcRect,
325 const SkPaint& paint);
vandebo@chromium.org9fbdf872011-05-09 07:55:58 +0000326
ctguil@chromium.org8dcf74f2011-07-12 21:56:27 +0000327 /** Helper method for copyContentToData. It is responsible for copying the
328 * list of content entries |entry| to |data|.
329 */
330 void copyContentEntriesToData(ContentEntry* entry, SkWStream* data) const;
ctguil@chromium.org9510ccc2011-07-27 00:10:51 +0000331
commit-bot@chromium.org92ffe7d2013-07-31 22:54:31 +0000332 bool handleInversePath(const SkDraw& d, const SkPath& origPath,
edisonn@google.coma9ebd162013-10-07 13:22:21 +0000333 const SkPaint& paint, bool pathIsMutable,
halcanary96fcdcc2015-08-27 07:41:13 -0700334 const SkMatrix* prePathMatrix = nullptr);
reedf70b5312016-03-04 16:36:20 -0800335 void handlePointAnnotation(const SkPoint&, const SkMatrix&, const char key[], SkData* value);
336 void handlePathAnnotation(const SkPath&, const SkDraw& d, const char key[], SkData* value);
vandebo@chromium.org238be8c2012-07-13 20:06:02 +0000337
reed89443ab2014-06-27 11:34:19 -0700338 typedef SkBaseDevice INHERITED;
commit-bot@chromium.org5e009892013-10-14 13:42:12 +0000339
340 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
341 // an SkPDFDevice
342 //friend class SkDocument_PDF;
343 //friend class SkPDFImageShader;
vandebo@chromium.org9b49dc02010-10-20 22:23:29 +0000344};
345
346#endif