| 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 |
| 11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
| 12 #include "SkPicture.h" | 12 #include "SkPicture.h" |
| 13 #include "SkRect.h" | 13 #include "SkRect.h" |
| 14 #include "SkRefCnt.h" | 14 #include "SkRefCnt.h" |
| 15 | 15 |
| 16 class SkCanvas; | 16 class SkCanvas; |
| 17 class SkWStream; | 17 class SkWStream; |
| 18 | 18 |
| 19 /** SK_ScalarDefaultDPI is 72 DPI. | 19 /** SK_ScalarDefaultDPI is 72 DPI. |
| 20 */ | 20 */ |
| 21 #define SK_ScalarDefaultRasterDPI SkFloatToScalar(72.0f) | 21 #define SK_ScalarDefaultRasterDPI 72.0f |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * High-level API for creating a document-based canvas. To use.. | 24 * High-level API for creating a document-based canvas. To use.. |
| 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(). |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 private: | 132 private: |
| 133 SkWStream* fStream; | 133 SkWStream* fStream; |
| 134 void (*fDoneProc)(SkWStream*, bool aborted); | 134 void (*fDoneProc)(SkWStream*, bool aborted); |
| 135 State fState; | 135 State fState; |
| 136 | 136 |
| 137 typedef SkRefCnt INHERITED; | 137 typedef SkRefCnt INHERITED; |
| 138 }; | 138 }; |
| 139 | 139 |
| 140 #endif | 140 #endif |
| OLD | NEW |