mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
1a3f10bba4
commit
3648525fe8
10 changed files with 28 additions and 71 deletions
|
@ -7,9 +7,9 @@ use dom_struct::dom_struct;
|
|||
use euclid::default::Size2D;
|
||||
use profile_traits::ipc;
|
||||
use script_bindings::inheritance::Castable;
|
||||
use script_layout_interface::HTMLCanvasDataSource;
|
||||
use servo_url::ServoUrl;
|
||||
use snapshot::Snapshot;
|
||||
use webrender_api::ImageKey;
|
||||
|
||||
use crate::canvas_context::{CanvasContext, CanvasHelpers, LayoutCanvasRenderingContextHelpers};
|
||||
use crate::canvas_state::CanvasState;
|
||||
|
@ -98,13 +98,13 @@ impl CanvasRenderingContext2D {
|
|||
}
|
||||
|
||||
impl LayoutCanvasRenderingContextHelpers for LayoutDom<'_, CanvasRenderingContext2D> {
|
||||
fn canvas_data_source(self) -> HTMLCanvasDataSource {
|
||||
fn canvas_data_source(self) -> Option<ImageKey> {
|
||||
let canvas_state = &self.unsafe_get().canvas_state;
|
||||
|
||||
if canvas_state.is_paintable() {
|
||||
HTMLCanvasDataSource::Image(canvas_state.image_key())
|
||||
Some(canvas_state.image_key())
|
||||
} else {
|
||||
HTMLCanvasDataSource::Empty
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue