aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2019-09-06 16:59:11 +0200
committerSimon Sapin <simon.sapin@exyr.org>2019-09-06 16:59:11 +0200
commit526619a78aa88944e917ab97c0f969eceea3ebc7 (patch)
tree4423876441962fe4acaba2600c5b6c8b54873c15 /components
parente852d02f1c02b42b5eb5b0ee592d5128f1232458 (diff)
downloadservo-526619a78aa88944e917ab97c0f969eceea3ebc7.tar.gz
servo-526619a78aa88944e917ab97c0f969eceea3ebc7.zip
Replace the WebRenderDisplayItemConverter trait with an inherent method
Diffstat (limited to 'components')
-rw-r--r--components/layout/display_list/mod.rs1
-rw-r--r--components/layout/display_list/webrender_helpers.rs19
-rw-r--r--components/layout_2020/display_list/mod.rs2
-rw-r--r--components/layout_2020/display_list/webrender_helpers.rs8
-rw-r--r--components/layout_thread/lib.rs2
-rw-r--r--components/layout_thread_2020/lib.rs1
6 files changed, 6 insertions, 27 deletions
diff --git a/components/layout/display_list/mod.rs b/components/layout/display_list/mod.rs
index 302728fbf22..257d9eb6ddc 100644
--- a/components/layout/display_list/mod.rs
+++ b/components/layout/display_list/mod.rs
@@ -8,7 +8,6 @@ pub use self::builder::IndexableText;
pub use self::builder::StackingContextCollectionFlags;
pub use self::builder::StackingContextCollectionState;
pub use self::conversions::ToLayout;
-pub use self::webrender_helpers::WebRenderDisplayListConverter;
mod background;
mod border;
diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs
index a27979a3189..64333f41977 100644
--- a/components/layout/display_list/webrender_helpers.rs
+++ b/components/layout/display_list/webrender_helpers.rs
@@ -17,10 +17,6 @@ use webrender_api::{
RasterSpace, ReferenceFrameKind, SpaceAndClipInfo, SpatialId, StackingContext,
};
-pub trait WebRenderDisplayListConverter {
- fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder;
-}
-
struct ClipScrollState {
clip_ids: Vec<Option<ClipId>>,
spatial_ids: Vec<Option<SpatialId>>,
@@ -28,17 +24,8 @@ struct ClipScrollState {
active_spatial_id: SpatialId,
}
-trait WebRenderDisplayItemConverter {
- fn convert_to_webrender(
- &mut self,
- clip_scroll_nodes: &[ClipScrollNode],
- state: &mut ClipScrollState,
- builder: &mut DisplayListBuilder,
- );
-}
-
-impl WebRenderDisplayListConverter for DisplayList {
- fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder {
+impl DisplayList {
+ pub fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder {
let mut clip_ids = vec![None; self.clip_scroll_nodes.len()];
let mut spatial_ids = vec![None; self.clip_scroll_nodes.len()];
@@ -75,7 +62,7 @@ impl WebRenderDisplayListConverter for DisplayList {
}
}
-impl WebRenderDisplayItemConverter for DisplayItem {
+impl DisplayItem {
fn convert_to_webrender(
&mut self,
clip_scroll_nodes: &[ClipScrollNode],
diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs
index dcdab26adb8..88afb0ed6a6 100644
--- a/components/layout_2020/display_list/mod.rs
+++ b/components/layout_2020/display_list/mod.rs
@@ -2,7 +2,5 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
-pub use self::webrender_helpers::WebRenderDisplayListConverter;
-
pub mod items;
mod webrender_helpers;
diff --git a/components/layout_2020/display_list/webrender_helpers.rs b/components/layout_2020/display_list/webrender_helpers.rs
index 23ca4138e3e..c93bc05d269 100644
--- a/components/layout_2020/display_list/webrender_helpers.rs
+++ b/components/layout_2020/display_list/webrender_helpers.rs
@@ -7,12 +7,8 @@ use msg::constellation_msg::PipelineId;
use webrender_api::units::LayoutSize;
use webrender_api::{self, DisplayListBuilder};
-pub trait WebRenderDisplayListConverter {
- fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder;
-}
-
-impl WebRenderDisplayListConverter for DisplayList {
- fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder {
+impl DisplayList {
+ pub fn convert_to_webrender(&mut self, pipeline_id: PipelineId) -> DisplayListBuilder {
let webrender_pipeline = pipeline_id.to_webrender();
let builder = DisplayListBuilder::with_capacity(
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index 887c31f4657..5f65adcc245 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -45,7 +45,7 @@ use layout::context::LayoutContext;
use layout::context::RegisteredPainter;
use layout::context::RegisteredPainters;
use layout::display_list::items::{OpaqueNode, WebRenderImageInfo};
-use layout::display_list::{IndexableText, ToLayout, WebRenderDisplayListConverter};
+use layout::display_list::{IndexableText, ToLayout};
use layout::flow::{Flow, GetBaseFlow, ImmutableFlowUtils, MutableOwnedFlowUtils};
use layout::flow_ref::FlowRef;
use layout::incremental::{RelayoutMode, SpecialRestyleDamage};
diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs
index 82919fa75c1..6db5e2e8681 100644
--- a/components/layout_thread_2020/lib.rs
+++ b/components/layout_thread_2020/lib.rs
@@ -38,7 +38,6 @@ use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use layout::context::LayoutContext;
use layout::display_list::items::DisplayList;
-use layout::display_list::WebRenderDisplayListConverter;
use layout::query::{
process_content_box_request, process_content_boxes_request, LayoutRPCImpl, LayoutThreadData,
};