servo/components/canvas
sagudev a631b42e60
pixels: Ensure expected formats when accesing bytes of snapshot (#37767)
I introduced snapshot in #36119 to pack raw bytes and metadata together,
now we take the next step and require for user to always specify what
kind of byte data they want when calling `as_bytes` or `to_vec`
(basically joining transform and data). There are also valid usages when
one might require just one property of bytes (textures can generally
handle both RGBA and BGRA). There are also valid usages of using just
raw bytes (when cropping). This PR tries to make such usages more
obvious.

This will make it easier to fix stuff around 2d canvas (we do not want
to assume any bytes properties in abstraction).

Testing: Code is covered by WPT tests.

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-07-03 15:02:41 +00:00
..
backend.rs canvas: Do not draw arc/ellipse with small sweep (#37630) 2025-07-01 12:01:15 +00:00
canvas_data.rs Add a basic caching mechanism for ImageKeys. (#37369) 2025-07-03 13:16:43 +00:00
canvas_paint_thread.rs pixels: Ensure expected formats when accesing bytes of snapshot (#37767) 2025-07-03 15:02:41 +00:00
Cargo.toml pixels: Move Snapshot and related data structures to pixels (#37590) 2025-06-20 14:47:06 +00:00
lib.rs Use backend trait with associated types for 2d canvas backends abstraction (#36783) 2025-05-01 04:16:23 +00:00
raqote_backend.rs canvas: Add CanvasPattern 'setTranform(transform)' method (#37731) 2025-06-26 14:38:30 +00:00