diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2019-06-04 15:21:58 -0700 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-07-09 10:50:27 -0400 |
commit | 2f9c9cefdb74713593c47eec2002c5dd5416848b (patch) | |
tree | 9e0fef3243dad3fb8b97e7622e37026967688963 /components/compositing | |
parent | 357fc0332391bb6603b29453e644d9326807afbb (diff) | |
download | servo-2f9c9cefdb74713593c47eec2002c5dd5416848b.tar.gz servo-2f9c9cefdb74713593c47eec2002c5dd5416848b.zip |
WebRender units are no longer reexported.
Diffstat (limited to 'components/compositing')
-rw-r--r-- | components/compositing/compositor.rs | 21 | ||||
-rw-r--r-- | components/compositing/compositor_thread.rs | 3 | ||||
-rw-r--r-- | components/compositing/windowing.rs | 7 |
3 files changed, 14 insertions, 17 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index bb8f4d8f2f0..c4ee45bb8e7 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -42,10 +42,8 @@ use std::rc::Rc; use style_traits::viewport::ViewportConstraints; use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor}; use time::{now, precise_time_ns, precise_time_s}; -use webrender_api::{ - self, DeviceIntPoint, DevicePoint, FramebufferIntSize, HitTestFlags, HitTestResult, -}; -use webrender_api::{LayoutVector2D, ScrollLocation}; +use webrender_api::{self, HitTestFlags, HitTestResult, ScrollLocation}; +use webrender_api::units::{DeviceIntPoint, DevicePoint, FramebufferIntSize, LayoutVector2D}; use webvr_traits::WebVRMainThreadHeartbeat; #[derive(Debug, PartialEq)] @@ -724,7 +722,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { let dppx = self.page_zoom * self.hidpi_factor(); let scaled_point = (point / dppx).to_untyped(); - let world_cursor = webrender_api::WorldPoint::from_untyped(&scaled_point); + let world_cursor = webrender_api::units::WorldPoint::from_untyped(&scaled_point); self.webrender_api.hit_test( self.webrender_document, None, @@ -844,8 +842,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { let cursor = TypedPoint2D::new(-1, -1); // Make sure this hits the base layer. self.pending_scroll_zoom_events.push(ScrollZoomEvent { magnification: magnification, - scroll_location: ScrollLocation::Delta( - webrender_api::LayoutVector2D::from_untyped(&scroll_delta.to_untyped()), + scroll_location: ScrollLocation::Delta(LayoutVector2D::from_untyped( + &scroll_delta.to_untyped()), ), cursor: cursor, event_count: 1, @@ -933,8 +931,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { last_combined_event @ &mut None => { *last_combined_event = Some(ScrollZoomEvent { magnification: scroll_event.magnification, - scroll_location: ScrollLocation::Delta( - webrender_api::LayoutVector2D::from_untyped(&this_delta.to_untyped()), + scroll_location: ScrollLocation::Delta(LayoutVector2D::from_untyped( + &this_delta.to_untyped()), ), cursor: this_cursor, event_count: 1, @@ -966,15 +964,14 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { let scaled_delta = (TypedVector2D::from_untyped(&delta.to_untyped()) / self.scale) .to_untyped(); - let calculated_delta = - webrender_api::LayoutVector2D::from_untyped(&scaled_delta); + let calculated_delta = LayoutVector2D::from_untyped(&scaled_delta); ScrollLocation::Delta(calculated_delta) }, // Leave ScrollLocation unchanged if it is Start or End location. sl @ ScrollLocation::Start | sl @ ScrollLocation::End => sl, }; let cursor = (combined_event.cursor.to_f32() / self.scale).to_untyped(); - let cursor = webrender_api::WorldPoint::from_untyped(&cursor); + let cursor = webrender_api::units::WorldPoint::from_untyped(&cursor); let mut txn = webrender_api::Transaction::new(); txn.scroll(scroll_location, cursor); if combined_event.magnification != 1.0 { diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index 8ef56c813c3..ad318368b69 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -17,7 +17,8 @@ use profile_traits::time; use script_traits::{AnimationState, ConstellationMsg, EventResult}; use std::fmt::{Debug, Error, Formatter}; use style_traits::viewport::ViewportConstraints; -use webrender_api::{self, DeviceIntPoint, DeviceIntSize}; +use webrender_api::units::{DeviceIntPoint, DeviceIntSize}; +use webrender_api; use webvr_traits::WebVRMainThreadHeartbeat; /// Sends messages to the compositor. diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 91d954a281a..64607668f27 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -19,10 +19,9 @@ use std::fmt::{Debug, Error, Formatter}; use std::rc::Rc; use std::time::Duration; use style_traits::DevicePixel; -use webrender_api::{ - DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, FramebufferIntRect, - FramebufferIntSize, ScrollLocation, -}; +use webrender_api::ScrollLocation; +use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint}; +use webrender_api::units::{FramebufferIntRect, FramebufferIntSize}; use webvr::VRServiceManager; use webvr_traits::WebVRMainThreadHeartbeat; |