diff options
-rw-r--r-- | components/compositing/compositor.rs | 51 | ||||
-rw-r--r-- | components/compositing/compositor_thread.rs | 2 | ||||
-rw-r--r-- | components/compositing/windowing.rs | 4 | ||||
-rw-r--r-- | components/layout/display_list/builder.rs | 2 | ||||
-rw-r--r-- | components/layout/display_list/webrender_helpers.rs | 42 | ||||
-rw-r--r-- | components/layout/fragment.rs | 2 | ||||
-rw-r--r-- | components/layout/sequential.rs | 2 | ||||
-rw-r--r-- | components/servo/lib.rs | 5 | ||||
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 4 | ||||
-rw-r--r-- | servo-tidy.toml | 1 |
10 files changed, 67 insertions, 48 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index c440796453b..9f8736e619c 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -42,8 +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, HitTestFlags, HitTestResult, ScrollLocation}; use webrender_api::units::{DeviceIntPoint, DeviceIntSize, DevicePoint, LayoutVector2D}; +use webrender_api::{self, HitTestFlags, HitTestResult, ScrollLocation}; use webvr_traits::WebVRMainThreadHeartbeat; #[derive(Debug, PartialEq)] @@ -843,8 +843,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { self.pending_scroll_zoom_events.push(ScrollZoomEvent { magnification: magnification, scroll_location: ScrollLocation::Delta(LayoutVector2D::from_untyped( - &scroll_delta.to_untyped()), - ), + &scroll_delta.to_untyped(), + )), cursor: cursor, event_count: 1, }); @@ -932,8 +932,8 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { *last_combined_event = Some(ScrollZoomEvent { magnification: scroll_event.magnification, scroll_location: ScrollLocation::Delta(LayoutVector2D::from_untyped( - &this_delta.to_untyped()), - ), + &this_delta.to_untyped(), + )), cursor: this_cursor, event_count: 1, }) @@ -1165,9 +1165,9 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { let mut pipeline_epochs = HashMap::new(); for (id, _) in &self.pipeline_details { let webrender_pipeline_id = id.to_webrender(); - if let Some(webrender_api::Epoch(epoch)) = - self.webrender.current_epoch(self.webrender_document, - webrender_pipeline_id) + if let Some(webrender_api::Epoch(epoch)) = self + .webrender + .current_epoch(self.webrender_document, webrender_pipeline_id) { let epoch = Epoch(epoch); pipeline_epochs.insert(*id, epoch); @@ -1267,11 +1267,11 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { #[cfg(feature = "gl")] CompositeTarget::Window => gl::RenderTargetInfo::default(), #[cfg(feature = "gl")] - CompositeTarget::WindowAndPng | CompositeTarget::PngFile => { - gl::initialize_png(&*self.window.gl(), - FramebufferUintLength::new(width.get()), - FramebufferUintLength::new(height.get())) - }, + CompositeTarget::WindowAndPng | CompositeTarget::PngFile => gl::initialize_png( + &*self.window.gl(), + FramebufferUintLength::new(width.get()), + FramebufferUintLength::new(height.get()), + ), #[cfg(not(feature = "gl"))] _ => (), }; @@ -1304,8 +1304,9 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { // For each pending paint metrics pipeline id for (id, pending_epoch) in &self.pending_paint_metrics { // we get the last painted frame id from webrender - if let Some(webrender_api::Epoch(epoch)) = - self.webrender.current_epoch(self.webrender_document, id.to_webrender()) + if let Some(webrender_api::Epoch(epoch)) = self + .webrender + .current_epoch(self.webrender_document, id.to_webrender()) { // and check if it is the one the layout thread is expecting, let epoch = Epoch(epoch); @@ -1332,10 +1333,12 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { CompositeTarget::Window => None, #[cfg(feature = "gl")] CompositeTarget::WindowAndPng => { - let img = gl::draw_img(&*self.window.gl(), - rt_info, - FramebufferUintLength::new(width.get()), - FramebufferUintLength::new(height.get())); + let img = gl::draw_img( + &*self.window.gl(), + rt_info, + FramebufferUintLength::new(width.get()), + FramebufferUintLength::new(height.get()), + ); Some(Image { width: img.width(), height: img.height(), @@ -1354,10 +1357,12 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { || match self.output_file.as_ref() { Some(path) => match File::create(path) { Ok(mut file) => { - let img = gl::draw_img(gl, - rt_info, - FramebufferUintLength::new(width.get()), - FramebufferUintLength::new(height.get())); + let img = gl::draw_img( + gl, + rt_info, + FramebufferUintLength::new(width.get()), + FramebufferUintLength::new(height.get()), + ); let dynamic_image = DynamicImage::ImageRgb8(img); if let Err(e) = dynamic_image.write_to(&mut file, ImageFormat::PNG) { diff --git a/components/compositing/compositor_thread.rs b/components/compositing/compositor_thread.rs index ad318368b69..9250d25e5bf 100644 --- a/components/compositing/compositor_thread.rs +++ b/components/compositing/compositor_thread.rs @@ -17,8 +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::units::{DeviceIntPoint, DeviceIntSize}; use webrender_api; +use webrender_api::units::{DeviceIntPoint, DeviceIntSize}; use webvr_traits::WebVRMainThreadHeartbeat; /// Sends messages to the compositor. diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs index 90ced19bc09..d668b03979e 100644 --- a/components/compositing/windowing.rs +++ b/components/compositing/windowing.rs @@ -19,9 +19,9 @@ use std::fmt::{Debug, Error, Formatter}; use std::rc::Rc; use std::time::Duration; use style_traits::DevicePixel; -use webrender_api::ScrollLocation; -use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize}; use webrender_api::units::DevicePoint; +use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize}; +use webrender_api::ScrollLocation; use webvr::VRServiceManager; use webvr_traits::WebVRMainThreadHeartbeat; diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs index 54091f85389..00fc8495857 100644 --- a/components/layout/display_list/builder.rs +++ b/components/layout/display_list/builder.rs @@ -65,10 +65,10 @@ use style::values::specified::ui::CursorKind; use style::values::{Either, RGBA}; use style_traits::ToCss; use webrender_api::units::{LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D}; +use webrender_api::{self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF}; use webrender_api::{ColorU, ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LineStyle}; use webrender_api::{NinePatchBorder, NinePatchBorderSource, NormalBorder}; use webrender_api::{ScrollSensitivity, StickyOffsetBounds}; -use webrender_api::{self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF}; static THREAD_TINT_COLORS: [ColorF; 8] = [ ColorF { diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs index c55beb7ec17..34b6d093d53 100644 --- a/components/layout/display_list/webrender_helpers.rs +++ b/components/layout/display_list/webrender_helpers.rs @@ -13,7 +13,9 @@ use msg::constellation_msg::PipelineId; use webrender_api::units::LayoutPoint; use webrender_api::{self, ClipId, CommonItemProperties, DisplayItem as WrDisplayItem}; use webrender_api::{DisplayListBuilder, PropertyBinding, PushStackingContextDisplayItem}; -use webrender_api::{RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId, StackingContext}; +use webrender_api::{ + RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId, StackingContext, +}; pub trait WebRenderDisplayListConverter { fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder; @@ -144,26 +146,30 @@ impl WebRenderDisplayItemConverter for DisplayItem { }, DisplayItem::PushTextShadow(ref mut item) => { let common = build_common_item_properties(&item.base, state); - builder.push_shadow(&SpaceAndClipInfo { - spatial_id: common.spatial_id, - clip_id: common.clip_id, - }, - item.shadow, - true); + builder.push_shadow( + &SpaceAndClipInfo { + spatial_id: common.spatial_id, + clip_id: common.clip_id, + }, + item.shadow, + true, + ); }, DisplayItem::PopAllTextShadows(_) => { builder.push_item(&WrDisplayItem::PopAllShadows); }, DisplayItem::Iframe(ref mut item) => { let common = build_common_item_properties(&item.base, state); - builder.push_iframe(item.base.bounds, - common.clip_rect, - &SpaceAndClipInfo { - spatial_id: common.spatial_id, - clip_id: common.clip_id, - }, - item.iframe.to_webrender(), - true); + builder.push_iframe( + item.base.bounds, + common.clip_rect, + &SpaceAndClipInfo { + spatial_id: common.spatial_id, + clip_id: common.clip_id, + }, + item.iframe.to_webrender(), + true, + ); }, DisplayItem::PushStackingContext(ref mut item) => { let stacking_context = &item.stacking_context; @@ -296,8 +302,10 @@ impl WebRenderDisplayItemConverter for DisplayItem { } } -fn build_common_item_properties(base: &BaseDisplayItem, state: &ClipScrollState) - -> CommonItemProperties { +fn build_common_item_properties( + base: &BaseDisplayItem, + state: &ClipScrollState, +) -> CommonItemProperties { let tag = match base.metadata.pointing { Some(cursor) => Some((base.metadata.node.0 as u64, cursor)), None => None, diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index aa8a8605642..879e2af2f64 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -65,8 +65,8 @@ use style::values::computed::{LengthPercentage, LengthPercentageOrAuto, Size, Ve use style::values::generics::box_::{Perspective, VerticalAlignKeyword}; use style::values::generics::transform; use style::Zero; -use webrender_api::units::LayoutTransform; use webrender_api; +use webrender_api::units::LayoutTransform; // From gfxFontConstants.h in Firefox. static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20; diff --git a/components/layout/sequential.rs b/components/layout/sequential.rs index 6a0b99dab8c..113330f0162 100644 --- a/components/layout/sequential.rs +++ b/components/layout/sequential.rs @@ -5,8 +5,8 @@ //! Implements sequential traversals over the DOM and flow trees. use crate::context::LayoutContext; -use crate::display_list::{DisplayListBuildState, StackingContextCollectionState}; use crate::display_list::items::{self, CommonDisplayItem, DisplayItem, DisplayListSection}; +use crate::display_list::{DisplayListBuildState, StackingContextCollectionState}; use crate::floats::SpeculatedFloatPlacement; use crate::flow::{Flow, FlowFlags, GetBaseFlow, ImmutableFlowUtils}; use crate::fragment::{CoordinateSystem, FragmentBorderBoxIterator}; diff --git a/components/servo/lib.rs b/components/servo/lib.rs index feb31036fdc..531ca628ce6 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -307,7 +307,10 @@ where // Cast from `DeviceIndependentPixel` to `DevicePixel` let device_pixel_ratio = coordinates.hidpi_factor.get(); let window_size = TypedSize2D::from_untyped( - &(opts.initial_window_size.to_f32() / device_pixel_ratio).to_i32().to_untyped()); + &(opts.initial_window_size.to_f32() / device_pixel_ratio) + .to_i32() + .to_untyped(), + ); webrender::Renderer::new( window.gl(), diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index b54bc35bfbf..46da89d3907 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -371,6 +371,10 @@ def check_lock(file_name, contents): source = "crates.io" packages_by_name.setdefault(package["name"], []).append((package["version"], source)) + for name in exceptions: + if name not in packages_by_name: + yield (1, "duplicates are allowed for `{}` but it is not a dependency".format(name)) + for (name, packages) in packages_by_name.iteritems(): has_duplicates = len(packages) > 1 duplicates_allowed = name in exceptions diff --git a/servo-tidy.toml b/servo-tidy.toml index 14fcdb5fbe1..ca8cff08917 100644 --- a/servo-tidy.toml +++ b/servo-tidy.toml @@ -46,7 +46,6 @@ packages = [ "rand_core", "scopeguard", "unicase", - "ws", ] # Files that are ignored for all tidy and lint checks. files = [ |