aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/canvas
diff options
context:
space:
mode:
Diffstat (limited to 'components/shared/canvas')
-rw-r--r--components/shared/canvas/Cargo.toml1
-rw-r--r--components/shared/canvas/canvas.rs9
-rw-r--r--components/shared/canvas/webgl.rs7
3 files changed, 12 insertions, 5 deletions
diff --git a/components/shared/canvas/Cargo.toml b/components/shared/canvas/Cargo.toml
index d6e96711e1d..c77399ef847 100644
--- a/components/shared/canvas/Cargo.toml
+++ b/components/shared/canvas/Cargo.toml
@@ -26,6 +26,7 @@ pixels = { path = "../../pixels" }
serde = { workspace = true }
serde_bytes = { workspace = true }
servo_config = { path = "../../config" }
+snapshot = { workspace = true }
stylo = { workspace = true }
webrender_api = { workspace = true }
webxr-api = { workspace = true, features = ["ipc"] }
diff --git a/components/shared/canvas/canvas.rs b/components/shared/canvas/canvas.rs
index 90ba569b5eb..850f5f9bd9a 100644
--- a/components/shared/canvas/canvas.rs
+++ b/components/shared/canvas/canvas.rs
@@ -6,10 +6,11 @@ use std::default::Default;
use std::str::FromStr;
use euclid::default::{Point2D, Rect, Size2D, Transform2D};
-use ipc_channel::ipc::{IpcBytesReceiver, IpcBytesSender, IpcSender, IpcSharedMemory};
+use ipc_channel::ipc::{IpcBytesReceiver, IpcSender};
use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use serde_bytes::ByteBuf;
+use snapshot::IpcSnapshot;
use style::color::AbsoluteColor;
use style::properties::style_structs::Font as FontStyleStruct;
@@ -87,7 +88,7 @@ pub enum CanvasMsg {
pub enum Canvas2dMsg {
Arc(Point2D<f32>, f32, f32, f32, bool),
ArcTo(Point2D<f32>, Point2D<f32>, f32),
- DrawImage(IpcSharedMemory, Size2D<f64>, Rect<f64>, Rect<f64>, bool),
+ DrawImage(IpcSnapshot, Rect<f64>, Rect<f64>, bool),
DrawEmptyImage(Size2D<f64>, Rect<f64>, Rect<f64>),
DrawImageInOther(CanvasId, Size2D<f64>, Rect<f64>, Rect<f64>, bool),
BeginPath,
@@ -101,7 +102,7 @@ pub enum Canvas2dMsg {
FillPath(FillOrStrokeStyle, Vec<PathSegment>),
FillText(String, f64, f64, Option<f64>, FillOrStrokeStyle, bool),
FillRect(Rect<f32>, FillOrStrokeStyle),
- GetImageData(Rect<u64>, Size2D<u64>, IpcBytesSender),
+ GetImageData(Rect<u64>, Size2D<u64>, IpcSender<IpcSnapshot>),
GetTransform(IpcSender<Transform2D<f32>>),
IsPointInCurrentPath(f64, f64, FillRule, IpcSender<bool>),
IsPointInPath(Vec<PathSegment>, f64, f64, FillRule, IpcSender<bool>),
@@ -137,7 +138,7 @@ pub enum Canvas2dMsg {
#[derive(Clone, Debug, Deserialize, Serialize)]
pub enum FromScriptMsg {
- SendPixels(IpcSender<IpcSharedMemory>),
+ SendPixels(IpcSender<IpcSnapshot>),
}
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
diff --git a/components/shared/canvas/webgl.rs b/components/shared/canvas/webgl.rs
index eaa934fc145..7ffae5d5fc5 100644
--- a/components/shared/canvas/webgl.rs
+++ b/components/shared/canvas/webgl.rs
@@ -298,7 +298,12 @@ pub enum WebGLCommand {
PolygonOffset(f32, f32),
RenderbufferStorage(u32, u32, i32, i32),
RenderbufferStorageMultisample(u32, i32, u32, i32, i32),
- ReadPixels(Rect<u32>, u32, u32, IpcBytesSender),
+ ReadPixels(
+ Rect<u32>,
+ u32,
+ u32,
+ IpcSender<(IpcSharedMemory, snapshot::AlphaMode)>,
+ ),
ReadPixelsPP(Rect<i32>, u32, u32, usize),
SampleCoverage(f32, bool),
Scissor(i32, i32, u32, u32),