The compositor IPC path needs filters to carry their serialized value
tree and any referenced image frames together. Keep that ownership in
LibGfx by encoding the filter byte stream and each referenced frame as a
shareable bitmap with its color space, then rebuilding the filter
through the existing deserializer on decode.
This is preparatory work required to add IPC between the main and
compositor threads.
Prep work for serializing display lists across the IPC boundary. Replace
Gfx::Filter's Skia-specific backing with a portable Variant-based
representation, add serialize_filter/deserialize_filter, and store
filter data inline in ApplyEffects/ApplyBackdropFilter command payloads
instead of in DisplayListResourceStorage. FilterResourceId is removed
along with the per-storage filter map.
Commands used to keep rendering resources directly in the variant:
image frames, external content and video sources, filters, SVG paint
styles, and nested display lists. That makes the command stream own its
dependencies and prevents it from becoming a POD-like byte buffer.
Add DisplayListResourceStorage and replace those command fields with
stable resource IDs. The storage deduplicates resources by their
existing IDs and can copy only the resources referenced by a captured
command sequence, giving the future IPC boundary a clear list of
resources that must be communicated to the rasterization process.
Decoded image data should not continue to traffic in ImmutableBitmap now
that the bitmap wrapper is being retired. Introduce DecodedImageFrame as
the paintable decoded-image unit and store a Bitmap plus ColorSpace in
it directly.
Thread the new frame type through decoded image data, display-list
image commands, filters, canvas drawImage, patterns, WebGL texture
upload, and CSS/SVG image consumers. ImmutableBitmap remains only at
the legacy boundaries that still need it, such as HTML video snapshots
and callers that explicitly ask for a bitmap snapshot.
This keeps color-space ownership with the decoded frame while making
the expensive or legacy ImmutableBitmap path explicit at the few call
sites that still need it.
With the SkImage cache extracted, ImmutableBitmap no longer needs to
hold a SkiaBackendContext, an SkImage, or an SkBitmap. Reduce it to just
the source pixels (a Bitmap or YUVData) and a color space, so the sam
ImmutableBitmap can be consumed by any Skia context without
coordination.
Per-context locking and ensure_sk_image() are no longer needed and go
away with this change; the cache rebuilds an SkImage from the source
data the first time each bitmap is drawn against a context.