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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static SkDocument* CreatePDF(SkWStream*, | 57 static SkDocument* CreatePDF(SkWStream*, |
58 SkScalar dpi = SK_ScalarDefaultRasterDPI); | 58 SkScalar dpi = SK_ScalarDefaultRasterDPI); |
59 | 59 |
60 /** | 60 /** |
61 * Create a PDF-backed document, writing the results into a file. | 61 * Create a PDF-backed document, writing the results into a file. |
62 */ | 62 */ |
63 static SkDocument* CreatePDF(const char outputFilePath[], | 63 static SkDocument* CreatePDF(const char outputFilePath[], |
64 SkScalar dpi = SK_ScalarDefaultRasterDPI); | 64 SkScalar dpi = SK_ScalarDefaultRasterDPI); |
65 | 65 |
66 /** | 66 /** |
67 * Create a XPS-backed document, writing the results into the stream. | |
68 * Returns NULL if XPS is not supported. | |
69 */ | |
70 static SkDocument* CreateXPS(SkWStream* stream, | |
71 SkScalar dpi = SK_ScalarDefaultRasterDPI); | |
72 | |
73 /** | |
74 * Create a XPS-backed document, writing the results into a file. | |
75 * Returns NULL if XPS is not supported. | |
76 */ | |
77 static SkDocument* CreateXPS(const char path[], | |
78 SkScalar dpi = SK_ScalarDefaultRasterDPI); | |
79 /** | |
80 * Begin a new page for the document, returning the canvas that will draw | 67 * Begin a new page for the document, returning the canvas that will draw |
81 * into the page. The document owns this canvas, and it will go out of | 68 * into the page. The document owns this canvas, and it will go out of |
82 * scope when endPage() or close() is called, or the document is deleted. | 69 * scope when endPage() or close() is called, or the document is deleted. |
83 */ | 70 */ |
84 SkCanvas* beginPage(SkScalar width, SkScalar height, | 71 SkCanvas* beginPage(SkScalar width, SkScalar height, |
85 const SkRect* content = NULL); | 72 const SkRect* content = NULL); |
86 | 73 |
87 /** | 74 /** |
88 * Call endPage() when the content for the current page has been drawn | 75 * Call endPage() when the content for the current page has been drawn |
89 * (into the canvas returned by beginPage()). After this call the canvas | 76 * (into the canvas returned by beginPage()). After this call the canvas |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 118 |
132 private: | 119 private: |
133 SkWStream* fStream; | 120 SkWStream* fStream; |
134 void (*fDoneProc)(SkWStream*, bool aborted); | 121 void (*fDoneProc)(SkWStream*, bool aborted); |
135 State fState; | 122 State fState; |
136 | 123 |
137 typedef SkRefCnt INHERITED; | 124 typedef SkRefCnt INHERITED; |
138 }; | 125 }; |
139 | 126 |
140 #endif | 127 #endif |
OLD | NEW |