Skia
2D Graphics Library
SkMultiPictureDocument.h
Go to the documentation of this file.
1 /*
2  * Copyright 2023 Google LLC
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/SkPicture.h"
12 #include "include/core/SkRefCnt.h"
13 #include "include/core/SkSize.h"
14 #include "include/core/SkTypes.h"
15 
16 #include <functional>
17 
18 class SkDocument;
19 class SkStreamSeekable;
20 class SkWStream;
21 struct SkDeserialProcs;
22 struct SkSerialProcs;
23 
27 };
28 
34 SK_API sk_sp<SkDocument> Make(SkWStream* dst, const SkSerialProcs* = nullptr,
35  std::function<void(const SkPicture*)> onEndPage = nullptr);
36 
41 
47 SK_API bool Read(SkStreamSeekable* src,
48  SkDocumentPage* dstArray,
49  int dstArrayCount,
50  const SkDeserialProcs* = nullptr);
51 } // namespace SkMultiPictureDocument
52 
53 #endif // SkMultiPictureDocument_DEFINED
High-level API for creating a document-based canvas.
Definition: SkDocument.h:32
SkPicture records drawing commands made to SkCanvas.
Definition: SkPicture.h:44
SkStreamSeekable is a SkStreamRewindable for which position, seek, move, and fork are required.
Definition: SkStream.h:166
Definition: SkStream.h:218
Definition: SkMultiPictureDocument.h:29
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Writes into a file format that is similar to SkPicture::serialize() Accepts a callback for endPage be...
SK_API bool Read(SkStreamSeekable *src, SkDocumentPage *dstArray, int dstArrayCount, const SkDeserialProcs *=nullptr)
Read the SkMultiPictureDocument into the provided array of pages.
SK_API int ReadPageCount(SkStreamSeekable *src)
Returns the number of pages in the SkMultiPictureDocument.
Definition: SkSerialProcs.h:97
Definition: SkMultiPictureDocument.h:24
sk_sp< SkPicture > fPicture
Definition: SkMultiPictureDocument.h:25
SkSize fSize
Definition: SkMultiPictureDocument.h:26
Definition: SkSerialProcs.h:86
Definition: SkSize.h:51