pub enum LayerEffect {
None,
Transform(Transform2D),
Opacity(f32),
ClipRRect(RRectDef),
}Expand description
layer 合成到父 layer/surface 时的视觉效果
嵌套 layer 树语义:child layer 的 effect 是相对于 parent layer 的 局部坐标系(parent 已经做了 transform,child effect 是在 parent 变换 之后的世界空间继续应用)。
None 是常见情况 — 大部分 layer 不需要 effect,shader 走快速路径。
Variants§
None
无效果(默认值)— shader 走无开销 blit 路径
Transform(Transform2D)
2D 仿射变换(平移+旋转+均匀缩放),绕 layer 中心
Opacity(f32)
整体 alpha 乘(0.0 = 完全透明,1.0 = 不透明)
ClipRRect(RRectDef)
圆角裁剪(在 4 个角的圆角 SDF 区域 alpha=0)
Trait Implementations§
Source§impl Clone for LayerEffect
impl Clone for LayerEffect
impl Copy for LayerEffect
Source§impl Debug for LayerEffect
impl Debug for LayerEffect
Source§impl Default for LayerEffect
impl Default for LayerEffect
Source§impl PartialEq for LayerEffect
impl PartialEq for LayerEffect
impl StructuralPartialEq for LayerEffect
Auto Trait Implementations§
impl Forget for LayerEffect
impl Freeze for LayerEffect
impl Move for LayerEffect
impl RefUnwindSafe for LayerEffect
impl Send for LayerEffect
impl Sync for LayerEffect
impl Unpin for LayerEffect
impl UnsafeUnpin for LayerEffect
impl UnwindSafe for LayerEffect
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