mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #13810 - mrobinson:names, r=Ms2ger
Remove Class from DisplayItem enum names <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because this PR does not change behavior. It's only a rename. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> 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. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13810) <!-- Reviewable:end -->
This commit is contained in:
commit
275278be44
3 changed files with 95 additions and 95 deletions
|
@ -128,7 +128,7 @@ impl DisplayList {
|
|||
let stacking_context_id = stacking_context.id;
|
||||
let real_stacking_context = stacking_context.context_type == StackingContextType::Real;
|
||||
if real_stacking_context {
|
||||
list.push(DisplayItem::PushStackingContextClass(Box::new(PushStackingContextItem {
|
||||
list.push(DisplayItem::PushStackingContext(Box::new(PushStackingContextItem {
|
||||
base: BaseDisplayItem::empty(),
|
||||
stacking_context: stacking_context,
|
||||
})));
|
||||
|
@ -176,7 +176,7 @@ impl DisplayList {
|
|||
list.extend(child_items);
|
||||
|
||||
if real_stacking_context {
|
||||
list.push(DisplayItem::PopStackingContextClass(Box::new(
|
||||
list.push(DisplayItem::PopStackingContext(Box::new(
|
||||
PopStackingContextItem {
|
||||
base: BaseDisplayItem::empty(),
|
||||
stacking_context_id: stacking_context_id,
|
||||
|
@ -225,7 +225,7 @@ impl DisplayList {
|
|||
tile_rect: Option<Rect<Au>>) {
|
||||
while let Some(item) = traversal.next() {
|
||||
match item {
|
||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
||||
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||
let context = &stacking_context_item.stacking_context;
|
||||
if context.intersects_rect_in_parent_context(tile_rect) {
|
||||
self.draw_stacking_context(traversal,
|
||||
|
@ -237,7 +237,7 @@ impl DisplayList {
|
|||
traversal.skip_to_end_of_stacking_context(context.id);
|
||||
}
|
||||
}
|
||||
&DisplayItem::PopStackingContextClass(_) => return,
|
||||
&DisplayItem::PopStackingContext(_) => return,
|
||||
_ => {
|
||||
if item.intersects_rect_in_parent_context(tile_rect) {
|
||||
item.draw_into_context(paint_context);
|
||||
|
@ -360,7 +360,7 @@ impl DisplayList {
|
|||
result: &mut Vec<DisplayItemMetadata>) {
|
||||
while let Some(item) = traversal.next() {
|
||||
match item {
|
||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
||||
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||
self.hit_test_stacking_context(traversal,
|
||||
&stacking_context_item.stacking_context,
|
||||
translated_point,
|
||||
|
@ -368,7 +368,7 @@ impl DisplayList {
|
|||
scroll_offsets,
|
||||
result);
|
||||
}
|
||||
&DisplayItem::PopStackingContextClass(_) => return,
|
||||
&DisplayItem::PopStackingContext(_) => return,
|
||||
_ => {
|
||||
if let Some(meta) = item.hit_test(*translated_point) {
|
||||
result.push(meta);
|
||||
|
@ -461,7 +461,7 @@ impl<'a> DisplayListTraversal<'a> {
|
|||
|
||||
let stacking_context_start = display_list.list[0..start].iter().rposition(|item|
|
||||
match item {
|
||||
&DisplayItem::PushStackingContextClass(ref item) =>
|
||||
&DisplayItem::PushStackingContext(ref item) =>
|
||||
item.stacking_context.id == stacking_context_id,
|
||||
_ => false,
|
||||
}).unwrap_or(start);
|
||||
|
@ -483,7 +483,7 @@ impl<'a> DisplayListTraversal<'a> {
|
|||
self.next_item_index = self.display_list.list[self.next_item_index..].iter()
|
||||
.position(|item| {
|
||||
match item {
|
||||
&DisplayItem::PopStackingContextClass(ref item) => item.stacking_context_id == id,
|
||||
&DisplayItem::PopStackingContext(ref item) => item.stacking_context_id == id,
|
||||
_ => false
|
||||
}
|
||||
}).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
|
||||
// slice that is relative to a certain stacking context.
|
||||
match item {
|
||||
&DisplayItem::PushStackingContextClass(_) |
|
||||
&DisplayItem::PopStackingContextClass(_) => return Some(item),
|
||||
&DisplayItem::PushStackingContext(_) |
|
||||
&DisplayItem::PopStackingContext(_) => return Some(item),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
@ -758,18 +758,18 @@ impl fmt::Debug for StackingContext {
|
|||
/// One drawing command in the list.
|
||||
#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
|
||||
pub enum DisplayItem {
|
||||
SolidColorClass(Box<SolidColorDisplayItem>),
|
||||
TextClass(Box<TextDisplayItem>),
|
||||
ImageClass(Box<ImageDisplayItem>),
|
||||
WebGLClass(Box<WebGLDisplayItem>),
|
||||
BorderClass(Box<BorderDisplayItem>),
|
||||
GradientClass(Box<GradientDisplayItem>),
|
||||
LineClass(Box<LineDisplayItem>),
|
||||
BoxShadowClass(Box<BoxShadowDisplayItem>),
|
||||
LayeredItemClass(Box<LayeredItem>),
|
||||
IframeClass(Box<IframeDisplayItem>),
|
||||
PushStackingContextClass(Box<PushStackingContextItem>),
|
||||
PopStackingContextClass(Box<PopStackingContextItem>),
|
||||
SolidColor(Box<SolidColorDisplayItem>),
|
||||
Text(Box<TextDisplayItem>),
|
||||
Image(Box<ImageDisplayItem>),
|
||||
WebGL(Box<WebGLDisplayItem>),
|
||||
Border(Box<BorderDisplayItem>),
|
||||
Gradient(Box<GradientDisplayItem>),
|
||||
Line(Box<LineDisplayItem>),
|
||||
BoxShadow(Box<BoxShadowDisplayItem>),
|
||||
LayeredItem(Box<LayeredItem>),
|
||||
Iframe(Box<IframeDisplayItem>),
|
||||
PushStackingContext(Box<PushStackingContextItem>),
|
||||
PopStackingContext(Box<PopStackingContextItem>),
|
||||
}
|
||||
|
||||
/// Information common to all display items.
|
||||
|
@ -1303,18 +1303,18 @@ impl DisplayItem {
|
|||
}
|
||||
|
||||
match *self {
|
||||
DisplayItem::SolidColorClass(ref solid_color) => {
|
||||
DisplayItem::SolidColor(ref solid_color) => {
|
||||
if !solid_color.color.a.approx_eq(&0.0) {
|
||||
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);
|
||||
paint_context.draw_text(&**text);
|
||||
}
|
||||
|
||||
DisplayItem::ImageClass(ref image_item) => {
|
||||
DisplayItem::Image(ref image_item) => {
|
||||
debug!("Drawing image at {:?}.", image_item.base.bounds);
|
||||
paint_context.draw_image(
|
||||
&image_item.base.bounds,
|
||||
|
@ -1327,11 +1327,11 @@ impl DisplayItem {
|
|||
image_item.image_rendering.clone());
|
||||
}
|
||||
|
||||
DisplayItem::WebGLClass(_) => {
|
||||
DisplayItem::WebGL(_) => {
|
||||
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,
|
||||
&border.border_widths,
|
||||
&border.radius,
|
||||
|
@ -1339,18 +1339,18 @@ impl DisplayItem {
|
|||
&border.style)
|
||||
}
|
||||
|
||||
DisplayItem::GradientClass(ref gradient) => {
|
||||
DisplayItem::Gradient(ref gradient) => {
|
||||
paint_context.draw_linear_gradient(&gradient.base.bounds,
|
||||
&gradient.start_point,
|
||||
&gradient.end_point,
|
||||
&gradient.stops);
|
||||
}
|
||||
|
||||
DisplayItem::LineClass(ref line) => {
|
||||
DisplayItem::Line(ref line) => {
|
||||
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,
|
||||
&box_shadow.offset,
|
||||
box_shadow.color,
|
||||
|
@ -1359,13 +1359,13 @@ impl DisplayItem {
|
|||
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 {
|
||||
match *self {
|
||||
DisplayItem::SolidColorClass(ref solid_color) => &solid_color.base,
|
||||
DisplayItem::TextClass(ref text) => &text.base,
|
||||
DisplayItem::ImageClass(ref image_item) => &image_item.base,
|
||||
DisplayItem::WebGLClass(ref webgl_item) => &webgl_item.base,
|
||||
DisplayItem::BorderClass(ref border) => &border.base,
|
||||
DisplayItem::GradientClass(ref gradient) => &gradient.base,
|
||||
DisplayItem::LineClass(ref line) => &line.base,
|
||||
DisplayItem::BoxShadowClass(ref box_shadow) => &box_shadow.base,
|
||||
DisplayItem::LayeredItemClass(ref layered_item) => layered_item.item.base(),
|
||||
DisplayItem::IframeClass(ref iframe) => &iframe.base,
|
||||
DisplayItem::PushStackingContextClass(ref stacking_context) => &stacking_context.base,
|
||||
DisplayItem::PopStackingContextClass(ref item) => &item.base,
|
||||
DisplayItem::SolidColor(ref solid_color) => &solid_color.base,
|
||||
DisplayItem::Text(ref text) => &text.base,
|
||||
DisplayItem::Image(ref image_item) => &image_item.base,
|
||||
DisplayItem::WebGL(ref webgl_item) => &webgl_item.base,
|
||||
DisplayItem::Border(ref border) => &border.base,
|
||||
DisplayItem::Gradient(ref gradient) => &gradient.base,
|
||||
DisplayItem::Line(ref line) => &line.base,
|
||||
DisplayItem::BoxShadow(ref box_shadow) => &box_shadow.base,
|
||||
DisplayItem::LayeredItem(ref layered_item) => layered_item.item.base(),
|
||||
DisplayItem::Iframe(ref iframe) => &iframe.base,
|
||||
DisplayItem::PushStackingContext(ref stacking_context) => &stacking_context.base,
|
||||
DisplayItem::PopStackingContext(ref item) => &item.base,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ impl DisplayItem {
|
|||
}
|
||||
|
||||
match *self {
|
||||
DisplayItem::BorderClass(ref border) => {
|
||||
DisplayItem::Border(ref border) => {
|
||||
// If the point is inside the border, it didn't hit the border!
|
||||
let interior_rect =
|
||||
Rect::new(
|
||||
|
@ -1456,7 +1456,7 @@ impl DisplayItem {
|
|||
return None;
|
||||
}
|
||||
}
|
||||
DisplayItem::BoxShadowClass(_) => {
|
||||
DisplayItem::BoxShadow(_) => {
|
||||
// Box shadows can never be hit.
|
||||
return None;
|
||||
}
|
||||
|
@ -1469,34 +1469,34 @@ impl DisplayItem {
|
|||
|
||||
impl fmt::Debug for DisplayItem {
|
||||
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);
|
||||
}
|
||||
|
||||
if let DisplayItem::PopStackingContextClass(ref item) = *self {
|
||||
if let DisplayItem::PopStackingContext(ref item) = *self {
|
||||
return write!(f, "PopStackingContext({:?}", item.stacking_context_id);
|
||||
}
|
||||
|
||||
write!(f, "{} @ {:?} {:?}",
|
||||
match *self {
|
||||
DisplayItem::SolidColorClass(ref solid_color) =>
|
||||
DisplayItem::SolidColor(ref solid_color) =>
|
||||
format!("SolidColor rgba({}, {}, {}, {})",
|
||||
solid_color.color.r,
|
||||
solid_color.color.g,
|
||||
solid_color.color.b,
|
||||
solid_color.color.a),
|
||||
DisplayItem::TextClass(_) => "Text".to_owned(),
|
||||
DisplayItem::ImageClass(_) => "Image".to_owned(),
|
||||
DisplayItem::WebGLClass(_) => "WebGL".to_owned(),
|
||||
DisplayItem::BorderClass(_) => "Border".to_owned(),
|
||||
DisplayItem::GradientClass(_) => "Gradient".to_owned(),
|
||||
DisplayItem::LineClass(_) => "Line".to_owned(),
|
||||
DisplayItem::BoxShadowClass(_) => "BoxShadow".to_owned(),
|
||||
DisplayItem::LayeredItemClass(ref layered_item) =>
|
||||
DisplayItem::Text(_) => "Text".to_owned(),
|
||||
DisplayItem::Image(_) => "Image".to_owned(),
|
||||
DisplayItem::WebGL(_) => "WebGL".to_owned(),
|
||||
DisplayItem::Border(_) => "Border".to_owned(),
|
||||
DisplayItem::Gradient(_) => "Gradient".to_owned(),
|
||||
DisplayItem::Line(_) => "Line".to_owned(),
|
||||
DisplayItem::BoxShadow(_) => "BoxShadow".to_owned(),
|
||||
DisplayItem::LayeredItem(ref layered_item) =>
|
||||
format!("LayeredItem({:?})", layered_item.item),
|
||||
DisplayItem::IframeClass(_) => "Iframe".to_owned(),
|
||||
DisplayItem::PushStackingContextClass(_) => "".to_owned(),
|
||||
DisplayItem::PopStackingContextClass(_) => "".to_owned(),
|
||||
DisplayItem::Iframe(_) => "Iframe".to_owned(),
|
||||
DisplayItem::PushStackingContext(_) => "".to_owned(),
|
||||
DisplayItem::PopStackingContext(_) => "".to_owned(),
|
||||
},
|
||||
self.bounds(),
|
||||
self.base().clip
|
||||
|
|
|
@ -400,7 +400,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
state.add_display_item(
|
||||
DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
||||
DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||
base: base,
|
||||
color: background_color.to_gfx_color(),
|
||||
}));
|
||||
|
@ -635,7 +635,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
state.add_display_item(DisplayItem::ImageClass(box ImageDisplayItem {
|
||||
state.add_display_item(DisplayItem::Image(box ImageDisplayItem {
|
||||
base: base,
|
||||
webrender_image: webrender_image,
|
||||
image_data: None,
|
||||
|
@ -774,7 +774,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
let gradient_display_item = DisplayItem::GradientClass(box GradientDisplayItem {
|
||||
let gradient_display_item = DisplayItem::Gradient(box GradientDisplayItem {
|
||||
base: base,
|
||||
start_point: center - delta,
|
||||
end_point: center + delta,
|
||||
|
@ -804,7 +804,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
state.add_display_item(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem {
|
||||
state.add_display_item(DisplayItem::BoxShadow(box BoxShadowDisplayItem {
|
||||
base: base,
|
||||
box_bounds: *absolute_bounds,
|
||||
color: style.resolve_color(box_shadow.color).to_gfx_color(),
|
||||
|
@ -876,7 +876,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: border.to_physical(style.writing_mode),
|
||||
color: SideOffsets2D::new(colors.top.to_gfx_color(),
|
||||
|
@ -919,7 +919,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Outlines);
|
||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: SideOffsets2D::new_all_same(width),
|
||||
color: SideOffsets2D::new_all_same(color),
|
||||
|
@ -944,7 +944,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
||||
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
||||
|
@ -965,7 +965,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::LineClass(box LineDisplayItem {
|
||||
state.add_display_item(DisplayItem::Line(box LineDisplayItem {
|
||||
base: base,
|
||||
color: color::rgb(0, 200, 0),
|
||||
style: border_style::T::dashed,
|
||||
|
@ -982,7 +982,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(1)),
|
||||
color: SideOffsets2D::new_all_same(color::rgb(0, 0, 200)),
|
||||
|
@ -1034,7 +1034,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.style.get_cursor(Cursor::Default),
|
||||
display_list_section);
|
||||
state.add_display_item(
|
||||
DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
||||
DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||
base: base,
|
||||
color: background_color.to_gfx_color(),
|
||||
}));
|
||||
|
@ -1072,7 +1072,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style.get_cursor(cursor),
|
||||
display_list_section);
|
||||
state.add_display_item(DisplayItem::SolidColorClass(box SolidColorDisplayItem {
|
||||
state.add_display_item(DisplayItem::SolidColor(box SolidColorDisplayItem {
|
||||
base: base,
|
||||
color: self.style().get_color().color.to_gfx_color(),
|
||||
}));
|
||||
|
@ -1261,7 +1261,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
let item = DisplayItem::IframeClass(box IframeDisplayItem {
|
||||
let item = DisplayItem::Iframe(box IframeDisplayItem {
|
||||
base: base,
|
||||
iframe: fragment_info.pipeline_id,
|
||||
});
|
||||
|
@ -1278,7 +1278,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::ImageClass(box ImageDisplayItem {
|
||||
state.add_display_item(DisplayItem::Image(box ImageDisplayItem {
|
||||
base: base,
|
||||
webrender_image: WebRenderImageInfo::from_image(image),
|
||||
image_data: Some(Arc::new(image.bytes.clone())),
|
||||
|
@ -1316,7 +1316,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
DisplayListSection::Content);
|
||||
let display_item = match canvas_data {
|
||||
CanvasData::Pixels(canvas_data) => {
|
||||
DisplayItem::ImageClass(box ImageDisplayItem {
|
||||
DisplayItem::Image(box ImageDisplayItem {
|
||||
base: base,
|
||||
image_data: Some(Arc::new(canvas_data.image_data)),
|
||||
webrender_image: WebRenderImageInfo {
|
||||
|
@ -1331,7 +1331,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
})
|
||||
}
|
||||
CanvasData::WebGL(context_id) => {
|
||||
DisplayItem::WebGLClass(box WebGLDisplayItem {
|
||||
DisplayItem::WebGL(box WebGLDisplayItem {
|
||||
base: base,
|
||||
context_id: context_id,
|
||||
})
|
||||
|
@ -1560,7 +1560,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style().get_cursor(cursor),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::TextClass(box TextDisplayItem {
|
||||
state.add_display_item(DisplayItem::Text(box TextDisplayItem {
|
||||
base: base,
|
||||
text_run: text_fragment.run.clone(),
|
||||
range: text_fragment.range,
|
||||
|
@ -1638,7 +1638,7 @@ impl FragmentDisplayListBuilding for Fragment {
|
|||
self.node,
|
||||
self.style.get_cursor(Cursor::Default),
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::BoxShadowClass(box BoxShadowDisplayItem {
|
||||
state.add_display_item(DisplayItem::BoxShadow(box BoxShadowDisplayItem {
|
||||
base: base,
|
||||
box_bounds: stacking_relative_box,
|
||||
color: color.to_gfx_color(),
|
||||
|
@ -2054,7 +2054,7 @@ impl BaseFlowDisplayListBuilding for BaseFlow {
|
|||
node,
|
||||
None,
|
||||
DisplayListSection::Content);
|
||||
state.add_display_item(DisplayItem::BorderClass(box BorderDisplayItem {
|
||||
state.add_display_item(DisplayItem::Border(box BorderDisplayItem {
|
||||
base: base,
|
||||
border_widths: SideOffsets2D::new_all_same(Au::from_px(2)),
|
||||
color: SideOffsets2D::new_all_same(color),
|
||||
|
|
|
@ -262,7 +262,7 @@ impl WebRenderStackingContextConverter for StackingContext {
|
|||
_force_positioned_stacking_level: bool) {
|
||||
while let Some(item) = traversal.next() {
|
||||
match item {
|
||||
&DisplayItem::PushStackingContextClass(ref stacking_context_item) => {
|
||||
&DisplayItem::PushStackingContext(ref stacking_context_item) => {
|
||||
let stacking_context = &stacking_context_item.stacking_context;
|
||||
debug_assert!(stacking_context.context_type == StackingContextType::Real);
|
||||
|
||||
|
@ -283,7 +283,7 @@ impl WebRenderStackingContextConverter for StackingContext {
|
|||
builder.push_stacking_context(stacking_context_id);
|
||||
|
||||
}
|
||||
&DisplayItem::PopStackingContextClass(_) => return,
|
||||
&DisplayItem::PopStackingContext(_) => return,
|
||||
_ => item.convert_to_webrender(builder, frame_builder),
|
||||
}
|
||||
}
|
||||
|
@ -354,7 +354,7 @@ impl WebRenderDisplayListConverter for DisplayList {
|
|||
let mut traversal = DisplayListTraversal::new(self);
|
||||
let item = traversal.next();
|
||||
match item {
|
||||
Some(&DisplayItem::PushStackingContextClass(ref stacking_context_item)) => {
|
||||
Some(&DisplayItem::PushStackingContext(ref stacking_context_item)) => {
|
||||
let stacking_context = &stacking_context_item.stacking_context;
|
||||
stacking_context.convert_to_webrender(&mut traversal,
|
||||
api,
|
||||
|
@ -375,7 +375,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
builder: &mut webrender_traits::DisplayListBuilder,
|
||||
frame_builder: &mut WebRenderFrameBuilder) {
|
||||
match *self {
|
||||
DisplayItem::SolidColorClass(ref item) => {
|
||||
DisplayItem::SolidColor(ref item) => {
|
||||
let color = item.color.to_colorf();
|
||||
if color.a > 0.0 {
|
||||
builder.push_rect(item.base.bounds.to_rectf(),
|
||||
|
@ -383,7 +383,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
color);
|
||||
}
|
||||
}
|
||||
DisplayItem::TextClass(ref item) => {
|
||||
DisplayItem::Text(ref item) => {
|
||||
let mut origin = item.baseline_origin.clone();
|
||||
let mut glyphs = vec!();
|
||||
|
||||
|
@ -418,7 +418,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
&mut frame_builder.auxiliary_lists_builder);
|
||||
}
|
||||
}
|
||||
DisplayItem::ImageClass(ref item) => {
|
||||
DisplayItem::Image(ref item) => {
|
||||
if let Some(id) = item.webrender_image.key {
|
||||
if item.stretch_size.width > 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(),
|
||||
item.base.clip.to_clip_region(frame_builder),
|
||||
item.context_id);
|
||||
}
|
||||
DisplayItem::BorderClass(ref item) => {
|
||||
DisplayItem::Border(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let left = webrender_traits::BorderSide {
|
||||
width: item.border_widths.left.to_f32_px(),
|
||||
|
@ -467,7 +467,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
bottom,
|
||||
radius);
|
||||
}
|
||||
DisplayItem::GradientClass(ref item) => {
|
||||
DisplayItem::Gradient(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let start_point = item.start_point.to_pointf();
|
||||
let end_point = item.end_point.to_pointf();
|
||||
|
@ -482,13 +482,13 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
stops,
|
||||
&mut frame_builder.auxiliary_lists_builder);
|
||||
}
|
||||
DisplayItem::LineClass(..) => {
|
||||
println!("TODO DisplayItem::LineClass");
|
||||
DisplayItem::Line(..) => {
|
||||
println!("TODO DisplayItem::Line");
|
||||
}
|
||||
DisplayItem::LayeredItemClass(..) => {
|
||||
DisplayItem::LayeredItem(..) => {
|
||||
panic!("Unexpected in webrender!");
|
||||
}
|
||||
DisplayItem::BoxShadowClass(ref item) => {
|
||||
DisplayItem::BoxShadow(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let box_bounds = item.box_bounds.to_rectf();
|
||||
builder.push_box_shadow(rect,
|
||||
|
@ -501,14 +501,14 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
|||
item.border_radius.to_f32_px(),
|
||||
item.clip_mode.to_clip_mode());
|
||||
}
|
||||
DisplayItem::IframeClass(ref item) => {
|
||||
DisplayItem::Iframe(ref item) => {
|
||||
let rect = item.base.bounds.to_rectf();
|
||||
let pipeline_id = item.iframe.to_webrender();
|
||||
builder.push_iframe(rect,
|
||||
item.base.clip.to_clip_region(frame_builder),
|
||||
pipeline_id);
|
||||
}
|
||||
DisplayItem::PushStackingContextClass(_) | DisplayItem::PopStackingContextClass(_) => {}
|
||||
DisplayItem::PushStackingContext(_) | DisplayItem::PopStackingContext(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue