Remove HTMLCanvasDataSource and CanvasSource (#36794)

All canvases return `Option<ImageKey>`.

Testing: Just refactor without behavior changes

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
sagudev 2025-05-01 19:49:59 +02:00 committed by GitHub
parent 1a3f10bba4
commit 3648525fe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 28 additions and 71 deletions

View file

@ -21,7 +21,7 @@ use image::{ColorType, ImageEncoder};
use ipc_channel::ipc::{self as ipcchan};
use js::error::throw_type_error;
use js::rust::{HandleObject, HandleValue};
use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource};
use script_layout_interface::HTMLCanvasData;
use servo_media::streams::MediaStreamType;
use servo_media::streams::registry::MediaStreamId;
use snapshot::Snapshot;
@ -201,7 +201,7 @@ impl LayoutHTMLCanvasElementHelpers for LayoutDom<'_, HTMLCanvasElement> {
Some(RenderingContext::WebGL2(context)) => context.to_layout().canvas_data_source(),
#[cfg(feature = "webgpu")]
Some(RenderingContext::WebGPU(context)) => context.to_layout().canvas_data_source(),
Some(RenderingContext::Placeholder(_)) | None => HTMLCanvasDataSource::Empty,
Some(RenderingContext::Placeholder(_)) | None => None,
}
};