OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef SkMultiPictureDocument_DEFINED | 7 #ifndef SkMultiPictureDocument_DEFINED |
8 #define SkMultiPictureDocument_DEFINED | 8 #define SkMultiPictureDocument_DEFINED |
9 | 9 |
| 10 /* |
| 11 This format is not intended to be used in production. |
| 12 |
| 13 For clients looking for a way to represent a document in memory, |
| 14 |
| 15 struct Doc { |
| 16 std::vector<sk_sp<SkPicture>> fPages; |
| 17 std::vector<SkSize> fPageSizes; |
| 18 }; |
| 19 |
| 20 or |
| 21 |
| 22 struct Page { |
| 23 sk_sp<SkPicture> fPage; |
| 24 SkSize fPageSize; |
| 25 }; |
| 26 std::vector<Page> pages; |
| 27 |
| 28 would work much better. |
| 29 |
| 30 Multi-SkPicture (MSKP) files are still useful for debugging and |
| 31 testing. |
| 32 |
| 33 The downsides of this format are currently: |
| 34 - no way to extract a single page; must read the entire file at once. |
| 35 - must use `dm` to convert to another format before passing into |
| 36 standard skp tools. |
| 37 - `dm` can extract the first page to skp, but no others. |
| 38 |
| 39 TODO(halcanary): replace with somthing that addresses these issues. |
| 40 */ |
| 41 |
10 #include "SkDocument.h" | 42 #include "SkDocument.h" |
11 | 43 |
12 /** Writes into an experimental, undocumented file format that is | 44 /** Writes into an experimental, undocumented file format that is |
13 useful for debugging documents printed via Skia. */ | 45 useful for debugging documents printed via Skia. */ |
14 SK_API sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst); | 46 SK_API sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst); |
15 | 47 |
16 #endif // SkMultiPictureDocument_DEFINED | 48 #endif // SkMultiPictureDocument_DEFINED |
OLD | NEW |