Struct webrender::render_backend::RenderBackend
source · 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
impl RenderBackend
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
pub fn next_namespace_id() -> IdNamespace
pub fn run(&mut self)
fn process_transaction( &mut self, txns: Vec<Box<BuiltTransaction>>, result_tx: Option<Sender<SceneSwapResult>>, frame_counter: &mut u32, ) -> bool
fn process_api_msg( &mut self, msg: ApiMsg, frame_counter: &mut u32, ) -> RenderBackendStatus
fn process_scene_builder_result( &mut self, msg: SceneBuilderResult, frame_counter: &mut u32, ) -> RenderBackendStatus
fn update_frame_builder_config(&self)
fn prepare_for_frames(&mut self)
fn bookkeep_after_frames(&mut self)
fn requires_frame_build(&mut self) -> bool
fn prepare_transactions( &mut self, txns: Vec<Box<TransactionMsg>>, frame_counter: &mut u32, )
sourcefn maybe_force_nop_documents<F>(
&mut self,
frame_counter: &mut u32,
document_already_present: F,
)
fn maybe_force_nop_documents<F>( &mut self, frame_counter: &mut u32, document_already_present: F, )
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.
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
fn send_backend_message(&self, msg: SceneBuilderRequest)
fn report_memory(&mut self, tx: Sender<Box<MemoryReport>>)
fn save_capture_sequence(&mut self)
source§impl RenderBackend
impl RenderBackend
fn save_capture(&mut self, root: PathBuf, bits: CaptureBits) -> DebugOutput
fn start_capture_sequence(&mut self, root: PathBuf, bits: CaptureBits)
fn stop_capture_sequence(&mut self)
Auto Trait Implementations§
impl Freeze for RenderBackend
impl !RefUnwindSafe for RenderBackend
impl !Send for RenderBackend
impl !Sync for RenderBackend
impl Unpin for RenderBackend
impl !UnwindSafe for RenderBackend
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