pub struct CompositeState {
    pub tiles: Vec<CompositeTile, FrameAllocator>,
    pub external_surfaces: Vec<ResolvedExternalSurface, FrameAllocator>,
    pub z_generator: ZBufferIdGenerator,
    pub dirty_rects_are_valid: bool,
    pub compositor_kind: CompositorKind,
    pub occluders: Occluders,
    pub descriptor: CompositeDescriptor,
    pub picture_cache_debug: PictureCacheDebugInfo,
    pub transforms: Vec<CompositorTransform, FrameAllocator>,
    low_quality_pinch_zoom: bool,
    pub clips: Vec<CompositorClip, FrameAllocator>,
}Expand description
The list of tiles to be drawn this frame
Fields§
§tiles: Vec<CompositeTile, FrameAllocator>List of tiles to be drawn by the Draw compositor. Tiles are accumulated in this vector and sorted from front to back at the end of the frame.
external_surfaces: Vec<ResolvedExternalSurface, FrameAllocator>List of primitives that were promoted to be compositor surfaces.
z_generator: ZBufferIdGeneratorUsed to generate z-id values for tiles in the Draw compositor mode.
dirty_rects_are_valid: bool§compositor_kind: CompositorKindThe kind of compositor for picture cache tiles (e.g. drawn by WR, or OS compositor)
occluders: OccludersList of registered occluders
descriptor: CompositeDescriptorDescription of the surfaces and properties that are being composited.
picture_cache_debug: PictureCacheDebugInfoDebugging information about the state of the pictures cached for regression testing.
transforms: Vec<CompositorTransform, FrameAllocator>List of registered transforms used by picture cache or external surfaces
low_quality_pinch_zoom: boolWhether we have low quality pinch zoom enabled
clips: Vec<CompositorClip, FrameAllocator>List of registered clips used by picture cache and/or external surfaces
Implementations§
Source§impl CompositeState
 
impl CompositeState
Sourcepub fn new(
    compositor_kind: CompositorKind,
    max_depth_ids: i32,
    dirty_rects_are_valid: bool,
    low_quality_pinch_zoom: bool,
    memory: &FrameMemory,
) -> Self
 
pub fn new( compositor_kind: CompositorKind, max_depth_ids: i32, dirty_rects_are_valid: bool, low_quality_pinch_zoom: bool, memory: &FrameMemory, ) -> Self
Construct a new state for compositing picture tiles. This is created during each frame construction and passed to the renderer.
fn compositor_clip_params( &self, clip_index: Option<CompositorClipIndex>, default_rect: DeviceRect, ) -> (DeviceRect, ClipRadius)
Sourcepub fn register_transform(
    &mut self,
    local_to_raster: ScaleOffset,
    raster_to_device: ScaleOffset,
) -> CompositorTransformIndex
 
pub fn register_transform( &mut self, local_to_raster: ScaleOffset, raster_to_device: ScaleOffset, ) -> CompositorTransformIndex
Register use of a transform for a picture cache tile or external surface
Sourcepub fn register_clip(
    &mut self,
    rect: DeviceRect,
    radius: BorderRadius,
) -> CompositorClipIndex
 
pub fn register_clip( &mut self, rect: DeviceRect, radius: BorderRadius, ) -> CompositorClipIndex
Register use of a clip for a picture cache tile and/or external surface
Sourcepub fn get_device_rect(
    &self,
    local_rect: &PictureRect,
    transform_index: CompositorTransformIndex,
) -> DeviceRect
 
pub fn get_device_rect( &self, local_rect: &PictureRect, transform_index: CompositorTransformIndex, ) -> DeviceRect
Calculate the device-space rect of a local compositor surface rect
Sourcepub fn get_surface_rect<T>(
    &self,
    local_sub_rect: &Box2D<f32, T>,
    local_bounds: &Box2D<f32, T>,
    transform_index: CompositorTransformIndex,
) -> DeviceRect
 
pub fn get_surface_rect<T>( &self, local_sub_rect: &Box2D<f32, T>, local_bounds: &Box2D<f32, T>, transform_index: CompositorTransformIndex, ) -> DeviceRect
Calculate the device-space rect of a local compositor surface rect, normalized to the origin of a given point
Sourcepub fn get_device_transform(
    &self,
    transform_index: CompositorTransformIndex,
) -> ScaleOffset
 
pub fn get_device_transform( &self, transform_index: CompositorTransformIndex, ) -> ScaleOffset
Get the local -> device compositor transform
Sourcepub fn get_compositor_transform(
    &self,
    transform_index: CompositorTransformIndex,
) -> ScaleOffset
 
pub fn get_compositor_transform( &self, transform_index: CompositorTransformIndex, ) -> ScaleOffset
Get the surface -> device compositor transform
Sourcepub fn get_compositor_clip(
    &self,
    clip_index: CompositorClipIndex,
) -> &CompositorClip
 
pub fn get_compositor_clip( &self, clip_index: CompositorClipIndex, ) -> &CompositorClip
Get the compositor clip
Sourcepub fn register_occluder(
    &mut self,
    z_id: ZBufferId,
    rect: WorldRect,
    compositor_clip: Option<CompositorClipIndex>,
)
 
pub fn register_occluder( &mut self, z_id: ZBufferId, rect: WorldRect, compositor_clip: Option<CompositorClipIndex>, )
Register an occluder during picture cache updates that can be used during frame building to occlude tiles.
Sourcefn push_compositor_surface(
    &mut self,
    external_surface: &ExternalSurfaceDescriptor,
    is_opaque: bool,
    device_clip_rect: DeviceRect,
    resource_cache: &ResourceCache,
    gpu_cache: &mut GpuCache,
    deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>,
    clip_index: Option<CompositorClipIndex>,
)
 
fn push_compositor_surface( &mut self, external_surface: &ExternalSurfaceDescriptor, is_opaque: bool, device_clip_rect: DeviceRect, resource_cache: &ResourceCache, gpu_cache: &mut GpuCache, deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>, clip_index: Option<CompositorClipIndex>, )
Push a compositor surface on to the list of tiles to be passed to the compositor
Sourcepub fn push_surface(
    &mut self,
    tile_cache: &TileCacheInstance,
    device_clip_rect: DeviceRect,
    resource_cache: &ResourceCache,
    gpu_cache: &mut GpuCache,
    deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>,
)
 
pub fn push_surface( &mut self, tile_cache: &TileCacheInstance, device_clip_rect: DeviceRect, resource_cache: &ResourceCache, gpu_cache: &mut GpuCache, deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>, )
Add a picture cache to be composited
Sourcepub fn update_dirty_rect_validity(
    &mut self,
    old_descriptor: &CompositeDescriptor,
)
 
pub fn update_dirty_rect_validity( &mut self, old_descriptor: &CompositeDescriptor, )
Compare this state vs. a previous frame state, and invalidate dirty rects if the surface count has changed
fn compute_external_surface_dependencies( &mut self, external_surface: &ExternalSurfaceDescriptor, image_dependencies: &[ImageDependency; 3], required_plane_count: usize, resource_cache: &ResourceCache, gpu_cache: &mut GpuCache, deferred_resolves: &mut Vec<DeferredResolve, FrameAllocator>, ) -> ResolvedExternalSurfaceIndex
pub fn end_frame(&mut self)
Source§impl CompositeState
 
impl CompositeState
pub fn destroy_native_tiles<'a, I: Iterator<Item = &'a mut Box<Tile>>>( &mut self, tiles_iter: I, resource_cache: &mut ResourceCache, )
Source§impl CompositeState
 
impl CompositeState
Sourcefn composite_native(
    &self,
    clear_color: ColorF,
    dirty_rects: &[DeviceIntRect],
    device: &mut Device,
    compositor: &mut dyn Compositor,
)
 
fn composite_native( &self, clear_color: ColorF, dirty_rects: &[DeviceIntRect], device: &mut Device, compositor: &mut dyn Compositor, )
Use the client provided native compositor interface to add all picture cache tiles to the OS compositor
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompositeState
impl RefUnwindSafe for CompositeState
impl Send for CompositeState
impl !Sync for CompositeState
impl Unpin for CompositeState
impl UnwindSafe for CompositeState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more