aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/lib.rs
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2017-06-23 11:07:02 -0500
committerAlan Jeffrey <ajeffrey@mozilla.com>2017-07-20 17:25:50 -0500
commitcaa35852197cd96e6c6ece42d346c45b36ff14f2 (patch)
tree722ba1e0e3d2dd196bbe290546d9cb8eb0463060 /components/script_traits/lib.rs
parente19fefcb474ea6593a684a1ca4ce616e61188ff0 (diff)
downloadservo-caa35852197cd96e6c6ece42d346c45b36ff14f2.tar.gz
servo-caa35852197cd96e6c6ece42d346c45b36ff14f2.zip
Fixed scaling artefacts in paint worklets caused by zoom and hidpi.
Diffstat (limited to 'components/script_traits/lib.rs')
-rw-r--r--components/script_traits/lib.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/components/script_traits/lib.rs b/components/script_traits/lib.rs
index 40b8532ab54..72af4d23108 100644
--- a/components/script_traits/lib.rs
+++ b/components/script_traits/lib.rs
@@ -9,7 +9,6 @@
#![deny(missing_docs)]
#![deny(unsafe_code)]
-extern crate app_units;
extern crate bluetooth_traits;
extern crate canvas_traits;
extern crate cookie as cookie_rs;
@@ -39,7 +38,6 @@ extern crate webvr_traits;
mod script_msg;
pub mod webdriver_msg;
-use app_units::Au;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::CanvasData;
use devtools_traits::{DevtoolScriptControlMsg, ScriptToDevtoolsControlMsg, WorkerId};
@@ -68,6 +66,7 @@ use std::fmt;
use std::sync::Arc;
use std::sync::mpsc::{Receiver, Sender, RecvTimeoutError};
use style_traits::CSSPixel;
+use style_traits::DevicePixel;
use webdriver_msg::{LoadStatus, WebDriverScriptCommand};
use webrender_api::ClipId;
use webvr_traits::{WebVREvent, WebVRMsg};
@@ -687,12 +686,6 @@ pub struct ScrollState {
pub scroll_offset: Vector2D<f32>,
}
-/// One hardware pixel.
-///
-/// This unit corresponds to the smallest addressable element of the display hardware.
-#[derive(Copy, Clone, Debug)]
-pub enum DevicePixel {}
-
/// Data about the window size.
#[derive(Copy, Clone, Deserialize, Serialize, HeapSizeOf)]
pub struct WindowSizeData {
@@ -828,7 +821,8 @@ impl From<RecvTimeoutError> for PaintWorkletError {
pub trait Painter: Sync + Send {
/// https://drafts.css-houdini.org/css-paint-api/#draw-a-paint-image
fn draw_a_paint_image(&self,
- concrete_object_size: Size2D<Au>,
+ size: TypedSize2D<f32, CSSPixel>,
+ zoom: ScaleFactor<f32, CSSPixel, DevicePixel>,
properties: Vec<(Atom, String)>,
sender: IpcSender<CanvasData>);
}