| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkPDFDevice_DEFINED | 8 #ifndef SkPDFDevice_DEFINED |
| 9 #define SkPDFDevice_DEFINED | 9 #define SkPDFDevice_DEFINED |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 */ | 136 */ |
| 137 void appendDestinations(SkPDFDict* dict, SkPDFObject* page) const; | 137 void appendDestinations(SkPDFDict* dict, SkPDFObject* page) const; |
| 138 | 138 |
| 139 /** Returns a copy of the media box for this device. */ | 139 /** Returns a copy of the media box for this device. */ |
| 140 sk_sp<SkPDFArray> copyMediaBox() const; | 140 sk_sp<SkPDFArray> copyMediaBox() const; |
| 141 | 141 |
| 142 /** Returns a SkStream with the page contents. | 142 /** Returns a SkStream with the page contents. |
| 143 */ | 143 */ |
| 144 std::unique_ptr<SkStreamAsset> content() const; | 144 std::unique_ptr<SkStreamAsset> content() const; |
| 145 | 145 |
| 146 /** Writes the page contents to the stream. */ | |
| 147 void writeContent(SkWStream*) const; | |
| 148 | |
| 149 const SkMatrix& initialTransform() const { | |
| 150 return fInitialTransform; | |
| 151 } | |
| 152 | |
| 153 SkPDFCanon* getCanon() const; | 146 SkPDFCanon* getCanon() const; |
| 154 | 147 |
| 155 // It is important to not confuse GraphicStateEntry with SkPDFGraphicState,
the | 148 // It is important to not confuse GraphicStateEntry with SkPDFGraphicState,
the |
| 156 // later being our representation of an object in the PDF file. | 149 // later being our representation of an object in the PDF file. |
| 157 struct GraphicStateEntry { | 150 struct GraphicStateEntry { |
| 158 GraphicStateEntry(); | 151 GraphicStateEntry(); |
| 159 | 152 |
| 160 // Compare the fields we care about when setting up a new content entry. | 153 // Compare the fields we care about when setting up a new content entry. |
| 161 bool compareInitialState(const GraphicStateEntry& b); | 154 bool compareInitialState(const GraphicStateEntry& b); |
| 162 | 155 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 : nameData(SkRef(nameData)), point(point) {} | 204 : nameData(SkRef(nameData)), point(point) {} |
| 212 NamedDestination(NamedDestination&&) = default; | 205 NamedDestination(NamedDestination&&) = default; |
| 213 NamedDestination& operator=(NamedDestination&&) = default; | 206 NamedDestination& operator=(NamedDestination&&) = default; |
| 214 }; | 207 }; |
| 215 | 208 |
| 216 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 209 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
| 217 // order to get the right access levels without using friend. | 210 // order to get the right access levels without using friend. |
| 218 friend class ScopedContentEntry; | 211 friend class ScopedContentEntry; |
| 219 | 212 |
| 220 SkISize fPageSize; | 213 SkISize fPageSize; |
| 221 SkISize fContentSize; | |
| 222 SkMatrix fInitialTransform; | 214 SkMatrix fInitialTransform; |
| 223 SkClipStack fExistingClipStack; | 215 SkClipStack fExistingClipStack; |
| 224 SkRegion fExistingClipRegion; | 216 SkRegion fExistingClipRegion; |
| 225 | 217 |
| 226 SkTArray<RectWithData> fLinkToURLs; | 218 SkTArray<RectWithData> fLinkToURLs; |
| 227 SkTArray<RectWithData> fLinkToDestinations; | 219 SkTArray<RectWithData> fLinkToDestinations; |
| 228 SkTArray<NamedDestination> fNamedDestinations; | 220 SkTArray<NamedDestination> fNamedDestinations; |
| 229 | 221 |
| 230 SkTDArray<SkPDFObject*> fGraphicStateResources; | 222 SkTDArray<SkPDFObject*> fGraphicStateResources; |
| 231 SkTDArray<SkPDFObject*> fXObjectResources; | 223 SkTDArray<SkPDFObject*> fXObjectResources; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 302 |
| 311 typedef SkBaseDevice INHERITED; | 303 typedef SkBaseDevice INHERITED; |
| 312 | 304 |
| 313 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 305 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
| 314 // an SkPDFDevice | 306 // an SkPDFDevice |
| 315 //friend class SkDocument_PDF; | 307 //friend class SkDocument_PDF; |
| 316 //friend class SkPDFImageShader; | 308 //friend class SkPDFImageShader; |
| 317 }; | 309 }; |
| 318 | 310 |
| 319 #endif | 311 #endif |
| OLD | NEW |