WebRender units are no longer reexported.

This commit is contained in:
Patrick Walton 2019-06-04 15:21:58 -07:00 committed by Josh Matthews
parent 357fc03323
commit 2f9c9cefdb
24 changed files with 65 additions and 68 deletions

View file

@ -12,8 +12,8 @@ use style::values::computed::{BorderCornerRadius, BorderImageWidth};
use style::values::computed::{BorderImageSideWidth, NonNegativeLengthOrNumber};
use style::values::generics::rect::Rect as StyleRect;
use style::values::generics::NonNegative;
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF};
use webrender_api::{LayoutSideOffsets, LayoutSize, NormalBorder};
use webrender_api::units::{LayoutSideOffsets, LayoutSize};
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, NormalBorder};
/// Computes a border radius size against the containing size.
///

View file

@ -64,12 +64,11 @@ use style::values::generics::image::{GradientKind, PaintWorklet};
use style::values::specified::ui::CursorKind;
use style::values::{Either, RGBA};
use style_traits::ToCss;
use webrender_api::{
self, BorderDetails, BorderRadius, BorderSide, BoxShadowClipMode, ColorF, ColorU,
ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LayoutRect, LayoutSize,
LayoutTransform, LayoutVector2D, LineStyle, NinePatchBorder, NinePatchBorderSource,
NormalBorder, ScrollSensitivity, StickyOffsetBounds,
};
use webrender_api::units::{LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
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 {

View file

@ -114,23 +114,23 @@ impl ToLayout for RGBA {
}
impl ToLayout for Point2D<Au> {
type Type = wr::LayoutPoint;
type Type = wr::units::LayoutPoint;
fn to_layout(&self) -> Self::Type {
wr::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px())
wr::units::LayoutPoint::new(self.x.to_f32_px(), self.y.to_f32_px())
}
}
impl ToLayout for Rect<Au> {
type Type = wr::LayoutRect;
type Type = wr::units::LayoutRect;
fn to_layout(&self) -> Self::Type {
wr::LayoutRect::new(self.origin.to_layout(), self.size.to_layout())
wr::units::LayoutRect::new(self.origin.to_layout(), self.size.to_layout())
}
}
impl ToLayout for SideOffsets2D<Au> {
type Type = wr::LayoutSideOffsets;
type Type = wr::units::LayoutSideOffsets;
fn to_layout(&self) -> Self::Type {
wr::LayoutSideOffsets::new(
wr::units::LayoutSideOffsets::new(
self.top.to_f32_px(),
self.right.to_f32_px(),
self.bottom.to_f32_px(),
@ -140,16 +140,16 @@ impl ToLayout for SideOffsets2D<Au> {
}
impl ToLayout for Size2D<Au> {
type Type = wr::LayoutSize;
type Type = wr::units::LayoutSize;
fn to_layout(&self) -> Self::Type {
wr::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px())
wr::units::LayoutSize::new(self.width.to_f32_px(), self.height.to_f32_px())
}
}
impl ToLayout for Vector2D<Au> {
type Type = wr::LayoutVector2D;
type Type = wr::units::LayoutVector2D;
fn to_layout(&self) -> Self::Type {
wr::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px())
wr::units::LayoutVector2D::new(self.x.to_f32_px(), self.y.to_f32_px())
}
}

View file

@ -24,12 +24,10 @@ use std::f32;
use std::fmt;
use style::computed_values::_servo_top_layer::T as InTopLayer;
use webrender_api as wr;
use webrender_api::{BorderRadius, ClipMode};
use webrender_api::{ComplexClipRegion, ExternalScrollId, FilterOp};
use webrender_api::{GlyphInstance, GradientStop, ImageKey, LayoutPoint};
use webrender_api::{LayoutRect, LayoutSize, LayoutTransform};
use webrender_api::{MixBlendMode, ScrollSensitivity, Shadow};
use webrender_api::{StickyOffsetBounds, TransformStyle};
use webrender_api::units::{LayoutPoint, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
use webrender_api::{BorderRadius, ClipMode, ComplexClipRegion, ExternalScrollId, FilterOp};
use webrender_api::{GlyphInstance, GradientStop, ImageKey, MixBlendMode, ScrollSensitivity};
use webrender_api::{Shadow, StickyOffsetBounds, TransformStyle};
pub use style::dom::OpaqueNode;

View file

@ -10,10 +10,9 @@
use crate::display_list::items::{ClipScrollNode, ClipScrollNodeType};
use crate::display_list::items::{DisplayItem, DisplayList, StackingContextType};
use msg::constellation_msg::PipelineId;
use webrender_api::{
self, ClipId, DisplayListBuilder, RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId,
};
use webrender_api::{LayoutPoint, PropertyBinding, SpecificDisplayItem};
use webrender_api::units::LayoutPoint;
use webrender_api::{self, ClipId, DisplayListBuilder, RasterSpace, ReferenceFrameKind};
use webrender_api::{SpaceAndClipInfo, SpatialId, SpecificDisplayItem};
pub trait WebRenderDisplayListConverter {
fn convert_to_webrender(&self, pipeline_id: PipelineId) -> DisplayListBuilder;
@ -306,7 +305,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
sticky_data.margins,
sticky_data.vertical_offset_bounds,
sticky_data.horizontal_offset_bounds,
webrender_api::LayoutVector2D::zero(),
webrender_api::units::LayoutVector2D::zero(),
);
state.spatial_ids[item.node_index.to_index()] = Some(id);

View file

@ -65,7 +65,7 @@ use style::properties::ComputedValues;
use style::selector_parser::RestyleDamage;
use style::servo::restyle_damage::ServoRestyleDamage;
use style::values::computed::LengthPercentageOrAuto;
use webrender_api::LayoutTransform;
use webrender_api::units::LayoutTransform;
/// This marker trait indicates that a type is a struct with `#[repr(C)]` whose first field
/// is of type `BaseFlow` or some type that also implements this trait.

View file

@ -65,7 +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::{self, LayoutTransform};
use webrender_api::units::LayoutTransform;
use webrender_api;
// From gfxFontConstants.h in Firefox.
static FONT_SUBSCRIPT_OFFSET_RATIO: f32 = 0.20;

View file

@ -17,7 +17,7 @@ use app_units::Au;
use euclid::{Point2D, Vector2D};
use servo_config::opts;
use style::servo::restyle_damage::ServoRestyleDamage;
use webrender_api::LayoutPoint;
use webrender_api::units::LayoutPoint;
pub fn resolve_generated_content(root: &mut dyn Flow, layout_context: &LayoutContext) {
ResolveGeneratedContent::new(&layout_context).traverse(root, 0);