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

source

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.

source

pub fn register_transform( &mut self, local_to_surface: ScaleOffset, surface_to_device: ScaleOffset ) -> CompositorTransformIndex

Register use of a transform for a picture cache tile or external surface

source

pub fn get_device_rect( &self, local_rect: &PictureRect, transform_index: CompositorTransformIndex ) -> DeviceRect

Calculate the device-space rect of a local compositor surface rect

source

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

source

pub fn get_device_transform( &self, transform_index: CompositorTransformIndex ) -> ScaleOffset

Get the local -> device compositor transform

source

pub fn get_compositor_transform( &self, transform_index: CompositorTransformIndex ) -> ScaleOffset

Get the surface -> device compositor transform

source

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.

source

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

source

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

source

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

source

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

source

pub fn end_frame(&mut self)

source§

impl CompositeState

source

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

source

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§

source§

impl Serialize for CompositeState

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.