halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #ifndef SkMultiPictureDocument_DEFINED |
| 8 | #define SkMultiPictureDocument_DEFINED |
| 9 | |
halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 10 | #include "SkDocument.h" |
| 11 | |
Hal Canary | 45cde31 | 2017-04-03 16:06:42 -0400 | [diff] [blame] | 12 | class SkStreamSeekable; |
| 13 | |
| 14 | /** |
| 15 | * Writes into a file format that is similar to SkPicture::serialize() |
| 16 | */ |
halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 17 | SK_API sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst); |
| 18 | |
Hal Canary | 45cde31 | 2017-04-03 16:06:42 -0400 | [diff] [blame] | 19 | struct SkDocumentPage { |
| 20 | sk_sp<SkPicture> fPicture; |
| 21 | SkSize fSize; |
| 22 | }; |
| 23 | |
| 24 | /** |
| 25 | * Returns the number of pages in the SkMultiPictureDocument. |
| 26 | */ |
| 27 | SK_API int SkMultiPictureDocumentReadPageCount(SkStreamSeekable* src); |
| 28 | |
| 29 | /** |
| 30 | * Read the SkMultiPictureDocument into the provided array of pages. |
| 31 | * dstArrayCount must equal SkMultiPictureDocumentReadPageCount(). |
| 32 | * Return false on error. |
| 33 | */ |
| 34 | SK_API bool SkMultiPictureDocumentRead(SkStreamSeekable* src, |
| 35 | SkDocumentPage* dstArray, |
| 36 | int dstArrayCount); |
| 37 | |
halcanary | 45420a9 | 2016-06-02 12:41:14 -0700 | [diff] [blame] | 38 | #endif // SkMultiPictureDocument_DEFINED |