script: Report associated memory for webgl objects (#42570)

As started in https://github.com/servo/servo/issues/42168 let's report
memory pressure for webgl objects. CanvasContexts report memory twice:
once because of underlying texture object and once by themself, but
that's okay as we also need to account for swapchain textures.

Computing exact size would be to much work and code so we report rough
estimations.

Testing: None

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Sam
2026-02-25 11:29:10 +01:00
committed by GitHub
parent 6c334f2811
commit 0b94f0a7ce
15 changed files with 50 additions and 17 deletions

View File

@@ -14,7 +14,7 @@ use crate::dom::webgl::webglobject::WebGLObject;
use crate::dom::webgl::webglrenderingcontext::{Operation, WebGLRenderingContext};
use crate::script_runtime::CanGc;
#[dom_struct]
#[dom_struct(associated_memory)]
pub(crate) struct WebGLVertexArrayObject {
webgl_object_: WebGLObject,
array_object: VertexArrayObject,