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
10#include "SkDocument.h"
11
12class SkStreamSeekable;
13
14/**
15 *  Writes into a file format that is similar to SkPicture::serialize()
16 */
17SK_API sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst);
18
19struct 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
38#endif  // SkMultiPictureDocument_DEFINED
39