Skip to main content

ShowcaseWebDualCanvasCoordinator

Struct ShowcaseWebDualCanvasCoordinator 

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

Stacked dual-canvas handoff controller guaranteeing independent <canvas> targets and honest SubmissionProxy telemetry.

Implementations§

Source§

impl ShowcaseWebDualCanvasCoordinator

Independent-canvas pre-warming, atomic frame-boundary handoff, and proxy telemetry methods for ShowcaseWebDualCanvasCoordinator.

Source

pub fn with_initial_path( initial_path: ShowcaseWebPresentationPath, width: u32, height: u32, ) -> Self

Creates a coordinator starting with initial_path on canvas ID 1 (z_index = 1, visible = true).

§Arguments
  • ShowcaseWebPresentationPath - Initial presentation path.
  • u32 - Initial physical width in pixels.
  • u32 - Initial physical height in pixels.
§Returns
  • Self - Initialized dual-canvas coordinator.
Source

pub fn standby_slot(&self) -> Option<ShowcaseWebCanvasSlot>

Returns the currently pending hidden standby <canvas> slot, if any.

§Returns
  • Option<ShowcaseWebCanvasSlot> - Pending hidden standby slot.
Source

pub fn begin_switch( &mut self, target_path: ShowcaseWebPresentationPath, width: u32, height: u32, ) -> bool

Begins switching to target_path, allocating an independent hidden sibling <canvas> whenever switching context families (WebGl2 <-> Canvas2d).

§Arguments
  • ShowcaseWebPresentationPath - Candidate presentation path.
  • u32 - Target physical width in pixels.
  • u32 - Target physical height in pixels.
§Returns
  • bool - true when an independent hidden standby <canvas> was created; false when switched in-place within the same context family.
Source

pub fn mark_standby_ready( &mut self, width: u32, height: u32, scene_version: u64, ) -> bool

Marks the hidden standby <canvas> as pre-warmed and ready for atomic swap at (width, height, scene_version).

§Arguments
  • u32 - Rendered candidate physical width.
  • u32 - Rendered candidate physical height.
  • u64 - Rendered candidate scene revision.
§Returns
  • bool - true if a standby slot was present and marked ready.
Source

pub fn commit_at_frame_boundary( &mut self, expected_width: u32, expected_height: u32, expected_scene_version: u64, ) -> bool

Atomically swaps visibility and z_index at a frame boundary once the standby <canvas> matches (expected_width, expected_height, expected_scene_version), retiring the old canvas only after commit.

§Arguments
  • u32 - Expected physical width in pixels.
  • u32 - Expected physical height in pixels.
  • u64 - Expected scene revision.
§Returns
  • bool - true when swap committed; false when standby was missing or stale (aborting handoff and keeping old canvas active).
Source

pub fn abort_switch(&mut self)

Aborts any pending standby handoff without disturbing the visible active <canvas>.

Source

pub fn record_raf_proxy_tick(&mut self, upload_bytes: u64)

Records a browser requestAnimationFrame callback strictly as ShowcaseWebTimingSource::SubmissionProxy.

§Arguments
  • u64 - Framebuffer bytes uploaded on this tick (0 for GpuDirect).
Source§

impl ShowcaseWebDualCanvasCoordinator

Source

pub fn get_active(&self) -> ShowcaseWebCanvasSlot

Source

pub fn get_mut_active(&mut self) -> &mut ShowcaseWebCanvasSlot

Source

pub fn set_active(&mut self, val: ShowcaseWebCanvasSlot) -> &mut Self

Source

pub fn get_mut_standby(&mut self) -> &mut Option<ShowcaseWebCanvasSlot>

Source

pub fn set_standby(&mut self, val: Option<ShowcaseWebCanvasSlot>) -> &mut Self

Source

pub fn get_cpu_mirror_active(&self) -> bool

Source

pub fn get_mut_cpu_mirror_active(&mut self) -> &mut bool

Source

pub fn set_cpu_mirror_active(&mut self, val: bool) -> &mut Self

Source

pub fn get_timing_source(&self) -> ShowcaseWebTimingSource

Source

pub fn get_mut_timing_source(&mut self) -> &mut ShowcaseWebTimingSource

Source

pub fn set_timing_source(&mut self, val: ShowcaseWebTimingSource) -> &mut Self

Source

pub fn get_next_canvas_id(&self) -> u64

Source

pub fn get_mut_next_canvas_id(&mut self) -> &mut u64

Source

pub fn set_next_canvas_id(&mut self, val: u64) -> &mut Self

Source

pub fn get_completed_swaps(&self) -> u64

Source

pub fn get_mut_completed_swaps(&mut self) -> &mut u64

Source

pub fn set_completed_swaps(&mut self, val: u64) -> &mut Self

Source

pub fn get_aborted_swaps(&self) -> u64

Source

pub fn get_mut_aborted_swaps(&mut self) -> &mut u64

Source

pub fn set_aborted_swaps(&mut self, val: u64) -> &mut Self

Source

pub fn get_raf_proxy_ticks(&self) -> u64

Source

pub fn get_mut_raf_proxy_ticks(&mut self) -> &mut u64

Source

pub fn set_raf_proxy_ticks(&mut self, val: u64) -> &mut Self

Source

pub fn get_last_upload_bytes(&self) -> u64

Source

pub fn get_mut_last_upload_bytes(&mut self) -> &mut u64

Source

pub fn set_last_upload_bytes(&mut self, val: u64) -> &mut Self

Source

pub fn get_retired_canvas_ids(&self) -> &Vec<u64>

Source

pub fn get_mut_retired_canvas_ids(&mut self) -> &mut Vec<u64>

Source

pub fn set_retired_canvas_ids(&mut self, val: Vec<u64>) -> &mut Self

Trait Implementations§

Source§

impl Clone for ShowcaseWebDualCanvasCoordinator

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ShowcaseWebDualCanvasCoordinator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ShowcaseWebDualCanvasCoordinator

Default initialization for ShowcaseWebDualCanvasCoordinator starting on WebGL2 GpuUpload.

Source§

fn default() -> Self

Creates a dual-canvas coordinator with a single visible WebGL2 foreground canvas.

§Returns
  • Self - Initialized coordinator with honest SubmissionProxy timing.
Source§

impl Eq for ShowcaseWebDualCanvasCoordinator

Source§

impl PartialEq for ShowcaseWebDualCanvasCoordinator

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ShowcaseWebDualCanvasCoordinator

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.