constant: Add support for other expressions WebRender uses.

This commit is contained in:
Emilio Cobos Álvarez
2022-04-14 18:21:19 +02:00
parent 882af0b563
commit 770f352375
11 changed files with 292 additions and 16 deletions
+30 -1
View File
@@ -21,5 +21,34 @@ bitflags! {
}
}
/// An arbitrary identifier for a native (OS compositor) surface
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
pub struct NativeSurfaceId(pub u64);
impl NativeSurfaceId {
/// A special id for the native surface that is used for debug / profiler overlays.
pub const DEBUG_OVERLAY: NativeSurfaceId = NativeSurfaceId(u64::MAX);
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "capture", derive(Serialize))]
#[cfg_attr(feature = "replay", derive(Deserialize))]
pub struct NativeTileId {
pub surface_id: NativeSurfaceId,
pub x: i32,
pub y: i32,
}
impl NativeTileId {
/// A special id for the native surface that is used for debug / profiler overlays.
pub const DEBUG_OVERLAY: NativeTileId = NativeTileId {
surface_id: NativeSurfaceId::DEBUG_OVERLAY,
x: 0,
y: 0,
};
}
#[no_mangle]
pub extern "C" fn root(flags: AlignFlags) {}
pub extern "C" fn root(flags: AlignFlags, tile: NativeTileId) {}