Struct webrender_api::RenderApi
[−]
[src]
pub struct RenderApi { /* fields omitted */ }
Methods
impl RenderApi
[src]
pub fn get_namespace_id(&self) -> IdNamespace
[src]
pub fn clone_sender(&self) -> RenderApiSender
[src]
pub fn add_document(
&self,
initial_size: DeviceUintSize,
layer: DocumentLayer
) -> DocumentId
[src]
&self,
initial_size: DeviceUintSize,
layer: DocumentLayer
) -> DocumentId
pub fn delete_document(&self, document_id: DocumentId)
[src]
pub fn generate_font_key(&self) -> FontKey
[src]
pub fn generate_font_instance_key(&self) -> FontInstanceKey
[src]
pub fn get_glyph_dimensions(
&self,
font: FontInstanceKey,
glyph_keys: Vec<GlyphKey>
) -> Vec<Option<GlyphDimensions>>
[src]
&self,
font: FontInstanceKey,
glyph_keys: Vec<GlyphKey>
) -> 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.
pub fn get_glyph_indices(
&self,
font_key: FontKey,
text: &str
) -> Vec<Option<u32>>
[src]
&self,
font_key: FontKey,
text: &str
) -> Vec<Option<u32>>
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 update_resources(&self, resources: ResourceUpdates)
[src]
Add/remove/update resources such as images and fonts.
pub fn update_pipeline_resources(
&self,
resources: ResourceUpdates,
document_id: DocumentId,
pipeline_id: PipelineId,
epoch: Epoch
)
[src]
&self,
resources: ResourceUpdates,
document_id: DocumentId,
pipeline_id: PipelineId,
epoch: Epoch
)
Add/remove/update resources such as images and fonts.
This is similar to update_resources with the addition that it allows updating a pipeline's epoch.
pub fn send_external_event(&self, evt: ExternalEvent)
[src]
pub fn notify_memory_pressure(&self)
[src]
pub fn shut_down(&self)
[src]
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 set_root_pipeline(
&self,
document_id: DocumentId,
pipeline_id: PipelineId
)
[src]
&self,
document_id: DocumentId,
pipeline_id: PipelineId
)
Sets the root pipeline.
Examples
let api = sender.create_api(); let document_id = api.add_document(DeviceUintSize::zero(), 0); let pipeline_id = PipelineId(0, 0); api.set_root_pipeline(document_id, pipeline_id);
pub fn remove_pipeline(&self, document_id: DocumentId, pipeline_id: PipelineId)
[src]
Removes data associated with a pipeline from the internal data structures.
If the specified pipeline_id
is for the root pipeline, the root pipeline
is reset back to None
.
pub fn set_display_list(
&self,
document_id: DocumentId,
epoch: Epoch,
background: Option<ColorF>,
viewport_size: LayoutSize,
(pipeline_id, content_size, display_list): (PipelineId, LayoutSize, BuiltDisplayList),
preserve_frame_state: bool,
resources: ResourceUpdates
)
[src]
&self,
document_id: DocumentId,
epoch: Epoch,
background: Option<ColorF>,
viewport_size: LayoutSize,
(pipeline_id, content_size, display_list): (PipelineId, LayoutSize, BuiltDisplayList),
preserve_frame_state: bool,
resources: ResourceUpdates
)
Supplies a new frame to WebRender.
Non-blocking, it notifies a worker process which processes the display list.
When it's done and a RenderNotifier
has been set in webrender::Renderer
,
new_document_ready() gets called.
Note: Scrolling doesn't require an own Frame.
Arguments:
document_id
: Target Document ID.epoch
: The unique Frame ID, monotonically increasing.background
: The background color of this pipeline.viewport_size
: The size of the viewport for this frame.pipeline_id
: The ID of the pipeline that is supplying this display list.content_size
: The total screen space size of this display list's display items.display_list
: The root Display list used in this frame.preserve_frame_state
: If a previous frame exists which matches this pipeline id, this setting determines if frame state (such as scrolling position) should be preserved for this new display list.resources
: A set of resource updates that must be applied at the same time as the display list.
pub fn send_transaction(
&mut self,
document_id: DocumentId,
transaction: Transaction
)
[src]
&mut self,
document_id: DocumentId,
transaction: Transaction
)
pub fn scroll(
&self,
document_id: DocumentId,
scroll_location: ScrollLocation,
cursor: WorldPoint,
phase: ScrollEventPhase
)
[src]
&self,
document_id: DocumentId,
scroll_location: ScrollLocation,
cursor: WorldPoint,
phase: ScrollEventPhase
)
Scrolls the scrolling layer under the cursor
WebRender looks for the layer closest to the user
which has ScrollPolicy::Scrollable
set.
pub fn scroll_node_with_id(
&self,
document_id: DocumentId,
origin: LayoutPoint,
id: ClipId,
clamp: ScrollClamping
)
[src]
&self,
document_id: DocumentId,
origin: LayoutPoint,
id: ClipId,
clamp: ScrollClamping
)
pub fn hit_test(
&self,
document_id: DocumentId,
pipeline_id: Option<PipelineId>,
point: WorldPoint,
flags: HitTestFlags
) -> HitTestResult
[src]
&self,
document_id: DocumentId,
pipeline_id: Option<PipelineId>,
point: WorldPoint,
flags: HitTestFlags
) -> 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. 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_page_zoom(&self, document_id: DocumentId, page_zoom: ZoomFactor)
[src]
pub fn set_pinch_zoom(&self, document_id: DocumentId, pinch_zoom: ZoomFactor)
[src]
pub fn set_pan(&self, document_id: DocumentId, pan: DeviceIntPoint)
[src]
pub fn set_window_parameters(
&self,
document_id: DocumentId,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
[src]
&self,
document_id: DocumentId,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
pub fn tick_scrolling_bounce_animations(&self, document_id: DocumentId)
[src]
pub fn get_scroll_node_state(
&self,
document_id: DocumentId
) -> Vec<ScrollLayerState>
[src]
&self,
document_id: DocumentId
) -> Vec<ScrollLayerState>
pub fn enable_frame_output(
&self,
document_id: DocumentId,
pipeline_id: PipelineId,
enable: bool
)
[src]
&self,
document_id: DocumentId,
pipeline_id: PipelineId,
enable: bool
)
Enable copying of the output of this pipeline id to an external texture for callers to consume.
pub fn generate_frame(
&self,
document_id: DocumentId,
property_bindings: Option<DynamicProperties>
)
[src]
&self,
document_id: DocumentId,
property_bindings: Option<DynamicProperties>
)
Generate a new frame. Optionally, supply a list of animated property bindings that should be used to resolve bindings in the current display list.
pub fn save_capture(&self, path: PathBuf)
[src]
Save a capture of the current frame state for debugging.
pub fn load_capture(&self, path: PathBuf)
[src]
Load a capture of the current frame state for debugging.