aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
authorMukilan Thiyagarajan <mukilan@igalia.com>2024-05-20 16:05:18 +0530
committerGitHub <noreply@github.com>2024-05-20 10:35:18 +0000
commit2af6fe0b30a275e5fd8a43eca4126d82639fbaa9 (patch)
tree2687a12c392b30cba7cdcd849133d0d382b79cbe /components/layout
parentc2076580f352f3c61f90969e03d78ada609935eb (diff)
downloadservo-2af6fe0b30a275e5fd8a43eca4126d82639fbaa9.tar.gz
servo-2af6fe0b30a275e5fd8a43eca4126d82639fbaa9.zip
compositor: Move WebRender-ish messages and types to `webrender_traits` (#32315)
* Move WebRender related types to `webrender_traits` This refactor moves several WebRender related types from `compositing_traits`, `script_traits` and `net_traits` crates to the `webrender_traits` crate. This change also moves the `Image` type and associated function out of `net_traits` and into the `pixels` crate. Co-authored-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi` --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/Cargo.toml2
-rw-r--r--components/layout/display_list/builder.rs2
-rw-r--r--components/layout/display_list/items.rs4
-rw-r--r--components/layout/display_list/webrender_helpers.rs6
-rw-r--r--components/layout/fragment.rs2
5 files changed, 9 insertions, 7 deletions
diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml
index f63002b5fe3..f7b50524604 100644
--- a/components/layout/Cargo.toml
+++ b/components/layout/Cargo.toml
@@ -30,6 +30,7 @@ log = { workspace = true }
malloc_size_of = { workspace = true }
malloc_size_of_derive = { workspace = true }
net_traits = { workspace = true }
+pixels = { path = "../pixels" }
parking_lot = { workspace = true }
profile_traits = { workspace = true }
range = { path = "../range" }
@@ -50,4 +51,5 @@ style_traits = { workspace = true }
unicode-bidi = { workspace = true, features = ["with_serde"] }
unicode-script = { workspace = true }
webrender_api = { workspace = true }
+webrender_traits = { workspace = true }
xi-unicode = { workspace = true }
diff --git a/components/layout/display_list/builder.rs b/components/layout/display_list/builder.rs
index 0fba6875d2f..62257e17d8b 100644
--- a/components/layout/display_list/builder.rs
+++ b/components/layout/display_list/builder.rs
@@ -27,7 +27,6 @@ use log::{debug, warn};
use net_traits::image_cache::UsePlaceholder;
use range::Range;
use script_layout_interface::{combine_id_with_fragment_type, FragmentType};
-use script_traits::compositor::ScrollSensitivity;
use servo_config::opts;
use servo_geometry::{self, MaxRect};
use style::color::AbsoluteColor;
@@ -52,6 +51,7 @@ use webrender_api::{
ExternalScrollId, FilterOp, GlyphInstance, ImageRendering, LineStyle, NinePatchBorder,
NinePatchBorderSource, NormalBorder, PropertyBinding, StickyOffsetBounds,
};
+use webrender_traits::display_list::ScrollSensitivity;
use super::StackingContextId;
use crate::block::BlockFlow;
diff --git a/components/layout/display_list/items.rs b/components/layout/display_list/items.rs
index 6fe14f03143..92117a118df 100644
--- a/components/layout/display_list/items.rs
+++ b/components/layout/display_list/items.rs
@@ -20,8 +20,7 @@ use base::id::PipelineId;
use base::print_tree::PrintTree;
use embedder_traits::Cursor;
use euclid::{SideOffsets2D, Vector2D};
-use net_traits::image::base::Image;
-use script_traits::compositor::{ScrollSensitivity, ScrollTreeNodeId};
+use pixels::Image;
use serde::Serialize;
use servo_geometry::MaxRect;
use style::computed_values::_servo_top_layer::T as InTopLayer;
@@ -33,6 +32,7 @@ use webrender_api::{
FilterOp, GlyphInstance, GradientStop, ImageKey, MixBlendMode, PrimitiveFlags, Shadow,
SpatialId, StickyOffsetBounds, TransformStyle,
};
+use webrender_traits::display_list::{ScrollSensitivity, ScrollTreeNodeId};
use super::StackingContextId;
diff --git a/components/layout/display_list/webrender_helpers.rs b/components/layout/display_list/webrender_helpers.rs
index 0ac79b4d8ca..c6c2abfdd34 100644
--- a/components/layout/display_list/webrender_helpers.rs
+++ b/components/layout/display_list/webrender_helpers.rs
@@ -10,15 +10,15 @@
use base::id::PipelineId;
use base::WebRenderEpochToU16;
use log::trace;
-use script_traits::compositor::{
- CompositorDisplayListInfo, ScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo,
-};
use webrender_api::units::{LayoutPoint, LayoutSize, LayoutVector2D};
use webrender_api::{
self, ClipChainId, ClipId, CommonItemProperties, DisplayItem as WrDisplayItem,
DisplayListBuilder, Epoch, HasScrollLinkedEffect, PrimitiveFlags, PropertyBinding, RasterSpace,
ReferenceFrameKind, SpaceAndClipInfo, SpatialId, SpatialTreeItemKey,
};
+use webrender_traits::display_list::{
+ CompositorDisplayListInfo, ScrollSensitivity, ScrollTreeNodeId, ScrollableNodeInfo,
+};
use crate::display_list::items::{
BaseDisplayItem, ClipScrollNode, ClipScrollNodeType, ClipType, DisplayItem, DisplayList,
diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs
index 171c529babc..7ddcbdb2e6b 100644
--- a/components/layout/fragment.rs
+++ b/components/layout/fragment.rs
@@ -20,8 +20,8 @@ use gfx::text::text_run::{TextRun, TextRunSlice};
use html5ever::{local_name, namespace_url, ns};
use ipc_channel::ipc::IpcSender;
use log::debug;
-use net_traits::image::base::{Image, ImageMetadata};
use net_traits::image_cache::{ImageOrMetadataAvailable, UsePlaceholder};
+use pixels::{Image, ImageMetadata};
use range::*;
use script_layout_interface::wrapper_traits::{
PseudoElementType, ThreadSafeLayoutElement, ThreadSafeLayoutNode,