Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove BorderWidthsAu #3084

Merged
merged 1 commit into from Sep 20, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Remove BorderWidthsAu

  • Loading branch information
pyfisch committed Sep 20, 2018
commit fbfb69e78f8c80e5b127082d289c81e7eff8d551
@@ -8,6 +8,7 @@ use api::{DeviceVector2D, DevicePoint, DeviceIntSize, LayoutRect, LayoutSize, No
use api::{AuHelpers};
use app_units::Au;
use ellipse::Ellipse;
use euclid::SideOffsets2D;
use display_list_flattener::DisplayListFlattener;
use gpu_types::{BorderInstance, BorderSegment, BrushFlags};
use prim_store::{BrushKind, BrushPrimitive, BrushSegment};
@@ -75,27 +76,6 @@ impl From<BorderRadiusAu> for BorderRadius {
}
}

#[derive(Clone, Debug, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
pub struct BorderWidthsAu {
pub left: Au,
pub top: Au,
pub right: Au,
pub bottom: Au,
}

impl From<LayoutSideOffsets> for BorderWidthsAu {
fn from(widths: LayoutSideOffsets) -> Self {
BorderWidthsAu {
left: Au::from_f32_px(widths.left),
top: Au::from_f32_px(widths.top),
right: Au::from_f32_px(widths.right),
bottom: Au::from_f32_px(widths.bottom),
}
}
}

#[derive(Clone, Debug, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
@@ -122,7 +102,7 @@ pub struct BorderCacheKey {
pub top: BorderSideAu,
pub bottom: BorderSideAu,
pub radius: BorderRadiusAu,
pub widths: BorderWidthsAu,
pub widths: SideOffsets2D<Au>,
pub scale: Au,
}

@@ -133,7 +113,12 @@ impl BorderCacheKey {
top: border.top.into(),
right: border.right.into(),
bottom: border.bottom.into(),
widths: (*widths).into(),
widths: SideOffsets2D::new(
Au::from_f32_px(widths.top),
Au::from_f32_px(widths.right),
Au::from_f32_px(widths.bottom),
Au::from_f32_px(widths.left),
),
radius: border.radius.into(),
scale: Au(0),
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.