#[repr(C)]pub struct GpuTransformId(pub u32);Expand description
Represents the information about a transform palette entry that is passed to shaders. It includes an index into the transform palette, and a set of flags.
Tuple Fields§
§0: u32Implementations§
Source§impl GpuTransformId
impl GpuTransformId
const INDEX_MASK: u32 = 0x003fffff
Sourceconst AXIS_ALIGNED_2D_BIT: u32
const AXIS_ALIGNED_2D_BIT: u32
if not set, the transform is axis-aligned.
Sourceconst SCALE_OFFSET_2D_BIT: u32
const SCALE_OFFSET_2D_BIT: u32
If not set, the transform can be represented as a 2d scale + offset.
Sourcepub fn transform_kind(&self) -> TransformedRectKind
pub fn transform_kind(&self) -> TransformedRectKind
Extract the transform kind from the id.
Sourcepub fn is_2d_axis_aligned(&self) -> bool
pub fn is_2d_axis_aligned(&self) -> bool
Note: There are transformations that preserve axis-alignment without being scale + offsets.
Sourcepub fn is_2d_scale_offset(&self) -> bool
pub fn is_2d_scale_offset(&self) -> bool
Returns true if the transform can be represented by a 2d scale + offset.
pub fn metadata(&self) -> TransformMetadata
Sourcepub fn override_transform_kind(&self, kind: TransformedRectKind) -> Self
pub fn override_transform_kind(&self, kind: TransformedRectKind) -> Self
Override the kind of transform stored in this id. This can be useful in cases where we don’t want shaders to consider certain transforms axis- aligned (i.e. perspective warp) even though we may still want to for the general case.
Trait Implementations§
Source§impl Clone for GpuTransformId
impl Clone for GpuTransformId
Source§fn clone(&self) -> GpuTransformId
fn clone(&self) -> GpuTransformId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GpuTransformId
impl Debug for GpuTransformId
Source§impl MallocSizeOf for GpuTransformId
impl MallocSizeOf for GpuTransformId
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl PartialEq for GpuTransformId
impl PartialEq for GpuTransformId
Source§impl Serialize for GpuTransformId
impl Serialize for GpuTransformId
impl Copy for GpuTransformId
impl StructuralPartialEq for GpuTransformId
Auto Trait Implementations§
impl Freeze for GpuTransformId
impl RefUnwindSafe for GpuTransformId
impl Send for GpuTransformId
impl Sync for GpuTransformId
impl Unpin for GpuTransformId
impl UnsafeUnpin for GpuTransformId
impl UnwindSafe for GpuTransformId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more