aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/canvas_context.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/canvas_context.rs')
-rw-r--r--components/script/canvas_context.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/canvas_context.rs b/components/script/canvas_context.rs
index 8bf188a5aa9..d49d31997e1 100644
--- a/components/script/canvas_context.rs
+++ b/components/script/canvas_context.rs
@@ -5,8 +5,8 @@
//! Common interfaces for Canvas Contexts
use euclid::default::Size2D;
-use ipc_channel::ipc::IpcSharedMemory;
use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource};
+use snapshot::Snapshot;
use crate::dom::bindings::codegen::UnionTypes::HTMLCanvasElementOrOffscreenCanvas;
use crate::dom::bindings::inheritance::Castable;
@@ -30,11 +30,10 @@ pub(crate) trait CanvasContext {
fn resize(&self);
- fn get_image_data_as_shared_memory(&self) -> Option<IpcSharedMemory>;
-
- fn get_image_data(&self) -> Option<Vec<u8>> {
- self.get_image_data_as_shared_memory().map(|sm| sm.to_vec())
- }
+ /// Returns none if area of canvas is zero.
+ ///
+ /// In case of other errors it returns cleared snapshot
+ fn get_image_data(&self) -> Option<Snapshot>;
fn origin_is_clean(&self) -> bool {
true