Commit graph

14 commits

Author SHA1 Message Date
sagudev
73b778e67f
Introduce snapshot concept of canvas (#36119)
Each canvas context returns snapshot instead of just raw bytes. This
allows as to hold off conversions (BGRA <-> RGBA, (un)premultiply) to
when/if they are actually needed. For example when loading snapshot into
webgl we can load both RGBA and BGRA so no conversion is really needed.

Currently whole thing is designed to be able to be extend on
https://github.com/servo/ipc-channel/pull/356, to make less copies.
Hence some commented out code.


Fixes #35759
There are tests for these changes in WPT

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-04-23 07:32:47 +00:00
Samson
610a1c2303
Use surfman with glow bindings (take II) (#35422)
* Reapply "Use surfman with glow bindings (#34328)" (#35402)

This reverts commit 0fed99590a.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update surfman

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-13 07:26:38 +00:00
Samson
0fed99590a
Revert "Use surfman with glow bindings (#34328)" (#35402)
This reverts commit 503bb10c5b.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-10 17:20:27 +00:00
Samson
503bb10c5b
Use surfman with glow bindings (#34328)
* Use glowing surfman

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Port https://github.com/servo/webxr/pull/255

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups rebase

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fmt

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update surfman

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix stale TODO

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2025-02-05 06:13:21 +00:00
Martin Robinson
0e616e0c5d
api: Flatten and simplify Servo preferences (#34966)
Flatten and simplify Servo's preferences code. In addition, have both
preferences and options passed in as arguments to `Servo::new()` and
make sure not to use the globally set preferences in `servoshell` (as
much as possible now).

Instead of a complex procedural macro to generate preferences, just
expose a very simple derive macro that adds string based getters and
setters.

- All command-line parsing is moved to servoshell.
- There is no longer the concept of a missing preference.
- Preferences no longer have to be part of the resources bundle because
  they now have reasonable default values.
- servoshell specific preferences are no longer part of the preferences
  exposed by the Servo API.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-01-14 13:54:06 +00:00
Josh Matthews
c43762faea
Add initial support for WebGL 2 BlitFramebuffer (#26389)
Add initial support for the WebGL2 BlitFramebuffer call.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Istvan <istvan.miklos@h-lab.eu>
2025-01-06 18:37:35 +00:00
Samson
063071ba72
Replace sparkle with glow in components/canvas (#33918)
* Replace sparkle with glow in components/canvas

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Replace safe_gl with #34300

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-20 09:05:24 +00:00
Samson
65c84d230b
Replace sparkle with glow in shared/canvas (#34292)
Also updates glow to 0.16

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-11-19 18:34:37 +00:00
Taym Haddadi
3800922cde
Fix panic in Webrender during shutdown (#32897)
* Fix panic in webrender during shutdown

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Pass webgl_threads_sender to WebGLThreads::exit

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* follow the naming convention and use sender instead of webgl_threads_sender

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Avoid deadlock when webgl_threads is None

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use tuple matching for webgl_threads and webgl_threads_receiver

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unused _webgl_threads_sender

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-08-06 10:01:33 +00:00
Ngo Iok Ui (Wu Yu Wei)
b1031d68c7
Move webgl_channel into base crate (#32339)
* Move webgl_channel into a shared crate

* Add license header

* Rename channle types and simplify module

* Move module to base
2024-05-24 06:13:20 +00:00
Martin Robinson
38db1a5ce9
rustdoc: Add some basic Safety sections to unsafe functions (#31639) 2024-03-13 10:44:59 +00:00
eri
43f44965cd
clippy: fix warnings in components/shared (#31565)
* clippy: fix some warnings in components/shared

* fix: unit tests

* fix: review comments
2024-03-08 15:28:19 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +00:00
Martin Robinson
f4d3af296c Move *_traits and other shared types to shared
This is the start of the organization of types that are in their own
crates in order to break dependency cycles between other crates. The
idea here is that putting these packages into their own directory is the
first step toward cleaning them up. They have grown organically and it
is difficult to explain to new folks where to put new shared types. Many
of these crates contain more than traits or don't contain traits at all.

Notably, `script_traits` isn't touched because it is vendored from
Gecko. Eventually this will move to `third_party`.
2023-11-03 15:38:18 +00:00
Renamed from components/canvas_traits/webgl.rs (Browse further)