[][src]Struct webrender_api::RenderApi

pub struct RenderApi { /* fields omitted */ }

The main entry point to interact with WebRender.

Methods

impl RenderApi[src]

pub fn get_namespace_id(&self) -> IdNamespace[src]

Returns the namespace ID used by this API object.

pub fn clone_sender(&self) -> RenderApiSender[src]

pub fn add_document(
    &self,
    initial_size: DeviceIntSize,
    layer: DocumentLayer
) -> DocumentId
[src]

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.

pub fn add_document_with_id(
    &self,
    initial_size: DeviceIntSize,
    layer: DocumentLayer,
    id: u32
) -> DocumentId
[src]

See add_document

pub fn delete_document(&self, document_id: DocumentId)[src]

Delete a document.

pub fn generate_font_key(&self) -> FontKey[src]

Generate a new font key

pub fn generate_font_instance_key(&self) -> FontInstanceKey[src]

Generate a new font instance key

pub fn get_glyph_dimensions(
    &self,
    font: FontInstanceKey,
    glyph_indices: Vec<GlyphIndex>
) -> Vec<Option<GlyphDimensions>>
[src]

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.

pub fn get_glyph_indices(
    &self,
    font_key: FontKey,
    text: &str
) -> Vec<Option<u32>>
[src]

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

pub fn generate_image_key(&self) -> ImageKey[src]

Creates an ImageKey.

pub fn generate_blob_image_key(&self) -> BlobImageKey[src]

Creates a BlobImageKey.

pub fn update_resources(&self, resources: Vec<ResourceUpdate>)[src]

Add/remove/update resources such as images and fonts.

pub fn send_external_event(&self, evt: ExternalEvent)[src]

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.

pub fn notify_memory_pressure(&self)[src]

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

pub fn report_memory(&self) -> MemoryReport[src]

Synchronously requests memory report.

pub fn set_debug_flags(&self, flags: DebugFlags)[src]

Update debugging flags.

pub fn shut_down(&self, synchronously: bool)[src]

Shut the WebRender instance down.

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

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

pub fn send_transaction(
    &self,
    document_id: DocumentId,
    transaction: Transaction
)
[src]

Send a transaction to WebRender.

pub fn send_transactions(
    &self,
    document_ids: Vec<DocumentId>,
    transactions: Vec<Transaction>
)
[src]

Send multiple transactions.

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

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. If the HitTestFlags argument contains the FIND_ALL flag, then the vector of hit results will contain all display items that match, ordered from front to back.

pub fn set_document_view(
    &self,
    document_id: DocumentId,
    device_rect: DeviceIntRect,
    device_pixel_ratio: f32
)
[src]

Setup the output region in the framebuffer for a given document.

pub fn enable_frame_output(
    &self,
    document_id: DocumentId,
    pipeline_id: PipelineId,
    enable: bool
)
[src]

Setup the output region in the framebuffer for a given document. Enable copying of the output of this pipeline id to an external texture for callers to consume.

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

pub fn flush_scene_builder(&self)[src]

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.

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

Save a capture of the current frame state for debugging.

pub fn load_capture(&self, path: PathBuf) -> Vec<CapturedDocument>[src]

Load a capture of the current frame state for debugging.

pub fn send_debug_cmd(&self, cmd: DebugCommand)[src]

Update the state of builtin debugging facilities.

Trait Implementations

impl Drop for RenderApi[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.