pub trait BlobExtension: Send + Any {
// Required methods
fn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobRasterizer>;
fn create_similar(&self) -> Box<dyn BlobExtension>;
fn add(&mut self, args: &BlobAddArgs);
fn update(&mut self, args: &BlobUpdateArgs);
fn delete(&mut self, key: BlobImageKey);
fn enable_multithreading(&mut self, enable: bool);
// Provided methods
fn prepare_resources(&mut self, args: &mut BlobPrepareArgs<'_>) { ... }
fn delete_font(&mut self, key: FontKey) { ... }
fn delete_font_instance(&mut self, key: FontInstanceKey) { ... }
fn clear_namespace(&mut self, namespace: IdNamespace) { ... }
}Expand description
Represents a Webrender blob handler that can coexist with other blob handlers on the same renderer.
This API is very similar to Webrender’s BlobImageHandler, the only difference is that implementers
are expected to detect and ignore requests targeting other blob extensions as multiple extensions may
implement blob renderers.
See RendererConfigArgs::blobs for more details.
Required Methods§
Sourcefn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobRasterizer>
fn create_blob_rasterizer(&mut self) -> Box<dyn AsyncBlobRasterizer>
Creates a snapshot of the current state of blob images in the handler.
Sourcefn create_similar(&self) -> Box<dyn BlobExtension>
fn create_similar(&self) -> Box<dyn BlobExtension>
New blob extension instance of the same type.
Sourcefn add(&mut self, args: &BlobAddArgs)
fn add(&mut self, args: &BlobAddArgs)
Register a blob image if the request addresses this extension.
Sourcefn update(&mut self, args: &BlobUpdateArgs)
fn update(&mut self, args: &BlobUpdateArgs)
Update a blob image if the request addresses this extension.
Sourcefn delete(&mut self, key: BlobImageKey)
fn delete(&mut self, key: BlobImageKey)
Remove a blob image if the key was generated by this extension.
Sourcefn enable_multithreading(&mut self, enable: bool)
fn enable_multithreading(&mut self, enable: bool)
Sets if multi-threading is allowed.
The default is true, this method is only called on init if multithreading is disabled.
Provided Methods§
Sourcefn prepare_resources(&mut self, args: &mut BlobPrepareArgs<'_>)
fn prepare_resources(&mut self, args: &mut BlobPrepareArgs<'_>)
Prepare resources that are not bundled in with the encoded request commands.
The extension must ignore requests not addressing it.
Sourcefn delete_font(&mut self, key: FontKey)
fn delete_font(&mut self, key: FontKey)
Cleanup any prepared resource for the font.
Sourcefn delete_font_instance(&mut self, key: FontInstanceKey)
fn delete_font_instance(&mut self, key: FontInstanceKey)
Cleanup any prepared resource for the font instance.
Sourcefn clear_namespace(&mut self, namespace: IdNamespace)
fn clear_namespace(&mut self, namespace: IdNamespace)
Cleanup any state related with the namespace.