mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
canvas: Make GetImageData simple and only IPC message to obtain pixels (#38274)
Currently we had `GetImageData` and `SendPixels` to obtain pixels from script thread. This PR unifies those into single `GetImageData` that does not need canvas size and has optional rect (for obtaining sub image). Testing: Existing WPT tests Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
77f85f390e
commit
8b2a5fca54
5 changed files with 26 additions and 63 deletions
|
@ -449,7 +449,6 @@ pub struct TextOptions {
|
|||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum CanvasMsg {
|
||||
Canvas2d(Canvas2dMsg, CanvasId),
|
||||
FromScript(FromScriptMsg, CanvasId),
|
||||
Recreate(Option<Size2D<u64>>, CanvasId),
|
||||
Close(CanvasId),
|
||||
}
|
||||
|
@ -475,7 +474,6 @@ pub enum Canvas2dMsg {
|
|||
),
|
||||
DrawImageInOther(
|
||||
CanvasId,
|
||||
Size2D<u32>,
|
||||
Rect<f64>,
|
||||
Rect<f64>,
|
||||
bool,
|
||||
|
@ -512,7 +510,7 @@ pub enum Canvas2dMsg {
|
|||
CompositionOptions,
|
||||
Transform2D<f32>,
|
||||
),
|
||||
GetImageData(Rect<u32>, Size2D<u32>, IpcSender<IpcSnapshot>),
|
||||
GetImageData(Option<Rect<u32>>, IpcSender<IpcSnapshot>),
|
||||
MeasureText(String, IpcSender<TextMetrics>, TextOptions),
|
||||
PutImageData(Rect<u32>, IpcSnapshot),
|
||||
StrokeRect(
|
||||
|
@ -534,11 +532,6 @@ pub enum Canvas2dMsg {
|
|||
UpdateImage(IpcSender<()>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
pub enum FromScriptMsg {
|
||||
SendPixels(IpcSender<IpcSnapshot>),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize, MallocSizeOf, Serialize)]
|
||||
pub struct CanvasGradientStop {
|
||||
pub offset: f64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue