mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
canvas: Use stored transform instead of querying canvas paint thread (#38097)
We already store transform in context state, so let's just use this when querying instead of using IPC to ask canvas paint thread. Testing: Existing WPT tests work towards #38022 try run: https://github.com/sagudev/servo/actions/runs/16299182583 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
b821377771
commit
b799f27817
3 changed files with 1 additions and 15 deletions
|
@ -231,10 +231,6 @@ impl<'a> CanvasPaintThread<'a> {
|
|||
Canvas2dMsg::SetLineDashOffset(offset) => {
|
||||
self.canvas(canvas_id).set_line_dash_offset(offset)
|
||||
},
|
||||
Canvas2dMsg::GetTransform(sender) => {
|
||||
let transform = self.canvas(canvas_id).get_transform();
|
||||
sender.send(transform).unwrap();
|
||||
},
|
||||
Canvas2dMsg::SetTransform(ref matrix) => self.canvas(canvas_id).set_transform(matrix),
|
||||
Canvas2dMsg::SetGlobalAlpha(alpha) => self.canvas(canvas_id).set_global_alpha(alpha),
|
||||
Canvas2dMsg::SetGlobalComposition(op) => {
|
||||
|
@ -570,12 +566,6 @@ impl Canvas<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_transform(&self) -> Transform2D<f32> {
|
||||
match self {
|
||||
Canvas::Raqote(canvas_data) => canvas_data.get_transform(),
|
||||
}
|
||||
}
|
||||
|
||||
fn put_image_data(&mut self, snapshot: Snapshot, rect: Rect<u32>) {
|
||||
match self {
|
||||
Canvas::Raqote(canvas_data) => canvas_data.put_image_data(snapshot, rect),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue