pub struct RenderBackend {
Show 17 fields api_rx: Receiver<ApiMsg>, result_tx: Sender<ResultMsg>, scene_tx: Sender<SceneBuilderRequest>, gpu_cache: GpuCache, resource_cache: ResourceCache, frame_config: FrameBuilderConfig, default_compositor_kind: CompositorKind, documents: FastHashMap<DocumentId, Document>, notifier: Box<dyn RenderNotifier>, sampler: Option<Box<dyn AsyncPropertySampler + Send>>, size_of_ops: Option<MallocSizeOfOps>, debug_flags: DebugFlags, namespace_alloc_by_client: bool, recycler: Recycler, capture_config: Option<CaptureConfig>, tile_caches: FastHashMap<SliceId, Box<TileCacheInstance>>, frame_publish_id: FramePublishId,
}
Expand description

The render backend is responsible for transforming high level display lists into GPU-friendly work which is then submitted to the renderer in the form of a frame::Frame.

The render backend operates on its own thread.

Fields§

§api_rx: Receiver<ApiMsg>§result_tx: Sender<ResultMsg>§scene_tx: Sender<SceneBuilderRequest>§gpu_cache: GpuCache§resource_cache: ResourceCache§frame_config: FrameBuilderConfig§default_compositor_kind: CompositorKind§documents: FastHashMap<DocumentId, Document>§notifier: Box<dyn RenderNotifier>§sampler: Option<Box<dyn AsyncPropertySampler + Send>>§size_of_ops: Option<MallocSizeOfOps>§debug_flags: DebugFlags§namespace_alloc_by_client: bool§recycler: Recycler§capture_config: Option<CaptureConfig>

If Some, do ‘sequence capture’ logging, recording updated documents, frames, etc. This is set only through messages from the scene builder, so all control of sequence capture goes through there.

§tile_caches: FastHashMap<SliceId, Box<TileCacheInstance>>

A map of tile caches. These are stored in the backend as they are persisted between both frame and scenes.

§frame_publish_id: FramePublishId

The id of the latest PublishDocument

Implementations§

source§

impl RenderBackend

source

pub fn new( api_rx: Receiver<ApiMsg>, result_tx: Sender<ResultMsg>, scene_tx: Sender<SceneBuilderRequest>, resource_cache: ResourceCache, notifier: Box<dyn RenderNotifier>, frame_config: FrameBuilderConfig, sampler: Option<Box<dyn AsyncPropertySampler + Send>>, size_of_ops: Option<MallocSizeOfOps>, debug_flags: DebugFlags, namespace_alloc_by_client: bool ) -> RenderBackend

source

pub fn next_namespace_id() -> IdNamespace

source

pub fn run(&mut self)

source

fn process_transaction( &mut self, txns: Vec<Box<BuiltTransaction>>, result_tx: Option<Sender<SceneSwapResult>>, frame_counter: &mut u32 ) -> bool

source

fn process_api_msg( &mut self, msg: ApiMsg, frame_counter: &mut u32 ) -> RenderBackendStatus

source

fn process_scene_builder_result( &mut self, msg: SceneBuilderResult, frame_counter: &mut u32 ) -> RenderBackendStatus

source

fn update_frame_builder_config(&self)

source

fn prepare_for_frames(&mut self)

source

fn bookkeep_after_frames(&mut self)

source

fn requires_frame_build(&mut self) -> bool

source

fn prepare_transactions( &mut self, txns: Vec<Box<TransactionMsg>>, frame_counter: &mut u32 )

source

fn maybe_force_nop_documents<F>( &mut self, frame_counter: &mut u32, document_already_present: F )where F: Fn(DocumentId) -> bool,

In certain cases, resources shared by multiple documents have to run maintenance operations, like cleaning up unused cache items. In those cases, we are forced to build frames for all documents, however we may not have a transaction ready for every document - this method calls update_document with the details of a fake, nop transaction just to force a frame build.

source

fn update_document( &mut self, document_id: DocumentId, resource_updates: Vec<ResourceUpdate>, frame_ops: Vec<FrameMsg>, notifications: Vec<NotificationRequest>, render_frame: bool, render_reasons: RenderReasons, generated_frame_id: Option<u64>, invalidate_rendered_frame: bool, frame_counter: &mut u32, has_built_scene: bool, start_time: Option<u64> ) -> bool

source

fn send_backend_message(&self, msg: SceneBuilderRequest)

source

fn report_memory(&mut self, tx: Sender<Box<MemoryReport>>)

source

fn save_capture_sequence(&mut self)

source§

impl RenderBackend

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> 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.