Add layout_2020 support for filters and mix-blend-mode

This commit is contained in:
Martin Robinson 2020-02-17 13:57:29 +01:00
parent 163a4fc7fc
commit d03560b0f1
54 changed files with 236 additions and 1943 deletions

View file

@ -354,41 +354,3 @@ impl<T> flow_relative::Rect<T> {
)
}
}
pub trait ToWebRender {
type Type;
fn to_webrender(&self) -> Self::Type;
}
impl ToWebRender for PhysicalPoint<Length> {
type Type = webrender_api::units::LayoutPoint;
fn to_webrender(&self) -> Self::Type {
webrender_api::units::LayoutPoint::new(self.x.px(), self.y.px())
}
}
impl ToWebRender for PhysicalSize<Length> {
type Type = webrender_api::units::LayoutSize;
fn to_webrender(&self) -> Self::Type {
webrender_api::units::LayoutSize::new(self.width.px(), self.height.px())
}
}
impl ToWebRender for PhysicalRect<Length> {
type Type = webrender_api::units::LayoutRect;
fn to_webrender(&self) -> Self::Type {
webrender_api::units::LayoutRect::new(self.origin.to_webrender(), self.size.to_webrender())
}
}
impl ToWebRender for PhysicalSides<Length> {
type Type = webrender_api::units::LayoutSideOffsets;
fn to_webrender(&self) -> Self::Type {
webrender_api::units::LayoutSideOffsets::new(
self.top.px(),
self.right.px(),
self.bottom.px(),
self.left.px(),
)
}
}