pub struct DrawOp<'a> {
pub id: Option<u32>,
pub bounds: Region,
pub clip: Region,
pub clip_radius: u8,
pub payload: DrawPayload<'a>,
}Expand description
扁平化一维渲染指令。
Fields§
§id: Option<u32>关联的元素 ID(用于 $O(1)$ 匹配上一帧指令触发过渡动画)。
bounds: Region屏幕绝对坐标矩形。
clip: Region父级裁剪区(用于滚动视图与圆角容器裁剪)。
clip_radius: u8父级裁剪圆角半径(逻辑像素;0 表示轴对齐直角裁剪,非零时启用抗锯齿圆角 SDF 裁切)。
payload: DrawPayload<'a>绘制负载数据。
Implementations§
Source§impl<'a> DrawOp<'a>
impl<'a> DrawOp<'a>
Sourcepub fn to_snapshot(&self) -> DrawOpSnapshot
pub fn to_snapshot(&self) -> DrawOpSnapshot
生成与 'a 生命周期无关的 12 字节紧凑绘制快照。
Trait Implementations§
impl<'a> Copy for DrawOp<'a>
impl<'a> Eq for DrawOp<'a>
impl<'a> StructuralPartialEq for DrawOp<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DrawOp<'a>
impl<'a> !Send for DrawOp<'a>
impl<'a> !Sync for DrawOp<'a>
impl<'a> !UnwindSafe for DrawOp<'a>
impl<'a> Forget for DrawOp<'a>
impl<'a> Freeze for DrawOp<'a>
impl<'a> Move for DrawOp<'a>
impl<'a> Unpin for DrawOp<'a>
impl<'a> UnsafeUnpin for DrawOp<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。