Commit graph

5 commits

Author SHA1 Message Date
sagudev
4dded465a4
compositor: only UpdateImages that accepts SmallVec and add helpers for single image (#37730)
Before we only offered helper to add single image (no update or delete)
that got special IPC message, now we simplify this by offering all ops
helpers for dealing with single image (that happens most of the time),
that simply uses `update_images` under the hood. We also optimize for
this use case by using `SmallVec<[ImageUpdate; 1]>` to avoid alloc.

Testing: Just refactor, but code is covered by WPT tests

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 14:57:15 +00:00
sagudev
03dbf9b6f7
webgl: Replace webrender API with compositor API for images handling (#37714)
Like in #37713, instead of updating images directly with webrender api
we use the compositor api. We still keep webrender api available in
webgl, because that's where we do shutdown, due to GL.

Testing: Existing WPT tests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-06-26 09:06:24 +00:00
Martin Robinson
309485d2db
pixels: Move Snapshot and related data structures to pixels (#37590)
1. The `shared` directory is for the "_traits" crates, which will likely
   be moved out of this directly at some point and renamed "_api". These
   crates expose the API of crates to avoid circular dependencies.
   `Snapshot` isn't really this.
2. `Snapshot` is essentially a specialied kind of `Image` so it makes
   sense that it is grouped with other image-related things in `pixels`.

Testing: This should not change any behavior so is covered by existing
tests.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-06-20 14:47:06 +00:00
Martin Robinson
d39b9f05ff
webgl: Use glow::Context::supported_extensions() to implement getSupportedExtensions() (#36911)
Not only does this simplify the code, it fixes a problem where we were
attempting to use an OpenGL 3.0 API on an incompatible GL context.

Testing: There are already tests for `getSupportedExtensions()` in the
WebGL
suite, but effectively testing this requires drivers that do not support
a particular version of OpenGL, so it is a bit hard to actually test.
Fixes: #36852.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-05-08 08:34:52 +00:00
sagudev
955149b194
Split webgl into separate crate (#36718)
canvas crate was home for both webgl and 2dcanvas impl, but it makes
more sense to separate these two, by splitting webgl into standalone
crate (like we already have for webgpu).

Testing: Rust for fearless refactoring (but there are WPT tests just in
case)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-04-30 05:27:44 +00:00