mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Remove Class from DisplayItem enum names
This is probably a holdover from the days before namespaced enums. We can remove this part of the name to avoid a lot of visual noise.
This commit is contained in:
parent
fe78c346a3
commit
983edb9b0b
3 changed files with 95 additions and 95 deletions
|
@ -128,7 +128,7 @@ impl DisplayList {
|
||||||
let stacking_context_id = stacking_context.id;
|
let stacking_context_id = stacking_context.id;
|
||||||
let real_stacking_context = stacking_context.context_type == StackingContextType::Real;
|
let real_stacking_context = stacking_context.context_type == StackingContextType::Real;
|
||||||
if real_stacking_context {
|
if real_stacking_context {
|
||||||
list.push(DisplayItem::PushStackingContextClass(Box::new(PushStackingContextItem {
|
list.push(DisplayItem::PushStackingContext(Box::new(PushStackingContextItem {
|
||||||
base: BaseDisplayItem::empty(),
|
base: BaseDisplayItem::empty(),
|
||||||
stacking_context: stacking_context,
|
stacking_context: stacking_context,
|
||||||
})));
|
})));
|
||||||
|
@ -176,7 +176,7 @@ impl DisplayList {
|
||||||
list.extend(child_items);
|
list.extend(child_items);
|
||||||
|
|
||||||
if real_stacking_context {
|
if real_stacking_context {
|
||||||
list.push(DisplayItem::PopStackingContextClass(Box::new(
|
list.push(DisplayItem::PopStackingContext(Box::new(
|
||||||
PopStackingContextItem {
|
PopStackingContextItem {
|
||||||
base: BaseDisplayItem::empty(),
|
base: BaseDisplayItem::empty(),
|
||||||
stacking_context_id: stacking_context_id,
|
stacking_context_id: stacking_context_id,
|
||||||
|
@ -225,7 +225,7 @@ impl DisplayList {
|
||||||
tile_rect: Option<Rect<Au>>) {
|
tile_rect: Option<Rect<Au>>) {
|
||||||
while let Some(item) = traversal.next() {
|
while let Some(item) = traversal.next() {
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||||
let context = &stacking_context_item.stacking_context;
|
let context = &stacking_context_item.stacking_context;
|
||||||
if context.intersects_rect_in_parent_context(tile_rect) {
|
if context.intersects_rect_in_parent_context(tile_rect) {
|
||||||
self.draw_stacking_context(traversal,
|
self.draw_stacking_context(traversal,
|
||||||
|
@ -237,7 +237,7 @@ impl DisplayList {
|
||||||
traversal.skip_to_end_of_stacking_context(context.id);
|
traversal.skip_to_end_of_stacking_context(context.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&DisplayItem::PopStackingContextClass(_) => return,
|
&DisplayItem::PopStackingContext(_) => return,
|
||||||
_ => {
|
_ => {
|
||||||
if item.intersects_rect_in_parent_context(tile_rect) {
|
if item.intersects_rect_in_parent_context(tile_rect) {
|
||||||
item.draw_into_context(paint_context);
|
item.draw_into_context(paint_context);
|
||||||
|
@ -360,7 +360,7 @@ impl DisplayList {
|
||||||
result: &mut Vec<DisplayItemMetadata>) {
|
result: &mut Vec<DisplayItemMetadata>) {
|
||||||
while let Some(item) = traversal.next() {
|
while let Some(item) = traversal.next() {
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||||
self.hit_test_stacking_context(traversal,
|
self.hit_test_stacking_context(traversal,
|
||||||
&stacking_context_item.stacking_context,
|
&stacking_context_item.stacking_context,
|
||||||
translated_point,
|
translated_point,
|
||||||
|
@ -368,7 +368,7 @@ impl DisplayList {
|
||||||
scroll_offsets,
|
scroll_offsets,
|
||||||
result);
|
result);
|
||||||
}
|
}
|
||||||
&DisplayItem::PopStackingContextClass(_) => return,
|
&DisplayItem::PopStackingContext(_) => return,
|
||||||
_ => {
|
_ => {
|
||||||
if let Some(meta) = item.hit_test(*translated_point) {
|
if let Some(meta) = item.hit_test(*translated_point) {
|
||||||
result.push(meta);
|
result.push(meta);
|
||||||
|
@ -461,7 +461,7 @@ impl<'a> DisplayListTraversal<'a> {
|
||||||
|
|
||||||
let stacking_context_start = display_list.list[0..start].iter().rposition(|item|
|
let stacking_context_start = display_list.list[0..start].iter().rposition(|item|
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PushStackingContextClass(ref item) =>
|
&DisplayItem::PushStackingContext(ref item) =>
|
||||||
item.stacking_context.id == stacking_context_id,
|
item.stacking_context.id == stacking_context_id,
|
||||||
_ => false,
|
_ => false,
|
||||||
}).unwrap_or(start);
|
}).unwrap_or(start);
|
||||||
|
@ -483,7 +483,7 @@ impl<'a> DisplayListTraversal<'a> {
|
||||||
self.next_item_index = self.display_list.list[self.next_item_index..].iter()
|
self.next_item_index = self.display_list.list[self.next_item_index..].iter()
|
||||||
.position(|item| {
|
.position(|item| {
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PopStackingContextClass(ref item) => item.stacking_context_id == id,
|
&DisplayItem::PopStackingContext(ref item) => item.stacking_context_id == id,
|
||||||
_ => false
|
_ => false
|
||||||
}
|
}
|
||||||
}).unwrap_or(self.display_list.list.len());
|
}).unwrap_or(self.display_list.list.len());
|
||||||
|
@ -511,8 +511,8 @@ impl<'a> Iterator for DisplayListTraversal<'a> {
|
||||||
// is to ensure that we properly position items when we are processing a display list
|
// is to ensure that we properly position items when we are processing a display list
|
||||||
// slice that is relative to a certain stacking context.
|
// slice that is relative to a certain stacking context.
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PushStackingContextClass(_) |
|
&DisplayItem::PushStackingContext(_) |
|
||||||
&DisplayItem::PopStackingContextClass(_) => return Some(item),
|
&DisplayItem::PopStackingContext(_) => return Some(item),
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -758,18 +758,18 @@ impl fmt::Debug for StackingContext {
|
||||||
/// One drawing command in the list.
|
/// One drawing command in the list.
|
||||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||||
pub enum DisplayItem {
|
pub enum DisplayItem {
|
||||||
SolidColorClass(Box<SolidColorDisplayItem>),
|
SolidColor(Box<SolidColorDisplayItem>),
|
||||||
TextClass(Box<TextDisplayItem>),
|
Text(Box<TextDisplayItem>),
|
||||||
ImageClass(Box<ImageDisplayItem>),
|
Image(Box<ImageDisplayItem>),
|
||||||
WebGLClass(Box<WebGLDisplayItem>),
|
WebGL(Box<WebGLDisplayItem>),
|
||||||
BorderClass(Box<BorderDisplayItem>),
|
Border(Box<BorderDisplayItem>),
|
||||||
GradientClass(Box<GradientDisplayItem>),
|
Gradient(Box<GradientDisplayItem>),
|
||||||
LineClass(Box<LineDisplayItem>),
|
Line(Box<LineDisplayItem>),
|
||||||
BoxShadowClass(Box<BoxShadowDisplayItem>),
|
BoxShadow(Box<BoxShadowDisplayItem>),
|
||||||
LayeredItemClass(Box<LayeredItem>),
|
LayeredItem(Box<LayeredItem>),
|
||||||
IframeClass(Box<IframeDisplayItem>),
|
Iframe(Box<IframeDisplayItem>),
|
||||||
PushStackingContextClass(Box<PushStackingContextItem>),
|
PushStackingContext(Box<PushStackingContextItem>),
|
||||||
PopStackingContextClass(Box<PopStackingContextItem>),
|
PopStackingContext(Box<PopStackingContextItem>),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Information common to all display items.
|
/// Information common to all display items.
|
||||||
|
@ -1303,18 +1303,18 @@ impl DisplayItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
match *self {
|
match *self {
|
||||||
DisplayItem::SolidColorClass(ref solid_color) => {
|
DisplayItem::SolidColor(ref solid_color) => {
|
||||||
if !solid_color.color.a.approx_eq(&0.0) {
|
if !solid_color.color.a.approx_eq(&0.0) {
|
||||||
paint_context.draw_solid_color(&solid_color.base.bounds, solid_color.color)
|
paint_context.draw_solid_color(&solid_color.base.bounds, solid_color.color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::TextClass(ref text) => {
|
DisplayItem::Text(ref text) => {
|
||||||
debug!("Drawing text at {:?}.", text.base.bounds);
|
debug!("Drawing text at {:?}.", text.base.bounds);
|
||||||
paint_context.draw_text(&**text);
|
paint_context.draw_text(&**text);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::ImageClass(ref image_item) => {
|
DisplayItem::Image(ref image_item) => {
|
||||||
debug!("Drawing image at {:?}.", image_item.base.bounds);
|
debug!("Drawing image at {:?}.", image_item.base.bounds);
|
||||||
paint_context.draw_image(
|
paint_context.draw_image(
|
||||||
&image_item.base.bounds,
|
&image_item.base.bounds,
|
||||||
|
@ -1327,11 +1327,11 @@ impl DisplayItem {
|
||||||
image_item.image_rendering.clone());
|
image_item.image_rendering.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::WebGLClass(_) => {
|
DisplayItem::WebGL(_) => {
|
||||||
panic!("Shouldn't be here, WebGL display items are created just with webrender");
|
panic!("Shouldn't be here, WebGL display items are created just with webrender");
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::BorderClass(ref border) => {
|
DisplayItem::Border(ref border) => {
|
||||||
paint_context.draw_border(&border.base.bounds,
|
paint_context.draw_border(&border.base.bounds,
|
||||||
&border.border_widths,
|
&border.border_widths,
|
||||||
&border.radius,
|
&border.radius,
|
||||||
|
@ -1339,18 +1339,18 @@ impl DisplayItem {
|
||||||
&border.style)
|
&border.style)
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::GradientClass(ref gradient) => {
|
DisplayItem::Gradient(ref gradient) => {
|
||||||
paint_context.draw_linear_gradient(&gradient.base.bounds,
|
paint_context.draw_linear_gradient(&gradient.base.bounds,
|
||||||
&gradient.start_point,
|
&gradient.start_point,
|
||||||
&gradient.end_point,
|
&gradient.end_point,
|
||||||
&gradient.stops);
|
&gradient.stops);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::LineClass(ref line) => {
|
DisplayItem::Line(ref line) => {
|
||||||
paint_context.draw_line(&line.base.bounds, line.color, line.style)
|
paint_context.draw_line(&line.base.bounds, line.color, line.style)
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::BoxShadowClass(ref box_shadow) => {
|
DisplayItem::BoxShadow(ref box_shadow) => {
|
||||||
paint_context.draw_box_shadow(&box_shadow.box_bounds,
|
paint_context.draw_box_shadow(&box_shadow.box_bounds,
|
||||||
&box_shadow.offset,
|
&box_shadow.offset,
|
||||||
box_shadow.color,
|
box_shadow.color,
|
||||||
|
@ -1359,13 +1359,13 @@ impl DisplayItem {
|
||||||
box_shadow.clip_mode);
|
box_shadow.clip_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
DisplayItem::LayeredItemClass(ref item) => item.item.draw_into_context(paint_context),
|
DisplayItem::LayeredItem(ref item) => item.item.draw_into_context(paint_context),
|
||||||
|
|
||||||
DisplayItem::IframeClass(..) => {}
|
DisplayItem::Iframe(..) => {}
|
||||||
|
|
||||||
DisplayItem::PushStackingContextClass(..) => {}
|
DisplayItem::PushStackingContext(..) => {}
|
||||||
|
|
||||||
DisplayItem::PopStackingContextClass(..) => {}
|
DisplayItem::PopStackingContext(..) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1384,18 +1384,18 @@ impl DisplayItem {
|
||||||
|
|
||||||
pub fn base(&self) -> &BaseDisplayItem {
|
pub fn base(&self) -> &BaseDisplayItem {
|
||||||
match *self {
|
match *self {
|
||||||
DisplayItem::SolidColorClass(ref solid_color) => &solid_color.base,
|
DisplayItem::SolidColor(ref solid_color) => &solid_color.base,
|
||||||
DisplayItem::TextClass(ref text) => &text.base,
|
DisplayItem::Text(ref text) => &text.base,
|
||||||
DisplayItem::ImageClass(ref image_item) => &image_item.base,
|
DisplayItem::Image(ref image_item) => &image_item.base,
|
||||||
DisplayItem::WebGLClass(ref webgl_item) => &webgl_item.base,
|
DisplayItem::WebGL(ref webgl_item) => &webgl_item.base,
|
||||||
DisplayItem::BorderClass(ref border) => &border.base,
|
DisplayItem::Border(ref border) => &border.base,
|
||||||
DisplayItem::GradientClass(ref gradient) => &gradient.base,
|
DisplayItem::Gradient(ref gradient) => &gradient.base,
|
||||||
DisplayItem::LineClass(ref line) => &line.base,
|
DisplayItem::Line(ref line) => &line.base,
|
||||||
DisplayItem::BoxShadowClass(ref box_shadow) => &box_shadow.base,
|
DisplayItem::BoxShadow(ref box_shadow) => &box_shadow.base,
|
||||||
DisplayItem::LayeredItemClass(ref layered_item) => layered_item.item.base(),
|
DisplayItem::LayeredItem(ref layered_item) => layered_item.item.base(),
|
||||||
DisplayItem::IframeClass(ref iframe) => &iframe.base,
|
DisplayItem::Iframe(ref iframe) => &iframe.base,
|
||||||
DisplayItem::PushStackingContextClass(ref stacking_context) => &stacking_context.base,
|
DisplayItem::PushStackingContext(ref stacking_context) => &stacking_context.base,
|
||||||
DisplayItem::PopStackingContextClass(ref item) => &item.base,
|
DisplayItem::PopStackingContext(ref item) => &item.base,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1438,7 +1438,7 @@ impl DisplayItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
match *self {
|
match *self {
|
||||||
DisplayItem::BorderClass(ref border) => {
|
DisplayItem::Border(ref border) => {
|
||||||
// If the point is inside the border, it didn't hit the border!
|
// If the point is inside the border, it didn't hit the border!
|
||||||
let interior_rect =
|
let interior_rect =
|
||||||
Rect::new(
|
Rect::new(
|
||||||
|
@ -1456,7 +1456,7 @@ impl DisplayItem {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DisplayItem::BoxShadowClass(_) => {
|
DisplayItem::BoxShadow(_) => {
|
||||||
// Box shadows can never be hit.
|
// Box shadows can never be hit.
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
@ -1469,34 +1469,34 @@ impl DisplayItem {
|
||||||
|
|
||||||
impl fmt::Debug for DisplayItem {
|
impl fmt::Debug for DisplayItem {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
if let DisplayItem::PushStackingContextClass(ref item) = *self {
|
if let DisplayItem::PushStackingContext(ref item) = *self {
|
||||||
return write!(f, "PushStackingContext({:?})", item.stacking_context);
|
return write!(f, "PushStackingContext({:?})", item.stacking_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let DisplayItem::PopStackingContextClass(ref item) = *self {
|
if let DisplayItem::PopStackingContext(ref item) = *self {
|
||||||
return write!(f, "PopStackingContext({:?}", item.stacking_context_id);
|
return write!(f, "PopStackingContext({:?}", item.stacking_context_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
write!(f, "{} @ {:?} {:?}",
|
write!(f, "{} @ {:?} {:?}",
|
||||||
match *self {
|
match *self {
|
||||||
DisplayItem::SolidColorClass(ref solid_color) =>
|
DisplayItem::SolidColor(ref solid_color) =>
|
||||||
format!("SolidColor rgba({}, {}, {}, {})",
|
format!("SolidColor rgba({}, {}, {}, {})",
|
||||||
solid_color.color.r,
|
solid_color.color.r,
|
||||||
solid_color.color.g,
|
solid_color.color.g,
|
||||||
solid_color.color.b,
|
solid_color.color.b,
|
||||||
solid_color.color.a),
|
solid_color.color.a),
|
||||||
DisplayItem::TextClass(_) => "Text".to_owned(),
|
DisplayItem::Text(_) => "Text".to_owned(),
|
||||||
DisplayItem::ImageClass(_) => "Image".to_owned(),
|
DisplayItem::Image(_) => "Image".to_owned(),
|
||||||
DisplayItem::WebGLClass(_) => "WebGL".to_owned(),
|
DisplayItem::WebGL(_) => "WebGL".to_owned(),
|
||||||
DisplayItem::BorderClass(_) => "Border".to_owned(),
|
DisplayItem::Border(_) => "Border".to_owned(),
|
||||||
DisplayItem::GradientClass(_) => "Gradient".to_owned(),
|
DisplayItem::Gradient(_) => "Gradient".to_owned(),
|
||||||
DisplayItem::LineClass(_) => "Line".to_owned(),
|
DisplayItem::Line(_) => "Line".to_owned(),
|
||||||
DisplayItem::BoxShadowClass(_) => "BoxShadow".to_owned(),
|
DisplayItem::BoxShadow(_) => "BoxShadow".to_owned(),
|
||||||
DisplayItem::LayeredItemClass(ref layered_item) =>
|
DisplayItem::LayeredItem(ref layered_item) =>
|
||||||
format!("LayeredItem({:?})", layered_item.item),
|
format!("LayeredItem({:?})", layered_item.item),
|
||||||
DisplayItem::IframeClass(_) => "Iframe".to_owned(),
|
DisplayItem::Iframe(_) => "Iframe".to_owned(),
|
||||||
DisplayItem::PushStackingContextClass(_) => "".to_owned(),
|
DisplayItem::PushStackingContext(_) => "".to_owned(),
|
||||||
DisplayItem::PopStackingContextClass(_) => "".to_owned(),
|
DisplayItem::PopStackingContext(_) => "".to_owned(),
|
||||||
},
|
},
|
||||||
self.bounds(),
|
self.bounds(),
|
||||||
self.base().clip
|
self.base().clip
|
||||||
|
|
|
@ -400,7 +400,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(
|
state.add_display_item(
|
||||||
DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
color: background_color.to_gfx_color(),
|
color: background_color.to_gfx_color(),
|
||||||
}));
|
}));
|
||||||
|
@ -635,7 +635,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(DisplayItem::ImageClass(box ImageDisplayItem {
|
state.add_display_item(DisplayItem::Image(box ImageDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
webrender_image: webrender_image,
|
webrender_image: webrender_image,
|
||||||
image_data: None,
|
image_data: None,
|
||||||
|
@ -774,7 +774,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
let gradient_display_item = DisplayItem::GradientClass(box GradientDisplayItem {
|
let gradient_display_item = DisplayItem::Gradient(box GradientDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
start_point: center - delta,
|
start_point: center - delta,
|
||||||
end_point: center + delta,
|
end_point: center + delta,
|
||||||
|
@ -804,7 +804,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem {
|
state.add_display_item(DisplayItem::BoxShadow(box BoxShadowDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
box_bounds: *absolute_bounds,
|
box_bounds: *absolute_bounds,
|
||||||
color: style.resolve_color(box_shadow.color).to_gfx_color(),
|
color: style.resolve_color(box_shadow.color).to_gfx_color(),
|
||||||
|
@ -876,7 +876,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
border_widths: border.to_physical(style.writing_mode),
|
border_widths: border.to_physical(style.writing_mode),
|
||||||
color: SideOffsets2D::new(colors.top.to_gfx_color(),
|
color: SideOffsets2D::new(colors.top.to_gfx_color(),
|
||||||
|
@ -919,7 +919,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Outlines);
|
DisplayListSection::Outlines);
|
||||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
border_widths: SideOffsets2D::new_all_same(width),
|
border_widths: SideOffsets2D::new_all_same(width),
|
||||||
color: SideOffsets2D::new_all_same(color),
|
color: SideOffsets2D::new_all_same(color),
|
||||||
|
@ -944,7 +944,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
||||||
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
||||||
|
@ -965,7 +965,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
style.get_cursor(Cursor::Default),
|
style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::LineClass(box LineDisplayItem {
|
state.add_display_item(DisplayItem::Line(box LineDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
color: color::rgb(0, 200, 0),
|
color: color::rgb(0, 200, 0),
|
||||||
style: border_style::T::dashed,
|
style: border_style::T::dashed,
|
||||||
|
@ -982,7 +982,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style.get_cursor(Cursor::Default),
|
self.style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
||||||
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
||||||
|
@ -1034,7 +1034,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.style.get_cursor(Cursor::Default),
|
self.style.get_cursor(Cursor::Default),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(
|
state.add_display_item(
|
||||||
DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
color: background_color.to_gfx_color(),
|
color: background_color.to_gfx_color(),
|
||||||
}));
|
}));
|
||||||
|
@ -1072,7 +1072,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style.get_cursor(cursor),
|
self.style.get_cursor(cursor),
|
||||||
display_list_section);
|
display_list_section);
|
||||||
state.add_display_item(DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
state.add_display_item(DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
color: self.style().get_color().color.to_gfx_color(),
|
color: self.style().get_color().color.to_gfx_color(),
|
||||||
}));
|
}));
|
||||||
|
@ -1261,7 +1261,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style.get_cursor(Cursor::Default),
|
self.style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
let item = DisplayItem::IframeClass(box IframeDisplayItem {
|
let item = DisplayItem::Iframe(box IframeDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
iframe: fragment_info.pipeline_id,
|
iframe: fragment_info.pipeline_id,
|
||||||
});
|
});
|
||||||
|
@ -1278,7 +1278,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style.get_cursor(Cursor::Default),
|
self.style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::ImageClass(box ImageDisplayItem {
|
state.add_display_item(DisplayItem::Image(box ImageDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
webrender_image: WebRenderImageInfo::from_image(image),
|
webrender_image: WebRenderImageInfo::from_image(image),
|
||||||
image_data: Some(Arc::new(image.bytes.clone())),
|
image_data: Some(Arc::new(image.bytes.clone())),
|
||||||
|
@ -1316,7 +1316,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
let display_item = match canvas_data {
|
let display_item = match canvas_data {
|
||||||
CanvasData::Pixels(canvas_data) => {
|
CanvasData::Pixels(canvas_data) => {
|
||||||
DisplayItem::ImageClass(box ImageDisplayItem {
|
DisplayItem::Image(box ImageDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
image_data: Some(Arc::new(canvas_data.image_data)),
|
image_data: Some(Arc::new(canvas_data.image_data)),
|
||||||
webrender_image: WebRenderImageInfo {
|
webrender_image: WebRenderImageInfo {
|
||||||
|
@ -1331,7 +1331,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
CanvasData::WebGL(context_id) => {
|
CanvasData::WebGL(context_id) => {
|
||||||
DisplayItem::WebGLClass(box WebGLDisplayItem {
|
DisplayItem::WebGL(box WebGLDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
context_id: context_id,
|
context_id: context_id,
|
||||||
})
|
})
|
||||||
|
@ -1560,7 +1560,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style().get_cursor(cursor),
|
self.style().get_cursor(cursor),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::TextClass(box TextDisplayItem {
|
state.add_display_item(DisplayItem::Text(box TextDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
text_run: text_fragment.run.clone(),
|
text_run: text_fragment.run.clone(),
|
||||||
range: text_fragment.range,
|
range: text_fragment.range,
|
||||||
|
@ -1638,7 +1638,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
||||||
self.node,
|
self.node,
|
||||||
self.style.get_cursor(Cursor::Default),
|
self.style.get_cursor(Cursor::Default),
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem {
|
state.add_display_item(DisplayItem::BoxShadow(box BoxShadowDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
box_bounds: stacking_relative_box,
|
box_bounds: stacking_relative_box,
|
||||||
color: color.to_gfx_color(),
|
color: color.to_gfx_color(),
|
||||||
|
@ -2054,7 +2054,7 @@ impl BaseFlowDisplayListBuilding for BaseFlow {
|
||||||
node,
|
node,
|
||||||
None,
|
None,
|
||||||
DisplayListSection::Content);
|
DisplayListSection::Content);
|
||||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||||
base: base,
|
base: base,
|
||||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(2)),
|
border_widths: SideOffsets2D::new_all_same(Au::from_px(2)),
|
||||||
color: SideOffsets2D::new_all_same(color),
|
color: SideOffsets2D::new_all_same(color),
|
||||||
|
|
|
@ -262,7 +262,7 @@ impl WebRenderStackingContextConverter for StackingContext {
|
||||||
_force_positioned_stacking_level: bool) {
|
_force_positioned_stacking_level: bool) {
|
||||||
while let Some(item) = traversal.next() {
|
while let Some(item) = traversal.next() {
|
||||||
match item {
|
match item {
|
||||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||||
let stacking_context = &stacking_context_item.stacking_context;
|
let stacking_context = &stacking_context_item.stacking_context;
|
||||||
debug_assert!(stacking_context.context_type == StackingContextType::Real);
|
debug_assert!(stacking_context.context_type == StackingContextType::Real);
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ impl WebRenderStackingContextConverter for StackingContext {
|
||||||
builder.push_stacking_context(stacking_context_id);
|
builder.push_stacking_context(stacking_context_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
&DisplayItem::PopStackingContextClass(_) => return,
|
&DisplayItem::PopStackingContext(_) => return,
|
||||||
_ => item.convert_to_webrender(builder, frame_builder),
|
_ => item.convert_to_webrender(builder, frame_builder),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -354,7 +354,7 @@ impl WebRenderDisplayListConverter for DisplayList {
|
||||||
let mut traversal = DisplayListTraversal::new(self);
|
let mut traversal = DisplayListTraversal::new(self);
|
||||||
let item = traversal.next();
|
let item = traversal.next();
|
||||||
match item {
|
match item {
|
||||||
Some(&DisplayItem::PushStackingContextClass(ref stacking_context_item)) => {
|
Some(&DisplayItem::PushStackingContext(ref stacking_context_item)) => {
|
||||||
let stacking_context = &stacking_context_item.stacking_context;
|
let stacking_context = &stacking_context_item.stacking_context;
|
||||||
stacking_context.convert_to_webrender(&mut traversal,
|
stacking_context.convert_to_webrender(&mut traversal,
|
||||||
api,
|
api,
|
||||||
|
@ -375,7 +375,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
builder: &mut webrender_traits::DisplayListBuilder,
|
builder: &mut webrender_traits::DisplayListBuilder,
|
||||||
frame_builder: &mut WebRenderFrameBuilder) {
|
frame_builder: &mut WebRenderFrameBuilder) {
|
||||||
match *self {
|
match *self {
|
||||||
DisplayItem::SolidColorClass(ref item) => {
|
DisplayItem::SolidColor(ref item) => {
|
||||||
let color = item.color.to_colorf();
|
let color = item.color.to_colorf();
|
||||||
if color.a > 0.0 {
|
if color.a > 0.0 {
|
||||||
builder.push_rect(item.base.bounds.to_rectf(),
|
builder.push_rect(item.base.bounds.to_rectf(),
|
||||||
|
@ -383,7 +383,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
color);
|
color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DisplayItem::TextClass(ref item) => {
|
DisplayItem::Text(ref item) => {
|
||||||
let mut origin = item.baseline_origin.clone();
|
let mut origin = item.baseline_origin.clone();
|
||||||
let mut glyphs = vec!();
|
let mut glyphs = vec!();
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
&mut frame_builder.auxiliary_lists_builder);
|
&mut frame_builder.auxiliary_lists_builder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DisplayItem::ImageClass(ref item) => {
|
DisplayItem::Image(ref item) => {
|
||||||
if let Some(id) = item.webrender_image.key {
|
if let Some(id) = item.webrender_image.key {
|
||||||
if item.stretch_size.width > Au(0) &&
|
if item.stretch_size.width > Au(0) &&
|
||||||
item.stretch_size.height > Au(0) {
|
item.stretch_size.height > Au(0) {
|
||||||
|
@ -431,12 +431,12 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DisplayItem::WebGLClass(ref item) => {
|
DisplayItem::WebGL(ref item) => {
|
||||||
builder.push_webgl_canvas(item.base.bounds.to_rectf(),
|
builder.push_webgl_canvas(item.base.bounds.to_rectf(),
|
||||||
item.base.clip.to_clip_region(frame_builder),
|
item.base.clip.to_clip_region(frame_builder),
|
||||||
item.context_id);
|
item.context_id);
|
||||||
}
|
}
|
||||||
DisplayItem::BorderClass(ref item) => {
|
DisplayItem::Border(ref item) => {
|
||||||
let rect = item.base.bounds.to_rectf();
|
let rect = item.base.bounds.to_rectf();
|
||||||
let left = webrender_traits::BorderSide {
|
let left = webrender_traits::BorderSide {
|
||||||
width: item.border_widths.left.to_f32_px(),
|
width: item.border_widths.left.to_f32_px(),
|
||||||
|
@ -467,7 +467,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
bottom,
|
bottom,
|
||||||
radius);
|
radius);
|
||||||
}
|
}
|
||||||
DisplayItem::GradientClass(ref item) => {
|
DisplayItem::Gradient(ref item) => {
|
||||||
let rect = item.base.bounds.to_rectf();
|
let rect = item.base.bounds.to_rectf();
|
||||||
let start_point = item.start_point.to_pointf();
|
let start_point = item.start_point.to_pointf();
|
||||||
let end_point = item.end_point.to_pointf();
|
let end_point = item.end_point.to_pointf();
|
||||||
|
@ -482,13 +482,13 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
stops,
|
stops,
|
||||||
&mut frame_builder.auxiliary_lists_builder);
|
&mut frame_builder.auxiliary_lists_builder);
|
||||||
}
|
}
|
||||||
DisplayItem::LineClass(..) => {
|
DisplayItem::Line(..) => {
|
||||||
println!("TODO DisplayItem::LineClass");
|
println!("TODO DisplayItem::Line");
|
||||||
}
|
}
|
||||||
DisplayItem::LayeredItemClass(..) => {
|
DisplayItem::LayeredItem(..) => {
|
||||||
panic!("Unexpected in webrender!");
|
panic!("Unexpected in webrender!");
|
||||||
}
|
}
|
||||||
DisplayItem::BoxShadowClass(ref item) => {
|
DisplayItem::BoxShadow(ref item) => {
|
||||||
let rect = item.base.bounds.to_rectf();
|
let rect = item.base.bounds.to_rectf();
|
||||||
let box_bounds = item.box_bounds.to_rectf();
|
let box_bounds = item.box_bounds.to_rectf();
|
||||||
builder.push_box_shadow(rect,
|
builder.push_box_shadow(rect,
|
||||||
|
@ -501,14 +501,14 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
item.border_radius.to_f32_px(),
|
item.border_radius.to_f32_px(),
|
||||||
item.clip_mode.to_clip_mode());
|
item.clip_mode.to_clip_mode());
|
||||||
}
|
}
|
||||||
DisplayItem::IframeClass(ref item) => {
|
DisplayItem::Iframe(ref item) => {
|
||||||
let rect = item.base.bounds.to_rectf();
|
let rect = item.base.bounds.to_rectf();
|
||||||
let pipeline_id = item.iframe.to_webrender();
|
let pipeline_id = item.iframe.to_webrender();
|
||||||
builder.push_iframe(rect,
|
builder.push_iframe(rect,
|
||||||
item.base.clip.to_clip_region(frame_builder),
|
item.base.clip.to_clip_region(frame_builder),
|
||||||
pipeline_id);
|
pipeline_id);
|
||||||
}
|
}
|
||||||
DisplayItem::PushStackingContextClass(_) | DisplayItem::PopStackingContextClass(_) => {}
|
DisplayItem::PushStackingContext(_) | DisplayItem::PopStackingContext(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue