diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-10-06 15:46:56 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-10-06 15:46:56 -0600 |
commit | 5eb1c04e7854d932c0d63f9e5ed4d54ee43deb9b (patch) | |
tree | 29c67d0504607ffcc9263c0c119ad1a4d78d5858 | |
parent | e4b02cc981ed095c2cf3816d26ad32353357e64e (diff) | |
parent | e3b988a1fec6ead4d0b037fa16319e19676042b7 (diff) | |
download | servo-5eb1c04e7854d932c0d63f9e5ed4d54ee43deb9b.tar.gz servo-5eb1c04e7854d932c0d63f9e5ed4d54ee43deb9b.zip |
Auto merge of #7896 - pcwalton:box-shadow-border-radii, r=mbrubeck
layout: Add a field in the display list for simple border radii on box shadows.
Only supported in WebRender (with my upcoming PR) for now.
r? @mbrubeck
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7896)
<!-- Reviewable:end -->
-rw-r--r-- | components/gfx/display_list/mod.rs | 5 | ||||
-rw-r--r-- | components/layout/display_list_builder.rs | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index f1bd0efcbec..c7053472b69 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -1198,6 +1198,11 @@ pub struct BoxShadowDisplayItem { /// The spread radius of this shadow. pub spread_radius: Au, + /// The border radius of this shadow. + /// + /// TODO(pcwalton): Elliptical radii; different radii for each corner. + pub border_radius: Au, + /// How we should clip the result. pub clip_mode: BoxShadowClipMode, } diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index ebca14ba59f..c4937791140 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -668,6 +668,8 @@ impl FragmentDisplayListBuilding for Fragment { box_shadow.offset_y)), box_shadow.blur_radius, box_shadow.spread_radius); + + // TODO(pcwalton): Multiple border radii; elliptical border radii. list.push(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem { base: BaseDisplayItem::new(bounds, DisplayItemMetadata::new(self.node, @@ -679,6 +681,9 @@ impl FragmentDisplayListBuilding for Fragment { offset: Point2D::new(box_shadow.offset_x, box_shadow.offset_y), blur_radius: box_shadow.blur_radius, spread_radius: box_shadow.spread_radius, + border_radius: model::specified_border_radius(style.get_border() + .border_top_left_radius, + absolute_bounds.size.width).width, clip_mode: if box_shadow.inset { BoxShadowClipMode::Inset } else { @@ -1503,6 +1508,7 @@ impl FragmentDisplayListBuilding for Fragment { offset: ZERO_POINT, blur_radius: blur_radius, spread_radius: Au(0), + border_radius: Au(0), clip_mode: BoxShadowClipMode::None, })) } @@ -2034,3 +2040,4 @@ pub enum StackingContextCreationMode { OuterScrollWrapper, InnerScrollWrapper, } + |