✨ Export Skia resource cache stats for the GPU harness

This commit is contained in:
Elena Torro 2026-09-29 16:07:08 +02:00
parent c77b8798ae
commit f726f5943d

View File

@ -816,6 +816,26 @@ pub fn free_gpu_resources() {
get_render_state().free_gpu_resources();
}
#[no_mangle]
pub extern "C" fn set_resource_cache_limit_mb(mb: u32) {
get_gpu_state()
.context
.set_resource_cache_limit(mb as usize * 1024 * 1024);
}
#[no_mangle]
pub extern "C" fn resource_cache_bytes() -> f64 {
get_gpu_state()
.context
.resource_cache_usage()
.resource_bytes as f64
}
#[no_mangle]
pub extern "C" fn resource_cache_purgeable_bytes() -> f64 {
get_gpu_state().context.resource_cache_purgeable_bytes() as f64
}
#[no_mangle]
#[wasm_error]
pub extern "C" fn render_shape_pdf(a: u32, b: u32, c: u32, d: u32, scale: f32) -> Result<*mut u8> {