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
8#ifndef SkMultiPictureDocument_DEFINED
9#define SkMultiPictureDocument_DEFINED
10
11#include "include/core/SkDocument.h"
12#include "include/core/SkPicture.h"
13#include "include/core/SkSize.h"
14
15struct SkDeserialProcs;
16struct SkSerialProcs;
17class SkStreamSeekable;
18
19/**
20 * Writes into a file format that is similar to SkPicture::serialize()
21 */
22SK_SPI sk_sp<SkDocument> SkMakeMultiPictureDocument(SkWStream* dst, const SkSerialProcs* = nullptr);
23
24struct SkDocumentPage {
25 sk_sp<SkPicture> fPicture;
26 SkSize fSize;
27};
28
29/**
30 * Returns the number of pages in the SkMultiPictureDocument.
31 */
32SK_SPI int SkMultiPictureDocumentReadPageCount(SkStreamSeekable* src);
33
34/**
35 * Read the SkMultiPictureDocument into the provided array of pages.
36 * dstArrayCount must equal SkMultiPictureDocumentReadPageCount().
37 * Return false on error.
38 */
39SK_SPI bool SkMultiPictureDocumentRead(SkStreamSeekable* src,
40 SkDocumentPage* dstArray,
41 int dstArrayCount,
42 const SkDeserialProcs* = nullptr);
43
44#endif // SkMultiPictureDocument_DEFINED
45