OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPDFDevice_DEFINED | 10 #ifndef SkPDFDevice_DEFINED |
(...skipping 17 matching lines...) Expand all Loading... |
28 class SkPDFDict; | 28 class SkPDFDict; |
29 class SkPDFFont; | 29 class SkPDFFont; |
30 class SkPDFFormXObject; | 30 class SkPDFFormXObject; |
31 class SkPDFGlyphSetMap; | 31 class SkPDFGlyphSetMap; |
32 class SkPDFGraphicState; | 32 class SkPDFGraphicState; |
33 class SkPDFObject; | 33 class SkPDFObject; |
34 class SkPDFResourceDict; | 34 class SkPDFResourceDict; |
35 class SkPDFShader; | 35 class SkPDFShader; |
36 class SkPDFStream; | 36 class SkPDFStream; |
37 class SkRRect; | 37 class SkRRect; |
38 template <typename T> class SkTSet; | |
39 | 38 |
40 // Private classes. | 39 // Private classes. |
41 struct ContentEntry; | 40 struct ContentEntry; |
42 struct GraphicStateEntry; | 41 struct GraphicStateEntry; |
43 struct NamedDestination; | 42 struct NamedDestination; |
44 | 43 |
45 /** \class SkPDFDevice | 44 /** \class SkPDFDevice |
46 | 45 |
47 The drawing context for the PDF backend. | 46 The drawing context for the PDF backend. |
48 */ | 47 */ |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * | 130 * |
132 * Currently if margin content is drawn and then a complex (for PDF) xfer | 131 * Currently if margin content is drawn and then a complex (for PDF) xfer |
133 * mode is used, like SrcIn, Clear, etc, the margin content will get | 132 * mode is used, like SrcIn, Clear, etc, the margin content will get |
134 * clipped. A simple way to avoid the bug is to always draw the margin | 133 * clipped. A simple way to avoid the bug is to always draw the margin |
135 * content last. | 134 * content last. |
136 */ | 135 */ |
137 void setDrawingArea(DrawingArea drawingArea); | 136 void setDrawingArea(DrawingArea drawingArea); |
138 | 137 |
139 // PDF specific methods. | 138 // PDF specific methods. |
140 | 139 |
141 /** Returns the resource dictionary for this device. | 140 /** Create the resource dictionary for this device. |
142 */ | 141 */ |
143 SkPDFResourceDict* getResourceDict(); | 142 SkPDFResourceDict* createResourceDict() const; |
144 | 143 |
145 /** Get the fonts used on this device. | 144 /** Get the fonts used on this device. |
146 */ | 145 */ |
147 const SkTDArray<SkPDFFont*>& getFontResources() const; | 146 const SkTDArray<SkPDFFont*>& getFontResources() const; |
148 | 147 |
149 /** Add our named destinations to the supplied dictionary. | 148 /** Add our named destinations to the supplied dictionary. |
150 * @param dict Dictionary to add destinations to. | 149 * @param dict Dictionary to add destinations to. |
151 * @param page The PDF object representing the page for this device. | 150 * @param page The PDF object representing the page for this device. |
152 */ | 151 */ |
153 void appendDestinations(SkPDFDict* dict, SkPDFObject* page); | 152 void appendDestinations(SkPDFDict* dict, SkPDFObject* page) const; |
154 | 153 |
155 /** Returns a copy of the media box for this device. The caller is required | 154 /** Returns a copy of the media box for this device. The caller is required |
156 * to unref() this when it is finished. | 155 * to unref() this when it is finished. |
157 */ | 156 */ |
158 SkPDFArray* copyMediaBox() const; | 157 SkPDFArray* copyMediaBox() const; |
159 | 158 |
160 /** Get the annotations from this page, or NULL if there are none. | 159 /** Get the annotations from this page, or NULL if there are none. |
161 */ | 160 */ |
162 SkPDFArray* getAnnotations() const { return fAnnotations; } | 161 SkPDFArray* getAnnotations() const { return fAnnotations; } |
163 | 162 |
(...skipping 27 matching lines...) Expand all Loading... |
191 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 190 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
192 // order to get the right access levels without using friend. | 191 // order to get the right access levels without using friend. |
193 friend class ScopedContentEntry; | 192 friend class ScopedContentEntry; |
194 | 193 |
195 SkISize fPageSize; | 194 SkISize fPageSize; |
196 SkISize fContentSize; | 195 SkISize fContentSize; |
197 SkMatrix fInitialTransform; | 196 SkMatrix fInitialTransform; |
198 SkClipStack fExistingClipStack; | 197 SkClipStack fExistingClipStack; |
199 SkRegion fExistingClipRegion; | 198 SkRegion fExistingClipRegion; |
200 SkPDFArray* fAnnotations; | 199 SkPDFArray* fAnnotations; |
201 SkPDFResourceDict* fResourceDict; | |
202 SkTDArray<NamedDestination*> fNamedDestinations; | 200 SkTDArray<NamedDestination*> fNamedDestinations; |
203 | 201 |
204 SkTDArray<SkPDFGraphicState*> fGraphicStateResources; | 202 SkTDArray<SkPDFGraphicState*> fGraphicStateResources; |
205 SkTDArray<SkPDFObject*> fXObjectResources; | 203 SkTDArray<SkPDFObject*> fXObjectResources; |
206 SkTDArray<SkPDFFont*> fFontResources; | 204 SkTDArray<SkPDFFont*> fFontResources; |
207 SkTDArray<SkPDFObject*> fShaderResources; | 205 SkTDArray<SkPDFObject*> fShaderResources; |
208 | 206 |
209 SkAutoTDelete<ContentEntry> fContentEntries; | 207 SkAutoTDelete<ContentEntry> fContentEntries; |
210 ContentEntry* fLastContentEntry; | 208 ContentEntry* fLastContentEntry; |
211 SkAutoTDelete<ContentEntry> fMarginContentEntries; | 209 SkAutoTDelete<ContentEntry> fMarginContentEntries; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 306 |
309 typedef SkBaseDevice INHERITED; | 307 typedef SkBaseDevice INHERITED; |
310 | 308 |
311 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 309 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
312 // an SkPDFDevice | 310 // an SkPDFDevice |
313 //friend class SkDocument_PDF; | 311 //friend class SkDocument_PDF; |
314 //friend class SkPDFImageShader; | 312 //friend class SkPDFImageShader; |
315 }; | 313 }; |
316 | 314 |
317 #endif | 315 #endif |
OLD | NEW |