![]() |
Flutter Engine
The Flutter Engine
|
#include <SkSharingProc.h>
Static Public Member Functions | |
static void | collectNonTextureImagesFromPicture (const SkPicture *pic, SkSharingSerialContext *sharingCtx) |
static sk_sp< SkData > | serializeImage (SkImage *img, void *ctx) |
Public Attributes | |
skia_private::THashMap< uint32_t, sk_sp< SkImage > > | fNonTexMap |
skia_private::THashMap< uint32_t, int > | fImageMap |
This serial proc serializes each image it encounters only once, using their uniqueId as the property for sameness.
It's most basic usage involves setting your imageProc to SkSharingSerialContext::serializeImage and creating an SkSharingSerialContext in an appropriate scope to outlive all the images that will be encountered before serialization.
Optionally, collectNonTextureImagesFromPicture can be called with an SkSharingContext and an SkPicture that may reference not-yet-released texture backed images. It will make non-texture copies if necessary and store them in the context. If present, they will be used in the final serialization.
This is intended to be used on Android with MultiPictureDocument's onEndPage parameter, in a lambda that captures the context, because MPD cannot make assumptions about the type of proc it receives and clients (Chrome) build MPD without this source file.
Definition at line 37 of file SkSharingProc.h.
|
static |
Definition at line 34 of file SkSharingProc.cpp.
Definition at line 43 of file SkSharingProc.cpp.
skia_private::THashMap<uint32_t, int> SkSharingSerialContext::fImageMap |
Definition at line 54 of file SkSharingProc.h.
skia_private::THashMap<uint32_t, sk_sp<SkImage> > SkSharingSerialContext::fNonTexMap |
Definition at line 42 of file SkSharingProc.h.