pub struct DrawOp<'a> {
pub id: Option<u32>,
pub bounds: Region,
pub clip: Region,
pub clip_radius: u8,
pub subpx_q4: u8,
pub payload: DrawPayload<'a>,
}Expand description
扁平化一维渲染指令。
Fields§
§id: Option<u32>关联的元素 ID(用于 $O(1)$ 匹配上一帧指令触发过渡动画)。
bounds: Region屏幕绝对坐标矩形。
clip: Region父级裁剪区(用于滚动视图与圆角容器裁剪)。
clip_radius: u8父级裁剪圆角半径(逻辑像素;0 表示轴对齐直角裁剪,非零时启用抗锯齿圆角 SDF 裁切)。
subpx_q4: u8亚像素动画平移残差(利用结构体原有对齐空洞,0 字节膨胀;高 4 位 dx_q4、低 4 位 dy_q4,单位 1/16 px)。
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 字节紧凑绘制快照。
Sourcepub fn effective_damage_bounds(&self) -> Region
pub fn effective_damage_bounds(&self) -> Region
计算本条绘制指令实际可能触及的逻辑像素包围盒(供 DamageTracker 与 DrawOpSnapshot 共用)。
对单行 / nowrap TextRun 同步覆盖与 compute_scaled_text_box 同源的横向/纵向外扩范围(受 self.clip 裁剪),
确保溢出布局框的长文本在变更或删除时均生成完整脏区,杜绝持久渲染目标局部重绘残影。
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>where
&'static str: Freeze,
&'a str: Freeze,
&'a [u8]: Freeze,
&'a dyn Fn(&mut dyn SurfacePainter): Freeze,
&'a StyledQuad<'a>: Freeze,
&'a LayerSpec<'a>: Freeze,
&'a ExternalTextureSpec: Freeze,
&'a RichTextSpec<'a>: Freeze,
&'a DecodedImageSpec: Freeze,
&'a VectorDrawSpec<'a>: Freeze,
&'a SceneCanvasSpec<'a>: Freeze,
impl<'a> Move for DrawOp<'a>
impl<'a> Unpin for DrawOp<'a>where
&'static str: Unpin,
&'a str: Unpin,
&'a [u8]: Unpin,
&'a dyn Fn(&mut dyn SurfacePainter): Unpin,
&'a StyledQuad<'a>: Unpin,
&'a LayerSpec<'a>: Unpin,
&'a ExternalTextureSpec: Unpin,
&'a RichTextSpec<'a>: Unpin,
&'a DecodedImageSpec: Unpin,
&'a VectorDrawSpec<'a>: Unpin,
&'a SceneCanvasSpec<'a>: Unpin,
impl<'a> UnsafeUnpin for DrawOp<'a>where
&'static str: UnsafeUnpin,
&'a str: UnsafeUnpin,
&'a [u8]: UnsafeUnpin,
&'a dyn Fn(&mut dyn SurfacePainter): UnsafeUnpin,
&'a StyledQuad<'a>: UnsafeUnpin,
&'a LayerSpec<'a>: UnsafeUnpin,
&'a ExternalTextureSpec: UnsafeUnpin,
&'a RichTextSpec<'a>: UnsafeUnpin,
&'a DecodedImageSpec: UnsafeUnpin,
&'a VectorDrawSpec<'a>: UnsafeUnpin,
&'a SceneCanvasSpec<'a>: UnsafeUnpin,
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) 时执行闭包修饰自身,否则原样返回。