pub struct LayerPaint {
pub layer_id: LayerId,
pub paint_list: Rc<PaintList>,
pub is_dirty: bool,
pub parent: Option<LayerId>,
pub offset: Point,
pub logical_size: Option<Size>,
pub effect: LayerEffect,
}Expand description
单个 layer 的 paint 输出
阶段 4-A 引入:
is_dirty = true:paint_list是本帧新生成的,Renderer 需要画到 surfaceis_dirty = false:paint_list是 cache 里的旧版,Renderer 阶段 4-A 仍画 (因为没 GPU cache);阶段 4-B 会用 GPU texture 缓存,Renderer 看到 false 就 不重画,直接 blit cache texture 到 surface
阶段 4-D 扩展:
offset:layer 在父 layer (或 root) 内的 logical offset,Pass 2 blit 时 按这个 offset 把 layer texture 画到 surface 的 (offset.x, offset.y) 位置logical_size:layer 的 logical size(从 RO.content_size 写入)。Some(s)时 layer texture 用 s 大小(省 fillrate);None时 fallback 全屏
Fields§
§layer_id: LayerId§paint_list: Rc<PaintList>与 Layer.cached_paint_list 共享同一份命令列表;clean layer 零拷贝。
is_dirty: bool§parent: Option<LayerId>父 layer(None = 顶层/虚拟 root) Renderer 用它递归累加祖先的 transform/opacity/clip。
offset: Pointlayer 在 surface 内的 logical offset(已累加祖先 layer 偏移)
logical_size: Option<Size>阶段 4-D:layer 的 logical size(用于 Renderer 决定 texture 物理大小)
effect: LayerEffect阶段 5:layer 合成到父 layer/surface 时的视觉效果 Renderer Pass 2 blit 时按 effect 走 shader 分支
Auto Trait Implementations§
impl !Send for LayerPaint
impl !Sync for LayerPaint
impl Forget for LayerPaint
impl Freeze for LayerPaint
impl Move for LayerPaint
impl RefUnwindSafe for LayerPaint
impl Unpin for LayerPaint
impl UnsafeUnpin for LayerPaintwhere
NonZeroU32Inner: UnsafeUnpin,
*const RcInner<PaintList> is !null: UnsafeUnpin,
PhantomData<RcInner<PaintList>>: UnsafeUnpin,
impl UnwindSafe for LayerPaint
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