Struct webrender::composite::CompositeState
source · pub struct CompositeState {
pub tiles: Vec<CompositeTile>,
pub external_surfaces: Vec<ResolvedExternalSurface>,
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>,
low_quality_pinch_zoom: bool,
}
Expand description
The list of tiles to be drawn this frame
Fields§
§tiles: Vec<CompositeTile>
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>
List of primitives that were promoted to be compositor surfaces.
z_generator: ZBufferIdGenerator
Used to generate z-id values for tiles in the Draw compositor mode.
dirty_rects_are_valid: bool
§compositor_kind: CompositorKind
The kind of compositor for picture cache tiles (e.g. drawn by WR, or OS compositor)
occluders: Occluders
List of registered occluders
descriptor: CompositeDescriptor
Description of the surfaces and properties that are being composited.
picture_cache_debug: PictureCacheDebugInfo
Debugging information about the state of the pictures cached for regression testing.
transforms: Vec<CompositorTransform>
List of registered transforms used by picture cache or external surfaces
low_quality_pinch_zoom: bool
Whether we have low quality pinch zoom enabled
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,
) -> Self
pub fn new( compositor_kind: CompositorKind, max_depth_ids: i32, dirty_rects_are_valid: bool, low_quality_pinch_zoom: bool, ) -> Self
Construct a new state for compositing picture tiles. This is created during each frame construction and passed to the renderer.
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 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 register_occluder(&mut self, z_id: ZBufferId, rect: WorldRect)
pub fn register_occluder(&mut self, z_id: ZBufferId, rect: WorldRect)
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>,
)
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>, )
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>,
)
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>, )
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>, ) -> 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