blob: 0ca8c2de729b636f9a44cf890865c27cb6cc5ce5 [file] [log] [blame]
halcanary45420a92016-06-02 12:41:14 -07001/*
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
halcanary45420a92016-06-02 12:41:14 -070010#include "SkDocument.h"
11
Hal Canary45cde312017-04-03 16:06:42 -040012class SkStreamSeekable;
13
14/**
15 * Writes into a file format that is similar to SkPicture::serialize()
16 */
halcanary45420a92016-06-02 12:41:14 -070017SK_API sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst);
18
Hal Canary45cde312017-04-03 16:06:42 -040019struct SkDocumentPage {
20 sk_sp<SkPicture> fPicture;
21 SkSize fSize;
22};
23
24/**
25 * Returns the number of pages in the SkMultiPictureDocument.
26 */
27SK_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 */
34SK_API bool SkMultiPictureDocumentRead(SkStreamSeekable* src,
35 SkDocumentPage* dstArray,
36 int dstArrayCount);
37
halcanary45420a92016-06-02 12:41:14 -070038#endif // SkMultiPictureDocument_DEFINED