Skia
2D Graphics Library
SkSerialProcs.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 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 SkSerialProcs_DEFINED
9 #define SkSerialProcs_DEFINED
10 
11 #include "include/core/SkImage.h"
12 #include "include/core/SkPicture.h"
14 
26 typedef sk_sp<SkData> (*SkSerialImageProc)(SkImage*, void* ctx);
28 
33 typedef sk_sp<SkPicture> (*SkDeserialPictureProc)(const void* data, size_t length, void* ctx);
34 
42 typedef sk_sp<SkImage> (*SkDeserialImageProc)(const void* data, size_t length, void* ctx);
43 
48 typedef sk_sp<SkTypeface> (*SkDeserialTypefaceProc)(const void* data, size_t length, void* ctx);
49 
51  SkSerialPictureProc fPictureProc = nullptr;
52  void* fPictureCtx = nullptr;
53 
54  SkSerialImageProc fImageProc = nullptr;
55  void* fImageCtx = nullptr;
56 
57  SkSerialTypefaceProc fTypefaceProc = nullptr;
58  void* fTypefaceCtx = nullptr;
59 };
60 
62  SkDeserialPictureProc fPictureProc = nullptr;
63  void* fPictureCtx = nullptr;
64 
65  SkDeserialImageProc fImageProc = nullptr;
66  void* fImageCtx = nullptr;
67 
68  SkDeserialTypefaceProc fTypefaceProc = nullptr;
69  void* fTypefaceCtx = nullptr;
70 };
71 
72 #endif
73 
SkImage
Definition: SkImage.h:61
SkSerialImageProc
sk_sp< SkData >(* SkSerialImageProc)(SkImage *, void *ctx)
Definition: SkSerialProcs.h:26
SkDeserialImageProc
sk_sp< SkImage >(* SkDeserialImageProc)(const void *data, size_t length, void *ctx)
Called with the encoded from of an image.
Definition: SkSerialProcs.h:42
SkDeserialPictureProc
sk_sp< SkPicture >(* SkDeserialPictureProc)(const void *data, size_t length, void *ctx)
Called with the encoded form of a picture (previously written with a custom SkSerialPictureProc proc)...
Definition: SkSerialProcs.h:33
SkTypeface.h
SkTypeface
Definition: SkTypeface.h:45
sk_sp< SkData >
SK_API
#define SK_API
Definition: SkTypes.h:181
SkSerialPictureProc
sk_sp< SkData >(* SkSerialPictureProc)(SkPicture *, void *ctx)
A serial-proc is asked to serialize the specified object (e.g.
Definition: SkSerialProcs.h:25
SkPicture
Definition: SkPicture.h:39
SkImage.h
SkDeserialTypefaceProc
sk_sp< SkTypeface >(* SkDeserialTypefaceProc)(const void *data, size_t length, void *ctx)
Called with the encoded form of a typeface (previously written with a custom SkSerialTypefaceProc pro...
Definition: SkSerialProcs.h:48
SkPicture.h
SkSerialProcs
Definition: SkSerialProcs.h:50
SkSerialTypefaceProc
sk_sp< SkData >(* SkSerialTypefaceProc)(SkTypeface *, void *ctx)
Definition: SkSerialProcs.h:27
SkDeserialProcs
Definition: SkSerialProcs.h:61