Struct webrender_api::Transaction
[−]
[src]
pub struct Transaction { /* fields omitted */ }
A Transaction is a group of commands to apply atomically to a document.
This mechanism ensures that: - no other message can be interleaved between two commands that need to be applied together. - no redundant work is performed if two commands in the same transaction cause the scene or the frame to be rebuilt.
Methods
impl Transaction
[src]
pub fn new() -> Self
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn update_epoch(&mut self, pipeline_id: PipelineId, epoch: Epoch)
[src]
pub fn set_root_pipeline(&mut self, pipeline_id: PipelineId)
[src]
Sets the root pipeline.
Examples
let pipeline_id = PipelineId(0, 0); let mut txn = Transaction::new(); txn.set_root_pipeline(pipeline_id);
pub fn remove_pipeline(&mut self, 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(
&mut self,
epoch: Epoch,
background: Option<ColorF>,
viewport_size: LayoutSize,
(pipeline_id, content_size, display_list): (PipelineId, LayoutSize, BuiltDisplayList),
preserve_frame_state: bool
)
[src]
&mut self,
epoch: Epoch,
background: Option<ColorF>,
viewport_size: LayoutSize,
(pipeline_id, content_size, display_list): (PipelineId, LayoutSize, BuiltDisplayList),
preserve_frame_state: bool
)
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_frame_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 update_resources(&mut self, resources: ResourceUpdates)
[src]
pub fn set_window_parameters(
&mut self,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
[src]
&mut self,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
pub fn scroll(
&mut self,
scroll_location: ScrollLocation,
cursor: WorldPoint,
phase: ScrollEventPhase
)
[src]
&mut self,
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(
&mut self,
origin: LayoutPoint,
id: ClipId,
clamp: ScrollClamping
)
[src]
&mut self,
origin: LayoutPoint,
id: ClipId,
clamp: ScrollClamping
)
pub fn set_page_zoom(&mut self, page_zoom: ZoomFactor)
[src]
pub fn set_pinch_zoom(&mut self, pinch_zoom: ZoomFactor)
[src]
pub fn set_pan(&mut self, pan: DeviceIntPoint)
[src]
pub fn tick_scrolling_bounce_animations(&mut self)
[src]
pub fn generate_frame(&mut self)
[src]
Generate a new frame.
pub fn update_dynamic_properties(&mut self, properties: DynamicProperties)
[src]
Supply a list of animated property bindings that should be used to resolve bindings in the current display list.