[−][src]Struct webrender_api::Transaction
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.
Fields
resource_updates: Vec<ResourceUpdate>
Methods
impl Transaction
[src]
impl Transaction
pub fn new() -> Self
[src]
pub fn new() -> Self
pub fn skip_scene_builder(&mut self)
[src]
pub fn skip_scene_builder(&mut self)
pub fn use_scene_builder_thread(&mut self)
[src]
pub fn use_scene_builder_thread(&mut self)
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn update_epoch(&mut self, pipeline_id: PipelineId, epoch: Epoch)
[src]
pub fn update_epoch(&mut self, pipeline_id: PipelineId, epoch: Epoch)
pub fn set_root_pipeline(&mut self, pipeline_id: PipelineId)
[src]
pub fn set_root_pipeline(&mut self, pipeline_id: PipelineId)
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]
pub fn remove_pipeline(&mut self, pipeline_id: PipelineId)
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]
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
)
Supplies a new frame to WebRender.
Non-blocking, it notifies a worker process which processes the display list.
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.
pub fn update_resources(&mut self, resources: Vec<ResourceUpdate>)
[src]
pub fn update_resources(&mut self, resources: Vec<ResourceUpdate>)
pub fn notify(&mut self, event: NotificationRequest)
[src]
pub fn notify(&mut self, event: NotificationRequest)
Trigger a notification at a certain stage of the rendering pipeline.
Not that notification requests are skipped during serialization, so is is best to use them for synchronization purposes and not for things that could affect the WebRender's state.
pub fn set_window_parameters(
&mut self,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
[src]
pub fn set_window_parameters(
&mut self,
window_size: DeviceUintSize,
inner_rect: DeviceUintRect,
device_pixel_ratio: f32
)
pub fn scroll(&mut self, scroll_location: ScrollLocation, cursor: WorldPoint)
[src]
pub fn scroll(&mut self, scroll_location: ScrollLocation, cursor: WorldPoint)
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: ExternalScrollId,
clamp: ScrollClamping
)
[src]
pub fn scroll_node_with_id(
&mut self,
origin: LayoutPoint,
id: ExternalScrollId,
clamp: ScrollClamping
)
pub fn set_page_zoom(&mut self, page_zoom: ZoomFactor)
[src]
pub fn set_page_zoom(&mut self, page_zoom: ZoomFactor)
pub fn set_pinch_zoom(&mut self, pinch_zoom: ZoomFactor)
[src]
pub fn set_pinch_zoom(&mut self, pinch_zoom: ZoomFactor)
pub fn set_pan(&mut self, pan: DeviceIntPoint)
[src]
pub fn set_pan(&mut self, pan: DeviceIntPoint)
pub fn generate_frame(&mut self)
[src]
pub fn generate_frame(&mut self)
Generate a new frame. When it's done and a RenderNotifier has been set
in webrender::Renderer
, new_frame_ready() gets called.
Note that the notifier is called even if the frame generation was a
no-op; the arguments passed to new_frame_ready
will provide information
as to when happened.
pub fn update_dynamic_properties(&mut self, properties: DynamicProperties)
[src]
pub fn update_dynamic_properties(&mut self, properties: DynamicProperties)
Supply a list of animated property bindings that should be used to resolve bindings in the current display list.
pub fn append_dynamic_properties(&mut self, properties: DynamicProperties)
[src]
pub fn append_dynamic_properties(&mut self, properties: DynamicProperties)
Add to the list of animated property bindings that should be used to resolve bindings in the current display list. This is a convenience method so the caller doesn't have to figure out all the dynamic properties before setting them on the transaction but can do them incrementally.
pub fn enable_frame_output(&mut self, pipeline_id: PipelineId, enable: bool)
[src]
pub fn enable_frame_output(&mut self, pipeline_id: PipelineId, enable: bool)
Enable copying of the output of this pipeline id to an external texture for callers to consume.
pub fn get_frame_ops(self) -> Vec<FrameMsg>
[src]
pub fn get_frame_ops(self) -> Vec<FrameMsg>
Consumes this object and just returns the frame ops.
pub fn add_image(
&mut self,
key: ImageKey,
descriptor: ImageDescriptor,
data: ImageData,
tiling: Option<TileSize>
)
[src]
pub fn add_image(
&mut self,
key: ImageKey,
descriptor: ImageDescriptor,
data: ImageData,
tiling: Option<TileSize>
)
pub fn update_image(
&mut self,
key: ImageKey,
descriptor: ImageDescriptor,
data: ImageData,
dirty_rect: Option<DeviceUintRect>
)
[src]
pub fn update_image(
&mut self,
key: ImageKey,
descriptor: ImageDescriptor,
data: ImageData,
dirty_rect: Option<DeviceUintRect>
)
pub fn delete_image(&mut self, key: ImageKey)
[src]
pub fn delete_image(&mut self, key: ImageKey)
pub fn set_image_visible_area(&mut self, key: ImageKey, area: DeviceUintRect)
[src]
pub fn set_image_visible_area(&mut self, key: ImageKey, area: DeviceUintRect)
pub fn add_raw_font(&mut self, key: FontKey, bytes: Vec<u8>, index: u32)
[src]
pub fn add_raw_font(&mut self, key: FontKey, bytes: Vec<u8>, index: u32)
pub fn add_native_font(&mut self, key: FontKey, native_handle: NativeFontHandle)
[src]
pub fn add_native_font(&mut self, key: FontKey, native_handle: NativeFontHandle)
pub fn delete_font(&mut self, key: FontKey)
[src]
pub fn delete_font(&mut self, key: FontKey)
pub fn add_font_instance(
&mut self,
key: FontInstanceKey,
font_key: FontKey,
glyph_size: Au,
options: Option<FontInstanceOptions>,
platform_options: Option<FontInstancePlatformOptions>,
variations: Vec<FontVariation>
)
[src]
pub fn add_font_instance(
&mut self,
key: FontInstanceKey,
font_key: FontKey,
glyph_size: Au,
options: Option<FontInstanceOptions>,
platform_options: Option<FontInstancePlatformOptions>,
variations: Vec<FontVariation>
)
pub fn delete_font_instance(&mut self, key: FontInstanceKey)
[src]
pub fn delete_font_instance(&mut self, key: FontInstanceKey)
pub fn set_low_priority(&mut self, low_priority: bool)
[src]
pub fn set_low_priority(&mut self, low_priority: bool)
pub fn is_low_priority(&self) -> bool
[src]
pub fn is_low_priority(&self) -> bool
pub fn merge(&mut self, other: Vec<ResourceUpdate>)
[src]
pub fn merge(&mut self, other: Vec<ResourceUpdate>)
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Auto Trait Implementations
impl Send for Transaction
impl Send for Transaction
impl !Sync for Transaction
impl !Sync for Transaction
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more