compositing: Combine webrender_traits and compositing_traits (#36372)

These two traits both exposed different parts of the compositing API,
but now that the compositor doesn't depend directly on `script` any
longer and the `script_traits` crate has been split into the
`constellation_traits` crate, this can be finally be cleaned up without
causing circular dependencies. In addition, some unit tests for the
`IOPCompositor`'s scroll node tree are also moved into
`compositing_traits` as well.

Testing: This just combines two crates, so no new tests are necessary.
Fixes: #35984.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2025-04-06 19:34:18 +02:00 committed by GitHub
parent e74a042efd
commit 0caa271176
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 582 additions and 637 deletions

View file

@ -41,7 +41,6 @@ stylo_traits = { workspace = true }
tracing = { workspace = true, optional = true }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
webxr = { path = "../webxr", optional = true }
[dev-dependencies]

View file

@ -16,8 +16,11 @@ use base::cross_process_instant::CrossProcessInstant;
use base::id::{PipelineId, WebViewId};
use base::{Epoch, WebRenderEpochToU16};
use bitflags::bitflags;
use compositing_traits::display_list::{HitTestInfo, ScrollTree};
use compositing_traits::rendering_context::RenderingContext;
use compositing_traits::{
CompositionPipeline, CompositorMsg, CompositorReceiver, SendableFrameTree,
CompositionPipeline, CompositorMsg, CompositorReceiver, CrossProcessCompositorMessage,
ImageUpdate, RendererWebView, SendableFrameTree,
};
use constellation_traits::{
AnimationTickType, EmbedderToConstellationMessage, PaintMetricEvent, WindowSizeType,
@ -51,9 +54,6 @@ use webrender_api::{
RenderReasons, SampledScrollOffset, ScrollLocation, SpaceAndClipInfo, SpatialId,
SpatialTreeItemKey, TransformStyle,
};
use webrender_traits::display_list::{HitTestInfo, ScrollTree};
use webrender_traits::rendering_context::RenderingContext;
use webrender_traits::{CrossProcessCompositorMessage, ImageUpdate, RendererWebView};
use crate::InitialCompositorState;
use crate::webview::{UnknownWebView, WebView};

View file

@ -7,6 +7,7 @@
use std::cell::Cell;
use std::rc::Rc;
use compositing_traits::rendering_context::RenderingContext;
use compositing_traits::{CompositorProxy, CompositorReceiver};
use constellation_traits::EmbedderToConstellationMessage;
use crossbeam_channel::Sender;
@ -14,7 +15,6 @@ use embedder_traits::ShutdownState;
use profile_traits::{mem, time};
use webrender::RenderApi;
use webrender_api::DocumentId;
use webrender_traits::rendering_context::RenderingContext;
pub use crate::compositor::IOCompositor;

View file

@ -8,7 +8,7 @@ use std::collections::hash_map::Keys;
use std::rc::Rc;
use base::id::{PipelineId, WebViewId};
use compositing_traits::SendableFrameTree;
use compositing_traits::{RendererWebView, SendableFrameTree};
use constellation_traits::{EmbedderToConstellationMessage, ScrollState};
use embedder_traits::{
AnimationState, CompositorHitTestResult, InputEvent, MouseButton, MouseButtonAction,
@ -23,7 +23,6 @@ use webrender_api::units::{DeviceIntPoint, DevicePoint, DeviceRect, LayoutVector
use webrender_api::{
ExternalScrollId, HitTestFlags, RenderReasons, SampledScrollOffset, ScrollLocation,
};
use webrender_traits::RendererWebView;
use crate::IOCompositor;
use crate::compositor::{PipelineDetails, ServoRenderer};