| 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 14 matching lines...) Expand all Loading... |
| 25 * | 25 * |
| 26 * 1. Create a document, specifying a stream to store the output. | 26 * 1. Create a document, specifying a stream to store the output. |
| 27 * 2. For each "page" of content: | 27 * 2. For each "page" of content: |
| 28 * a. canvas = doc->beginPage(...) | 28 * a. canvas = doc->beginPage(...) |
| 29 * b. draw_my_content(canvas); | 29 * b. draw_my_content(canvas); |
| 30 * c. doc->endPage(); | 30 * c. doc->endPage(); |
| 31 * 3. Close the document with doc->close(). | 31 * 3. Close the document with doc->close(). |
| 32 */ | 32 */ |
| 33 class SK_API SkDocument : public SkRefCnt { | 33 class SK_API SkDocument : public SkRefCnt { |
| 34 public: | 34 public: |
| 35 SK_DECLARE_INST_COUNT(SkDocument) | |
| 36 | |
| 37 /** | 35 /** |
| 38 * Create a PDF-backed document, writing the results into a SkWStream. | 36 * Create a PDF-backed document, writing the results into a SkWStream. |
| 39 * | 37 * |
| 40 * PDF pages are sized in point units. 1 pt == 1/72 inch == 127/360 mm. | 38 * PDF pages are sized in point units. 1 pt == 1/72 inch == 127/360 mm. |
| 41 * | 39 * |
| 42 * @param SkWStream* A PDF document will be written to this | 40 * @param SkWStream* A PDF document will be written to this |
| 43 * stream. The document may write to the stream at | 41 * stream. The document may write to the stream at |
| 44 * anytime during its lifetime, until either close() is | 42 * anytime during its lifetime, until either close() is |
| 45 * called or the document is deleted. | 43 * called or the document is deleted. |
| 46 * @param dpi The DPI (pixels-per-inch) at which features without | 44 * @param dpi The DPI (pixels-per-inch) at which features without |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 129 |
| 132 private: | 130 private: |
| 133 SkWStream* fStream; | 131 SkWStream* fStream; |
| 134 void (*fDoneProc)(SkWStream*, bool aborted); | 132 void (*fDoneProc)(SkWStream*, bool aborted); |
| 135 State fState; | 133 State fState; |
| 136 | 134 |
| 137 typedef SkRefCnt INHERITED; | 135 typedef SkRefCnt INHERITED; |
| 138 }; | 136 }; |
| 139 | 137 |
| 140 #endif | 138 #endif |
| OLD | NEW |