mirror of
https://github.com/servo/servo.git
synced 2025-07-15 19:33:46 +01:00
Add a basic caching mechanism for ImageKeys. (#37369)
This creates a new method in shared/compositing/lib to generate image keys that are send over the webview. This does not immediately return the keys but goes over the constellation to receive the keys from the IOCompositor. To make this more efficient, we now cache the keys in image_cache in a simple FIFO order. The old blocking method stays intact for now but got renamed to make the blocking clear. The blocking calls that are left are in: - `components/canvas/canvas_data.rs` - `components/script/dom/htmlmediaelement.rs` Testing: WPT tests should cover this as this doesn't change any functionality. Fixes: Was mentioned in https://github.com/servo/servo/issues/37161#issuecomment-2915750051 and part of https://github.com/servo/servo/issues/37086 --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com> Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com> Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
This commit is contained in:
parent
89bfa26f00
commit
ca47cc2fa3
31 changed files with 392 additions and 70 deletions
|
@ -907,7 +907,7 @@ impl WebGLThread {
|
|||
let descriptor = Self::image_descriptor(size, alpha);
|
||||
let data = Self::external_image_data(context_id, image_buffer_kind);
|
||||
|
||||
let image_key = compositor_api.generate_image_key().unwrap();
|
||||
let image_key = compositor_api.generate_image_key_blocking().unwrap();
|
||||
compositor_api.add_image(image_key, descriptor, data);
|
||||
|
||||
image_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue