mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
This splits `Snapshot` into two structs: - `Snapshot`: A non-serializable owned image buffer that might contain either shared memory or a `Vec<u8>`. When mutated the shared memory version is converted into a `Vec<u8>` avoiding a copy of the data until absolutely necessary. - `SharedSnapshot`: A serialzable version of `Snapshot` that contains only shared memory and is suitable for sending across IPC channels. This version is cheaply convertible from and to owned `Snapshot`s as long as the source is also a shared memory `Snapshot`. In addition, it does copyless conversions of `RasterImage` into `Snapshot`s (including for frame offsets in animated images). Finally, there are a few minor changes to try harder not to have to do a `transform()` operation. Testing: This should not change observable behavior, so is covered by existing tests. It should come with a mild performance improvement and open up the opportunity for others. Fixes: #36594. Signed-off-by: Martin Robinson <mrobinson@igalia.com>