azul_webrender::render_api

Struct RenderApi

Source
pub struct RenderApi { /* private fields */ }
Expand description

The main entry point to interact with WebRender.

Implementations§

Source§

impl RenderApi

Source

pub fn get_namespace_id(&self) -> IdNamespace

Returns the namespace ID used by this API object.

Source

pub fn create_sender(&self) -> RenderApiSender

Source

pub fn add_document(&self, initial_size: DeviceIntSize) -> DocumentId

Add a document to the WebRender instance.

Instances can manage one or several documents (using the same render backend thread). Each document will internally correspond to a single scene, and scenes are made of one or several pipelines.

Source

pub fn add_document_with_id( &self, initial_size: DeviceIntSize, id: u32, ) -> DocumentId

See add_document

Source

pub fn delete_document(&self, document_id: DocumentId)

Delete a document.

Source

pub fn generate_font_key(&self) -> FontKey

Generate a new font key

Source

pub fn generate_font_instance_key(&self) -> FontInstanceKey

Generate a new font instance key

Source

pub fn get_glyph_dimensions( &self, key: FontInstanceKey, glyph_indices: Vec<GlyphIndex>, ) -> Vec<Option<GlyphDimensions>>

Gets the dimensions for the supplied glyph keys

Note: Internally, the internal texture cache doesn’t store ‘empty’ textures (height or width = 0) This means that glyph dimensions e.g. for spaces (’ ’) will mostly be None.

Source

pub fn get_glyph_indices(&self, key: FontKey, text: &str) -> Vec<Option<u32>>

Gets the glyph indices for the supplied string. These can be used to construct GlyphKeys.

Source

pub fn generate_image_key(&self) -> ImageKey

Creates an ImageKey.

Source

pub fn generate_blob_image_key(&self) -> BlobImageKey

Creates a BlobImageKey.

Source

pub fn send_external_event(&self, evt: ExternalEvent)

A Gecko-specific notification mechanism to get some code executed on the Renderer’s thread, mostly replaced by NotificationHandler. You should probably use the latter instead.

Source

pub fn notify_memory_pressure(&self)

Notify WebRender that now is a good time to flush caches and release as much memory as possible.

Source

pub fn report_memory(&self, _ops: MallocSizeOfOps) -> MemoryReport

Synchronously requests memory report.

Source

pub fn set_debug_flags(&self, flags: DebugFlags)

Update debugging flags.

Source

pub fn stop_render_backend(&self)

Stop RenderBackend’s task until shut down

Source

pub fn shut_down(&self, synchronously: bool)

Shut the WebRender instance down.

Source

pub fn generate_property_binding_key<T: Copy>(&self) -> PropertyBindingKey<T>

Create a new unique key that can be used for animated property bindings.

Source

pub fn send_transaction( &mut self, document_id: DocumentId, transaction: Transaction, )

Send a transaction to WebRender.

Source

pub fn hit_test( &self, document_id: DocumentId, pipeline_id: Option<PipelineId>, point: WorldPoint, ) -> HitTestResult

Does a hit test on display items in the specified document, at the given point. If a pipeline_id is specified, it is used to further restrict the hit results so that only items inside that pipeline are matched. The vector of hit results will contain all display items that match, ordered from front to back.

Source

pub fn request_hit_tester(&self, document_id: DocumentId) -> HitTesterRequest

Synchronously request an object that can perform fast hit testing queries.

Source

pub fn get_scroll_node_state( &self, document_id: DocumentId, ) -> Vec<ScrollNodeState>

Source

pub fn flush_scene_builder(&self)

Block until a round-trip to the scene builder thread has completed. This ensures that any transactions (including ones deferred to the scene builder thread) have been processed.

Source

pub fn save_capture(&self, path: PathBuf, bits: CaptureBits)

Save a capture of the current frame state for debugging.

Source

pub fn load_capture( &self, path: PathBuf, ids: Option<(u32, u32)>, ) -> Vec<CapturedDocument>

Load a capture of the current frame state for debugging.

Source

pub fn start_capture_sequence(&self, path: PathBuf, bits: CaptureBits)

Start capturing a sequence of frames.

Source

pub fn stop_capture_sequence(&self)

Stop capturing sequences of frames.

Source

pub fn send_debug_cmd(&mut self, cmd: DebugCommand)

Update the state of builtin debugging facilities.

Trait Implementations§

Source§

impl Drop for RenderApi

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.