aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_traits/compositor.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-05-16 09:18:03 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-05-24 09:16:25 +0200
commit4d3625ec80853191be324dd179e5015d1a862fee (patch)
tree7cec7b045d1c0fa8b0cac7d248b8add9ea6c6773 /components/script_traits/compositor.rs
parent0377a1853ad635dcd7a4b00434dd9759c5ac75d7 (diff)
downloadservo-4d3625ec80853191be324dd179e5015d1a862fee.tar.gz
servo-4d3625ec80853191be324dd179e5015d1a862fee.zip
Clean up and document the `send_display_list` interface
This moves more members to the CompositorDisplayListInfo struct, which now holds all miscellaneous, non-WebRender data when sending display lists. It also documents what each things sent with a display list does.
Diffstat (limited to 'components/script_traits/compositor.rs')
-rw-r--r--components/script_traits/compositor.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/components/script_traits/compositor.rs b/components/script_traits/compositor.rs
index 00255ee2efb..1707f4a3fe2 100644
--- a/components/script_traits/compositor.rs
+++ b/components/script_traits/compositor.rs
@@ -7,7 +7,7 @@
use embedder_traits::Cursor;
use webrender_api::{
units::{LayoutSize, LayoutVector2D},
- ExternalScrollId, ScrollLocation, ScrollSensitivity, SpatialId,
+ Epoch, ExternalScrollId, PipelineId, ScrollLocation, ScrollSensitivity, SpatialId,
};
/// Information that Servo keeps alongside WebRender display items
@@ -213,6 +213,15 @@ impl ScrollTree {
/// display lists sent to the compositor.
#[derive(Debug, Deserialize, Serialize)]
pub struct CompositorDisplayListInfo {
+ /// The WebRender [PipelineId] of this display list.
+ pub pipeline_id: PipelineId,
+
+ /// The size of the viewport that this display list renders into.
+ pub viewport_size: LayoutSize,
+
+ /// The epoch of the display list.
+ pub epoch: Epoch,
+
/// An array of `HitTestInfo` which is used to store information
/// to assist the compositor to take various actions (set the cursor,
/// scroll without layout) using a WebRender hit test result.
@@ -237,7 +246,8 @@ impl CompositorDisplayListInfo {
pub fn new(
viewport_size: LayoutSize,
content_size: LayoutSize,
- pipeline_id: webrender_api::PipelineId,
+ pipeline_id: PipelineId,
+ epoch: Epoch,
) -> Self {
let mut scroll_tree = ScrollTree::default();
let root_reference_frame_id = scroll_tree.add_scroll_tree_node(
@@ -257,6 +267,9 @@ impl CompositorDisplayListInfo {
);
CompositorDisplayListInfo {
+ pipeline_id,
+ viewport_size,
+ epoch,
hit_test_info: Default::default(),
scroll_tree,
root_reference_frame_id,