Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: src/pdf/SkPDFDevice.h

Issue 2264113003: SkPDF: PDFDevice cleanup. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-22 (Monday) 14:56:46 EDT Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698