OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkDocument_DEFINED | 8 #ifndef SkDocument_DEFINED |
9 #define SkDocument_DEFINED | 9 #define SkDocument_DEFINED |
10 | 10 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 } | 177 } |
178 | 178 |
179 /** | 179 /** |
180 * Create a PDF-backed document, writing the results into a file. | 180 * Create a PDF-backed document, writing the results into a file. |
181 */ | 181 */ |
182 static SkDocument* CreatePDF(const char outputFilePath[], | 182 static SkDocument* CreatePDF(const char outputFilePath[], |
183 SkScalar dpi = SK_ScalarDefaultRasterDPI) { | 183 SkScalar dpi = SK_ScalarDefaultRasterDPI) { |
184 return SkDocument::MakePDF(outputFilePath, dpi).release(); | 184 return SkDocument::MakePDF(outputFilePath, dpi).release(); |
185 } | 185 } |
186 | 186 |
187 /** | |
188 * Create a XPS-backed document, writing the results into the stream. | |
189 * Returns NULL if XPS is not supported. | |
190 */ | |
191 static SkDocument* CreateXPS(SkWStream* stream, | |
192 SkScalar dpi = SK_ScalarDefaultRasterDPI) { | |
193 return SkDocument::MakeXPS(stream, dpi).release(); | |
194 } | |
195 | |
196 /** | |
197 * Create a XPS-backed document, writing the results into a file. | |
198 * Returns NULL if XPS is not supported. | |
199 */ | |
200 static SkDocument* CreateXPS(const char path[], | |
201 SkScalar dpi = SK_ScalarDefaultRasterDPI) { | |
202 return SkDocument::MakeXPS(path, dpi).release(); | |
203 } | |
204 #endif // SK_SUPPORT_LEGACY_DOCUMENT_API | 187 #endif // SK_SUPPORT_LEGACY_DOCUMENT_API |
205 | 188 |
206 /** | 189 /** |
207 * Begin a new page for the document, returning the canvas that will draw | 190 * Begin a new page for the document, returning the canvas that will draw |
208 * into the page. The document owns this canvas, and it will go out of | 191 * into the page. The document owns this canvas, and it will go out of |
209 * scope when endPage() or close() is called, or the document is deleted. | 192 * scope when endPage() or close() is called, or the document is deleted. |
210 */ | 193 */ |
211 SkCanvas* beginPage(SkScalar width, SkScalar height, | 194 SkCanvas* beginPage(SkScalar width, SkScalar height, |
212 const SkRect* content = NULL); | 195 const SkRect* content = NULL); |
213 | 196 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 271 |
289 private: | 272 private: |
290 SkWStream* fStream; | 273 SkWStream* fStream; |
291 void (*fDoneProc)(SkWStream*, bool aborted); | 274 void (*fDoneProc)(SkWStream*, bool aborted); |
292 State fState; | 275 State fState; |
293 | 276 |
294 typedef SkRefCnt INHERITED; | 277 typedef SkRefCnt INHERITED; |
295 }; | 278 }; |
296 | 279 |
297 #endif | 280 #endif |
OLD | NEW |