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.
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
impl Document
pub fn new(id: DocumentId, size: DeviceIntSize) -> Self
fn can_render(&self) -> bool
fn has_pixels(&self) -> bool
fn process_frame_msg(&mut self, message: FrameMsg) -> DocumentOps
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
Sourcefn process_offscreen_scene(
&mut self,
txn: OffscreenBuiltScene,
resource_cache: &mut ResourceCache,
gpu_cache: &mut GpuCache,
chunk_pool: Arc<ChunkPool>,
debug_flags: DebugFlags,
) -> RenderedDocument
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.
fn rebuild_hit_tester(&mut self)
pub fn updated_pipeline_info(&mut self) -> PipelineInfo
Sourcepub fn set_scroll_offsets(
&mut self,
id: ExternalScrollId,
offsets: Vec<SampledScrollOffset>,
) -> bool
pub fn set_scroll_offsets( &mut self, id: ExternalScrollId, offsets: Vec<SampledScrollOffset>, ) -> bool
Returns true if the node actually changed position or false otherwise.
Sourcefn 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,
)
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.
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§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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