Trait webrender_api::BlobImageHandler
source · pub trait BlobImageHandler: Send {
// Required methods
fn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobImageRasterizer>;
fn create_similar(&self) -> Box<dyn BlobImageHandler>;
fn prepare_resources(
&mut self,
services: &dyn BlobImageResources,
requests: &[BlobImageParams],
);
fn add(
&mut self,
key: BlobImageKey,
data: Arc<BlobImageData>,
visible_rect: &DeviceIntRect,
tile_size: TileSize,
);
fn update(
&mut self,
key: BlobImageKey,
data: Arc<BlobImageData>,
visible_rect: &DeviceIntRect,
dirty_rect: &BlobDirtyRect,
);
fn delete(&mut self, key: BlobImageKey);
fn delete_font(&mut self, key: FontKey);
fn delete_font_instance(&mut self, key: FontInstanceKey);
fn clear_namespace(&mut self, namespace: IdNamespace);
fn enable_multithreading(&mut self, enable: bool);
}
Expand description
A handler on the render backend that can create rasterizer objects which will be sent to the scene builder thread to execute the rasterization.
The handler is responsible for collecting resources, managing/updating blob commands and creating the rasterizer objects, but isn’t expected to do any rasterization itself.
Required Methods§
sourcefn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobImageRasterizer>
fn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobImageRasterizer>
Creates a snapshot of the current state of blob images in the handler.
sourcefn create_similar(&self) -> Box<dyn BlobImageHandler>
fn create_similar(&self) -> Box<dyn BlobImageHandler>
Creates an empty blob handler of the same type.
This is used to allow creating new API endpoints with blob handlers installed on them.
sourcefn prepare_resources(
&mut self,
services: &dyn BlobImageResources,
requests: &[BlobImageParams],
)
fn prepare_resources( &mut self, services: &dyn BlobImageResources, requests: &[BlobImageParams], )
A hook to let the blob image handler update any state related to resources that are not bundled in the blob recording itself.
sourcefn add(
&mut self,
key: BlobImageKey,
data: Arc<BlobImageData>,
visible_rect: &DeviceIntRect,
tile_size: TileSize,
)
fn add( &mut self, key: BlobImageKey, data: Arc<BlobImageData>, visible_rect: &DeviceIntRect, tile_size: TileSize, )
Register a blob image.
sourcefn update(
&mut self,
key: BlobImageKey,
data: Arc<BlobImageData>,
visible_rect: &DeviceIntRect,
dirty_rect: &BlobDirtyRect,
)
fn update( &mut self, key: BlobImageKey, data: Arc<BlobImageData>, visible_rect: &DeviceIntRect, dirty_rect: &BlobDirtyRect, )
Update an already registered blob image.
sourcefn delete(&mut self, key: BlobImageKey)
fn delete(&mut self, key: BlobImageKey)
Delete an already registered blob image.
sourcefn delete_font(&mut self, key: FontKey)
fn delete_font(&mut self, key: FontKey)
A hook to let the handler clean up any state related to a font which the resource cache is about to delete.
sourcefn delete_font_instance(&mut self, key: FontInstanceKey)
fn delete_font_instance(&mut self, key: FontInstanceKey)
A hook to let the handler clean up any state related to a font instance which the resource cache is about to delete.
sourcefn clear_namespace(&mut self, namespace: IdNamespace)
fn clear_namespace(&mut self, namespace: IdNamespace)
A hook to let the handler clean up any state related a given namespace before the resource cache deletes them.
sourcefn enable_multithreading(&mut self, enable: bool)
fn enable_multithreading(&mut self, enable: bool)
Whether to allow rendering blobs on multiple threads.