Skip to main content

SurfacePresentState

Struct SurfacePresentState 

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

Surface generation and submission-outcome tracker retaining full pending frames across transient presentation failures.

Implementations§

Source§

impl SurfacePresentState

Surface generation and retry bookkeeping operations for SurfacePresentState.

Source

pub fn record_skipped_no_damage(&mut self)

Records an idle tick skipped due to zero damage.

§Arguments
  • &Self - Mutable surface presentation tracker.
Source

pub fn record_wait_in_flight(&mut self)

Records a bounded pipelining tick skipped because the in-flight frame queue was full.

§Arguments
  • &Self - Mutable surface presentation tracker.
Source

pub fn record_submitted(&mut self, present_timestamp_ns: Option<u64>)

Records a successful frame submission with an optional monotonic presentation timestamp in nanoseconds.

§Arguments
  • &Self - Mutable surface presentation tracker.
  • Option<u64> - Optional monotonic presentation timestamp in nanoseconds.
Source

pub fn record_submit_failed(&mut self)

Records a failed frame submission and arms automatic full-frame retry on the current surface generation.

§Arguments
  • &Self - Mutable surface presentation tracker.
Source

pub fn record_present_outcome( &mut self, outcome: PresentOutcome, present_timestamp_ns: Option<u64>, )

Records a unified PresentOutcome directly, updating retry state, counters, and optional presentation timestamp.

§Arguments
  • &Self - Mutable surface presentation tracker.
  • PresentOutcome - Observed presentation outcome for the current tick.
  • Option<u64> - Optional monotonic presentation timestamp in nanoseconds for Presented.
Source

pub fn advance_surface_generation(&mut self) -> u64

Advances the OS surface generation on surface loss/recreation and clears stale retries from old generations.

§Arguments
  • &Self - Mutable surface presentation tracker.
§Returns
  • u64 - Newly assigned monotonic surface generation.
Source

pub fn should_retry_same_generation(&self) -> bool

Returns true when a failed frame from the current surface generation must be retried immediately without waiting for new input.

§Arguments
  • &Self - Surface presentation tracker reference.
§Returns
  • bool - Whether a pending retry matches the active surface generation.
Source

pub fn present_timestamp_ns(&self) -> Option<u64>

Returns the most recent presentation timestamp in nanoseconds when available.

§Arguments
  • &Self - Surface presentation tracker reference.
§Returns
  • Option<u64> - Monotonic present timestamp in nanoseconds, or None when idle or unavailable.
Source§

impl SurfacePresentState

Source

pub fn get_surface_generation(&self) -> u64

Source

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

Source

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

Source

pub fn get_last_outcome(&self) -> FrameSubmitOutcome

Source

pub fn get_mut_last_outcome(&mut self) -> &mut FrameSubmitOutcome

Source

pub fn set_last_outcome(&mut self, val: FrameSubmitOutcome) -> &mut Self

Source

pub fn get_last_present_outcome(&self) -> PresentOutcome

Source

pub fn get_mut_last_present_outcome(&mut self) -> &mut PresentOutcome

Source

pub fn set_last_present_outcome(&mut self, val: PresentOutcome) -> &mut Self

Source

pub fn get_pending_retry_generation(&self) -> u64

Source

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

Source

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

Source

pub fn get_has_pending_retry(&self) -> bool

Source

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

Source

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

Source

pub fn get_retry_attempts(&self) -> u32

Source

pub fn get_mut_retry_attempts(&mut self) -> &mut u32

Source

pub fn set_retry_attempts(&mut self, val: u32) -> &mut Self

Source

pub fn get_total_submitted(&self) -> u64

Source

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

Source

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

Source

pub fn get_total_skipped(&self) -> u64

Source

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

Source

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

Source

pub fn get_total_wait_in_flight(&self) -> u64

Source

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

Source

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

Source

pub fn get_total_failed(&self) -> u64

Source

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

Source

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

Source

pub fn get_last_present_timestamp_ns(&self) -> u64

Source

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

Source

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

Source

pub fn get_has_present_timestamp(&self) -> bool

Source

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

Source

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

Trait Implementations§

Source§

impl Clone for SurfacePresentState

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 Copy for SurfacePresentState

Source§

impl Debug for SurfacePresentState

Source§

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

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

impl Default for SurfacePresentState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for SurfacePresentState

Source§

impl Hash for SurfacePresentState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SurfacePresentState

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 SurfacePresentState

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<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.