mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Create a constellation_traits
crate (#36088)
This change creates a `constellation_traits` crate. Previously messages to the `Constellation` were in the `compositing_traits` crate, which came about organically. This change moves these to a new crate which also contains data types that are used in both compositing/libservo and script (ie types that cross the process boundary). The idea is similar to `embedding_traits`, but this is meant for types not exposed to the API. This change allows deduplicating `UntrustedNodeAddress`, which previously had two versions to avoid circular dependencies. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
02375809b0
commit
7c574141c0
52 changed files with 399 additions and 270 deletions
|
@ -16,7 +16,7 @@ use malloc_size_of::malloc_size_of_is_0;
|
|||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use parking_lot::Mutex;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use webrender_api::{ExternalScrollId, PipelineId as WebRenderPipelineId};
|
||||
use webrender_api::{ExternalScrollId, PipelineId as WebRenderPipelineId, SpatialId};
|
||||
|
||||
/// Asserts the size of a type at compile time.
|
||||
macro_rules! size_of_test {
|
||||
|
@ -442,3 +442,15 @@ pub const TEST_BROWSING_CONTEXT_ID: BrowsingContextId = BrowsingContextId {
|
|||
};
|
||||
|
||||
pub const TEST_WEBVIEW_ID: WebViewId = WebViewId(TEST_BROWSING_CONTEXT_ID);
|
||||
|
||||
/// An id for a ScrollTreeNode in the ScrollTree. This contains both the index
|
||||
/// to the node in the tree's array of nodes as well as the corresponding SpatialId
|
||||
/// for the SpatialNode in the WebRender display list.
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize)]
|
||||
pub struct ScrollTreeNodeId {
|
||||
/// The index of this scroll tree node in the tree's array of nodes.
|
||||
pub index: usize,
|
||||
|
||||
/// The WebRender spatial id of this scroll tree node.
|
||||
pub spatial_id: SpatialId,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue