Struct Document

Source
struct Document {
Show 22 fields id: DocumentId, removed_pipelines: Vec<(PipelineId, DocumentId)>, view: DocumentView, stamp: FrameStamp, scene: BuiltScene, frame_builder: FrameBuilder, rg_builder: RenderTaskGraphBuilder, hit_tester: Option<Arc<HitTester>>, shared_hit_tester: Arc<SharedHitTester>, dynamic_properties: SceneProperties, frame_is_valid: bool, hit_tester_is_valid: bool, rendered_frame_is_valid: bool, has_built_scene: bool, data_stores: DataStores, spatial_tree: SpatialTree, minimap_data: FastHashMap<ExternalScrollId, MinimapData>, scratch: ScratchBuffer, prev_composite_descriptor: CompositeDescriptor, dirty_rects_are_valid: bool, profile: TransactionProfile, frame_stats: Option<FullFrameStats>,
}

Fields§

§id: DocumentId

The id of this document

§removed_pipelines: Vec<(PipelineId, DocumentId)>

Temporary list of removed pipelines received from the scene builder thread and forwarded to the renderer.

§view: DocumentView§stamp: FrameStamp

The id and time of the current frame.

§scene: BuiltScene

The latest built scene, usable to build frames. received from the scene builder thread.

§frame_builder: FrameBuilder

The builder object that prodces frames, kept around to preserve some retained state.

§rg_builder: RenderTaskGraphBuilder

Allows graphs of render tasks to be created, and then built into an immutable graph output.

§hit_tester: Option<Arc<HitTester>>

A data structure to allow hit testing against rendered frames. This is updated every time we produce a fully rendered frame.

§shared_hit_tester: Arc<SharedHitTester>

To avoid synchronous messaging we update a shared hit-tester that other threads can query.

§dynamic_properties: SceneProperties

Properties that are resolved during frame building and can be changed at any time without requiring the scene to be re-built.

§frame_is_valid: bool

Track whether the last built frame is up to date or if it will need to be re-built before rendering again.

§hit_tester_is_valid: bool§rendered_frame_is_valid: bool§has_built_scene: bool

We track this information to be able to display debugging information from the renderer.

§data_stores: DataStores§spatial_tree: SpatialTree

Retained frame-building version of the spatial tree

§minimap_data: FastHashMap<ExternalScrollId, MinimapData>§scratch: ScratchBuffer

Contains various vecs of data that is used only during frame building, where we want to recycle the memory each new display list, to avoid constantly re-allocating and moving memory around.

§prev_composite_descriptor: CompositeDescriptor

Tracks the state of the picture cache tiles that were composited on the previous frame.

§dirty_rects_are_valid: bool

Tracks if we need to invalidate dirty rects for this document, due to the picture cache slice configuration having changed when a new scene is swapped in.

§profile: TransactionProfile§frame_stats: Option<FullFrameStats>

Implementations§

Source§

impl Document

Source

pub fn new(id: DocumentId, size: DeviceIntSize) -> Self

Source

fn can_render(&self) -> bool

Source

fn has_pixels(&self) -> bool

Source

fn process_frame_msg(&mut self, message: FrameMsg) -> DocumentOps

Source

fn build_frame( &mut self, resource_cache: &mut ResourceCache, gpu_cache: &mut GpuCache, debug_flags: DebugFlags, tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>, frame_stats: Option<FullFrameStats>, present: bool, render_reasons: RenderReasons, chunk_pool: Arc<ChunkPool>, ) -> RenderedDocument

Source

fn process_offscreen_scene( &mut self, txn: OffscreenBuiltScene, resource_cache: &mut ResourceCache, gpu_cache: &mut GpuCache, chunk_pool: Arc<ChunkPool>, debug_flags: DebugFlags, ) -> RenderedDocument

Build a frame without changing the state of the current scene.

This is useful to render arbitrary content into to images in the resource cache for later use without affecting what is currently being displayed.

Source

fn rebuild_hit_tester(&mut self)

Source

pub fn updated_pipeline_info(&mut self) -> PipelineInfo

Source

pub fn set_scroll_offsets( &mut self, id: ExternalScrollId, offsets: Vec<SampledScrollOffset>, ) -> bool

Returns true if the node actually changed position or false otherwise.

Source

fn update_tile_caches_for_new_scene( &mut self, requested_tile_caches: FastHashMap<SliceId, TileCacheParams>, tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>, resource_cache: &mut ResourceCache, )

Update the state of tile caches when a new scene is being swapped in to the render backend. Retain / reuse existing caches if possible, and destroy any now unused caches.

Source

pub fn new_async_scene_ready( &mut self, built_scene: BuiltScene, recycler: &mut Recycler, tile_caches: &mut FastHashMap<SliceId, Box<TileCacheInstance>>, resource_cache: &mut ResourceCache, )

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.
Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.