mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -1965,10 +1965,7 @@ impl CanvasState {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-gettransform
|
||||
pub(crate) fn get_transform(&self, global: &GlobalScope, can_gc: CanGc) -> DomRoot<DOMMatrix> {
|
||||
let (sender, receiver) = ipc::channel::<Transform2D<f32>>().unwrap();
|
||||
self.send_canvas_2d_msg(Canvas2dMsg::GetTransform(sender));
|
||||
let transform = receiver.recv().unwrap();
|
||||
|
||||
let transform = self.state.borrow_mut().transform;
|
||||
DOMMatrix::new(global, true, transform.cast::<f64>().to_3d(), can_gc)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue