servo: Merge #17814 - Update WR (switch to new text-decorations API in WR) (from glennw:update-wr-text-decorations); r=emilio

This only makes use of the "Solid" text decoration type, which
matches the existing support. WR now supports dotted, dashed
and wavy text decorations, but supporting those will need some
extra work in Servo to pass through the correct values.

Source-Repo: https://github.com/servo/servo
Source-Revision: 46ffcbaf7bc97df7c8ba3b82add0e03a01805ab4

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 97baccf41b67fd0c743bd96d4917e8b7ef6b0a7f
This commit is contained in:
Glenn Watson 2017-07-23 20:04:38 -07:00
Родитель fbe625863b
Коммит be8cd7ddc3
4 изменённых файлов: 18 добавлений и 8 удалений

4
servo/Cargo.lock сгенерированный
Просмотреть файл

@ -3465,7 +3465,7 @@ dependencies = [
[[package]]
name = "webrender"
version = "0.48.0"
source = "git+https://github.com/servo/webrender#b83c200c657f6b6fb17d09f329ba77803420b46a"
source = "git+https://github.com/servo/webrender#8fd634882111415a65da67e947f26eb170234f2f"
dependencies = [
"app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3494,7 +3494,7 @@ dependencies = [
[[package]]
name = "webrender_api"
version = "0.48.0"
source = "git+https://github.com/servo/webrender#b83c200c657f6b6fb17d09f329ba77803420b46a"
source = "git+https://github.com/servo/webrender#8fd634882111415a65da67e947f26eb170234f2f"
dependencies = [
"app_units 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bincode 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",

Просмотреть файл

@ -1146,7 +1146,8 @@ pub struct LineDisplayItem {
pub color: ColorF,
/// The line segment style.
pub style: border_style::T
#[ignore_heap_size_of = "enum type in webrender"]
pub style: webrender_api::LineStyle,
}
/// Paints a box shadow per CSS-BACKGROUNDS.

Просмотреть файл

@ -71,7 +71,7 @@ use style_traits::CSSPixel;
use style_traits::cursor::Cursor;
use table_cell::CollapsedBordersForCell;
use webrender_api::{ClipId, ColorF, ComplexClipRegion, GradientStop, LocalClip, RepeatMode};
use webrender_api::{ScrollPolicy, TransformStyle};
use webrender_api::{LineStyle, ScrollPolicy, TransformStyle};
use webrender_helpers::{ToBorderRadius, ToMixBlendMode, ToRectF, ToTransformStyle};
trait ResolvePercentage {
@ -1651,7 +1651,7 @@ impl FragmentDisplayListBuilding for Fragment {
state.add_display_item(DisplayItem::Line(box LineDisplayItem {
base: base,
color: ColorF::rgb(0, 200, 0),
style: border_style::T::dashed,
style: LineStyle::Dashed,
}));
}
@ -2217,9 +2217,10 @@ impl FragmentDisplayListBuilding for Fragment {
self.style.get_cursor(Cursor::Default),
DisplayListSection::Content);
state.add_display_item(DisplayItem::SolidColor(box SolidColorDisplayItem {
state.add_display_item(DisplayItem::Line(box LineDisplayItem {
base: base,
color: color.to_gfx_color(),
style: LineStyle::Solid,
}));
}

Просмотреть файл

@ -432,8 +432,16 @@ impl WebRenderDisplayItemConverter for DisplayItem {
rect.size,
webrender_api::LayoutSize::zero());
}
DisplayItem::Line(..) => {
println!("TODO DisplayItem::Line");
DisplayItem::Line(ref item) => {
let box_bounds = item.base.bounds.to_rectf();
builder.push_line(Some(item.base.local_clip),
box_bounds.origin.y + box_bounds.size.height,
box_bounds.origin.x,
box_bounds.origin.x + box_bounds.size.width,
webrender_api::LineOrientation::Horizontal,
box_bounds.size.height,
item.color,
item.style);
}
DisplayItem::BoxShadow(ref item) => {
let rect = item.base.bounds.to_rectf();