aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_thread/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_thread/lib.rs')
-rw-r--r--components/layout_thread/lib.rs27
1 files changed, 13 insertions, 14 deletions
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 1d8448c6e74..2febabce08b 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -28,7 +28,7 @@ use crate::dom_wrapper::{ServoLayoutDocument, ServoLayoutElement, ServoLayoutNod
use app_units::Au;
use crossbeam_channel::{unbounded, Receiver, Sender};
use embedder_traits::resources::{self, Resource};
-use euclid::{Point2D, Rect, Size2D, TypedScale, TypedSize2D};
+use euclid::{default::Size2D as UntypedSize2D, Point2D, Rect, Scale, Size2D};
use fnv::FnvHashMap;
use fxhash::{FxHashMap, FxHashSet};
use gfx::font;
@@ -216,7 +216,7 @@ pub struct LayoutThread {
/// The size of the viewport. This may be different from the size of the screen due to viewport
/// constraints.
- viewport_size: Size2D<Au>,
+ viewport_size: UntypedSize2D<Au>,
/// A mutex to allow for fast, read-only RPC of layout's internal data
/// structures, while still letting the LayoutThread modify them.
@@ -246,7 +246,7 @@ pub struct LayoutThread {
layout_query_waiting_time: Histogram,
/// The sizes of all iframes encountered during the last layout operation.
- last_iframe_sizes: RefCell<HashMap<BrowsingContextId, TypedSize2D<f32, CSSPixel>>>,
+ last_iframe_sizes: RefCell<HashMap<BrowsingContextId, Size2D<f32, CSSPixel>>>,
/// Flag that indicates if LayoutThread is busy handling a request.
busy: Arc<AtomicBool>,
@@ -255,7 +255,7 @@ pub struct LayoutThread {
load_webfonts_synchronously: bool,
/// The initial request size of the window
- initial_window_size: TypedSize2D<u32, DeviceIndependentPixel>,
+ initial_window_size: Size2D<u32, DeviceIndependentPixel>,
/// The ratio of device pixels per px at the default scale.
/// If unspecified, will use the platform default setting.
@@ -312,7 +312,7 @@ impl LayoutThreadFactory for LayoutThread {
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
- initial_window_size: TypedSize2D<u32, DeviceIndependentPixel>,
+ initial_window_size: Size2D<u32, DeviceIndependentPixel>,
device_pixels_per_px: Option<f32>,
dump_display_list: bool,
dump_display_list_json: bool,
@@ -535,7 +535,7 @@ impl LayoutThread {
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
- initial_window_size: TypedSize2D<u32, DeviceIndependentPixel>,
+ initial_window_size: Size2D<u32, DeviceIndependentPixel>,
device_pixels_per_px: Option<f32>,
dump_display_list: bool,
dump_display_list_json: bool,
@@ -550,8 +550,8 @@ impl LayoutThread {
// but it will be set correctly when the initial reflow takes place.
let device = Device::new(
MediaType::screen(),
- initial_window_size.to_f32() * TypedScale::new(1.0),
- TypedScale::new(device_pixels_per_px.unwrap_or(1.0)),
+ initial_window_size.to_f32() * Scale::new(1.0),
+ Scale::new(device_pixels_per_px.unwrap_or(1.0)),
);
// Create the channel on which new animations can be sent.
@@ -833,7 +833,7 @@ impl LayoutThread {
let point = Point2D::new(-state.scroll_offset.x, -state.scroll_offset.y);
let mut txn = webrender_api::Transaction::new();
txn.scroll_node_with_id(
- webrender_api::units::LayoutPoint::from_untyped(&point),
+ webrender_api::units::LayoutPoint::from_untyped(point),
state.scroll_id,
webrender_api::ScrollClamping::ToContentBounds,
);
@@ -1249,7 +1249,7 @@ impl LayoutThread {
epoch.next();
self.epoch.set(epoch);
- let viewport_size = webrender_api::units::LayoutSize::from_untyped(&viewport_size);
+ let viewport_size = webrender_api::units::LayoutSize::from_untyped(viewport_size);
// Observe notifications about rendered frames if needed right before
// sending the display list to WebRender in order to set time related
@@ -1671,8 +1671,7 @@ impl LayoutThread {
// particular pipeline, so we need to tell WebRender about that.
flags.insert(webrender_api::HitTestFlags::POINT_RELATIVE_TO_PIPELINE_VIEWPORT);
- let client_point =
- webrender_api::units::WorldPoint::from_untyped(&client_point);
+ let client_point = webrender_api::units::WorldPoint::from_untyped(client_point);
let results = self.webrender_api.hit_test(
self.webrender_document,
Some(self.id.to_webrender()),
@@ -2134,8 +2133,8 @@ impl RegisteredSpeculativePainter for RegisteredPainterImpl {
impl Painter for RegisteredPainterImpl {
fn draw_a_paint_image(
&self,
- size: TypedSize2D<f32, CSSPixel>,
- device_pixel_ratio: TypedScale<f32, CSSPixel, DevicePixel>,
+ size: Size2D<f32, CSSPixel>,
+ device_pixel_ratio: Scale<f32, CSSPixel, DevicePixel>,
properties: Vec<(Atom, String)>,
arguments: Vec<String>,
) -> Result<DrawAPaintImageResult, PaintWorkletError> {