| 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 10 matching lines...) Expand all Loading... |
| 21 #include "SkTScopedPtr.h" | 21 #include "SkTScopedPtr.h" |
| 22 | 22 |
| 23 class SkPDFArray; | 23 class SkPDFArray; |
| 24 class SkPDFDevice; | 24 class SkPDFDevice; |
| 25 class SkPDFDict; | 25 class SkPDFDict; |
| 26 class SkPDFFont; | 26 class SkPDFFont; |
| 27 class SkPDFFormXObject; | 27 class SkPDFFormXObject; |
| 28 class SkPDFGlyphSetMap; | 28 class SkPDFGlyphSetMap; |
| 29 class SkPDFGraphicState; | 29 class SkPDFGraphicState; |
| 30 class SkPDFObject; | 30 class SkPDFObject; |
| 31 class SkPDFResourceDict; | |
| 32 class SkPDFShader; | 31 class SkPDFShader; |
| 33 class SkPDFStream; | 32 class SkPDFStream; |
| 34 template <typename T> class SkTSet; | 33 template <typename T> class SkTSet; |
| 35 | 34 |
| 36 // Private classes. | 35 // Private classes. |
| 37 struct ContentEntry; | 36 struct ContentEntry; |
| 38 struct GraphicStateEntry; | 37 struct GraphicStateEntry; |
| 39 struct NamedDestination; | 38 struct NamedDestination; |
| 40 | 39 |
| 41 typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, con
st SkIRect& rect); | 40 typedef bool (*EncodeToDCTStream)(SkWStream* stream, const SkBitmap& bitmap, con
st SkIRect& rect); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 * if any at all. | 140 * if any at all. |
| 142 */ | 141 */ |
| 143 void setDCTEncoder(EncodeToDCTStream encoder) { | 142 void setDCTEncoder(EncodeToDCTStream encoder) { |
| 144 fEncoder = encoder; | 143 fEncoder = encoder; |
| 145 } | 144 } |
| 146 | 145 |
| 147 // PDF specific methods. | 146 // PDF specific methods. |
| 148 | 147 |
| 149 /** Returns the resource dictionary for this device. | 148 /** Returns the resource dictionary for this device. |
| 150 */ | 149 */ |
| 151 SK_API SkPDFResourceDict* getResourceDict(); | 150 SK_API SkPDFDict* getResourceDict(); |
| 151 |
| 152 /** Get the list of resources (PDF objects) used on this page. |
| 153 * This method will add to newResourceObjects any objects that this method |
| 154 * depends on, but not already in knownResourceObjects. This might operate |
| 155 * recursively so if this object depends on another object and that object |
| 156 * depends on two more, all three objects will be added. |
| 157 * |
| 158 * @param knownResourceObjects The set of resources to be ignored. |
| 159 * @param newResourceObjects The set to append dependant resources to. |
| 160 * @param recursive If recursive is true, get the resources of the |
| 161 * device's resources recursively. (Useful for adding |
| 162 * objects to the catalog.) |
| 163 */ |
| 164 SK_API void getResources(const SkTSet<SkPDFObject*>& knownResourceObjects, |
| 165 SkTSet<SkPDFObject*>* newResourceObjects, |
| 166 bool recursive) const; |
| 152 | 167 |
| 153 /** Get the fonts used on this device. | 168 /** Get the fonts used on this device. |
| 154 */ | 169 */ |
| 155 SK_API const SkTDArray<SkPDFFont*>& getFontResources() const; | 170 SK_API const SkTDArray<SkPDFFont*>& getFontResources() const; |
| 156 | 171 |
| 157 /** Add our named destinations to the supplied dictionary. | 172 /** Add our named destinations to the supplied dictionary. |
| 158 * @param dict Dictionary to add destinations to. | 173 * @param dict Dictionary to add destinations to. |
| 159 * @param page The PDF object representing the page for this device. | 174 * @param page The PDF object representing the page for this device. |
| 160 */ | 175 */ |
| 161 void appendDestinations(SkPDFDict* dict, SkPDFObject* page); | 176 void appendDestinations(SkPDFDict* dict, SkPDFObject* page); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 216 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
| 202 // order to get the right access levels without using friend. | 217 // order to get the right access levels without using friend. |
| 203 friend class ScopedContentEntry; | 218 friend class ScopedContentEntry; |
| 204 | 219 |
| 205 SkISize fPageSize; | 220 SkISize fPageSize; |
| 206 SkISize fContentSize; | 221 SkISize fContentSize; |
| 207 SkMatrix fInitialTransform; | 222 SkMatrix fInitialTransform; |
| 208 SkClipStack fExistingClipStack; | 223 SkClipStack fExistingClipStack; |
| 209 SkRegion fExistingClipRegion; | 224 SkRegion fExistingClipRegion; |
| 210 SkPDFArray* fAnnotations; | 225 SkPDFArray* fAnnotations; |
| 211 SkPDFResourceDict* fResourceDict; | 226 SkPDFDict* fResourceDict; |
| 212 SkTDArray<NamedDestination*> fNamedDestinations; | 227 SkTDArray<NamedDestination*> fNamedDestinations; |
| 213 | 228 |
| 214 SkTDArray<SkPDFGraphicState*> fGraphicStateResources; | 229 SkTDArray<SkPDFGraphicState*> fGraphicStateResources; |
| 215 SkTDArray<SkPDFObject*> fXObjectResources; | 230 SkTDArray<SkPDFObject*> fXObjectResources; |
| 216 SkTDArray<SkPDFFont*> fFontResources; | 231 SkTDArray<SkPDFFont*> fFontResources; |
| 217 SkTDArray<SkPDFObject*> fShaderResources; | 232 SkTDArray<SkPDFObject*> fShaderResources; |
| 218 | 233 |
| 219 SkTScopedPtr<ContentEntry> fContentEntries; | 234 SkTScopedPtr<ContentEntry> fContentEntries; |
| 220 ContentEntry* fLastContentEntry; | 235 ContentEntry* fLastContentEntry; |
| 221 SkTScopedPtr<ContentEntry> fMarginContentEntries; | 236 SkTScopedPtr<ContentEntry> fMarginContentEntries; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 const SkMatrix& matrix); | 318 const SkMatrix& matrix); |
| 304 void handleLinkToNamedDest(SkData* nameData, const SkRect& r, | 319 void handleLinkToNamedDest(SkData* nameData, const SkRect& r, |
| 305 const SkMatrix& matrix); | 320 const SkMatrix& matrix); |
| 306 void defineNamedDestination(SkData* nameData, const SkPoint& point, | 321 void defineNamedDestination(SkData* nameData, const SkPoint& point, |
| 307 const SkMatrix& matrix); | 322 const SkMatrix& matrix); |
| 308 | 323 |
| 309 typedef SkDevice INHERITED; | 324 typedef SkDevice INHERITED; |
| 310 }; | 325 }; |
| 311 | 326 |
| 312 #endif | 327 #endif |
| OLD | NEW |