mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Update euclid.
There are a few canvas2d-related dependencies that haven't updated, but they only use euclid internally so that's not blocking landing the rest of the changes. Given the size of this patch, I think it's useful to get this landed as-is.
This commit is contained in:
parent
2ff7cb5a37
commit
3d57c22e9c
133 changed files with 686 additions and 596 deletions
|
@ -25,9 +25,7 @@ use canvas_traits::canvas::CanvasImageData;
|
|||
use canvas_traits::canvas::CanvasMsg;
|
||||
use canvas_traits::canvas::FromLayoutMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::Size2D;
|
||||
use euclid::TypedScale;
|
||||
use euclid::TypedSize2D;
|
||||
use euclid::{Scale, Size2D};
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use servo_url::ServoUrl;
|
||||
use std::cell::Cell;
|
||||
|
@ -37,7 +35,7 @@ use style_traits::DevicePixel;
|
|||
#[dom_struct]
|
||||
pub struct PaintRenderingContext2D {
|
||||
context: CanvasRenderingContext2D,
|
||||
device_pixel_ratio: Cell<TypedScale<f32, CSSPixel, DevicePixel>>,
|
||||
device_pixel_ratio: Cell<Scale<f32, CSSPixel, DevicePixel>>,
|
||||
}
|
||||
|
||||
impl PaintRenderingContext2D {
|
||||
|
@ -45,7 +43,7 @@ impl PaintRenderingContext2D {
|
|||
let size = Size2D::zero();
|
||||
PaintRenderingContext2D {
|
||||
context: CanvasRenderingContext2D::new_inherited(global.upcast(), None, size),
|
||||
device_pixel_ratio: Cell::new(TypedScale::new(1.0)),
|
||||
device_pixel_ratio: Cell::new(Scale::new(1.0)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,8 +69,8 @@ impl PaintRenderingContext2D {
|
|||
|
||||
pub fn set_bitmap_dimensions(
|
||||
&self,
|
||||
size: TypedSize2D<f32, CSSPixel>,
|
||||
device_pixel_ratio: TypedScale<f32, CSSPixel, DevicePixel>,
|
||||
size: Size2D<f32, CSSPixel>,
|
||||
device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
|
||||
) {
|
||||
let size = size * device_pixel_ratio;
|
||||
self.device_pixel_ratio.set(device_pixel_ratio);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue