pub struct EffectSpec {Show 13 fields
pub id: u32,
pub flags: u32,
pub length_mask: u32,
pub backdrop_radius_param: Option<u8>,
pub bleed_param: Option<u8>,
pub animated: bool,
pub animated_param: Option<u8>,
pub pointer_param: Option<u8>,
pub pointer_times_param: Option<u8>,
pub clock_mask: u32,
pub clock_window: f32,
pub params: [f32; 32],
pub textures: [Option<EffectTextureParam>; 4],
}Expand description
The --shading value that came out of the cascade, carried on
crate::Style and painted by crate::Style::paint.
The params are the effect’s positional CSS arguments, already
converted to floats (a colour occupies four consecutive slots), plus the
slots the host fills at paint time. Everything else is schema metadata the
painter needs and gpui must not have to look up: which params are lengths
(so they scale with the device factor), which one drives the backdrop blur,
which one dilates the quad, and which ones the host writes.
Fields§
§id: u32One of effect_id.
flags: u32§length_mask: u32Bit i set means params[i] is a length in LOGICAL pixels, to be
multiplied by the device scale factor at paint time.
backdrop_radius_param: Option<u8>Some(i): params[i] (a logical-pixel length) is the backdrop blur
radius. Only meaningful with EFFECT_FLAG_NEEDS_BACKDROP.
bleed_param: Option<u8>Some(i): params[i] (a logical-pixel length) dilates the painted
quad, giving an outer glow somewhere to land.
animated: boolWhether this effect’s output depends on time, i.e. whether the window
must keep repainting for it to animate.
animated_param: Option<u8>Some(i): params[i] is a speed time is multiplied by, which the
painter integrates per element so a change of it does not jump.
pointer_param: Option<u8>Some(i): the painter writes the pointer’s position in the element’s
0..1 box units into params[i..i + 2].
pointer_times_param: Option<u8>Some(i): the painter writes the pointer’s last move, entry into the
window and exit from it, on the effect clock, into params[i..i + 3].
clock_mask: u32Bit i set means params[i] is a time on the effect clock; the
element keeps repainting until clock_window seconds after the latest.
clock_window: f32Seconds an effect keeps repainting after the times in clock_mask.
params: [f32; 32]The positional parameters, in schema order.
textures: [Option<EffectTextureParam>; 4]The SkTexture parameters by binding: None past the ones the effect
declares.
Implementations§
Source§impl EffectSpec
impl EffectSpec
Sourcepub const NONE: EffectSpec
pub const NONE: EffectSpec
--shading: none — a value that clears an effect inherited from an
earlier rule in the cascade.
Sourcepub fn interpolates_with(&self, other: &EffectSpec) -> bool
pub fn interpolates_with(&self, other: &EffectSpec) -> bool
Whether a transition can interpolate from self to other slot by
slot: the same effect sampling the same images. Otherwise it
cross-fades, since an image does not interpolate.
Sourcepub fn follows_pointer(&self) -> bool
pub fn follows_pointer(&self) -> bool
Whether the painter fills a pointer parameter, so the element repaints when the pointer moves.
Sourcepub fn clock_running(&self, now: f32) -> bool
pub fn clock_running(&self, now: f32) -> bool
Whether now (effect-clock seconds) is within clock_window of the
latest time in a clock_mask slot.
Sourcepub fn backdrop_blur_radius(&self) -> f32
pub fn backdrop_blur_radius(&self) -> f32
The backdrop blur radius in logical pixels.
Trait Implementations§
Source§impl Clone for EffectSpec
impl Clone for EffectSpec
impl Copy for EffectSpec
Source§impl Debug for EffectSpec
impl Debug for EffectSpec
Source§impl<'de> Deserialize<'de> for EffectSpec
impl<'de> Deserialize<'de> for EffectSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for EffectSpec
impl PartialEq for EffectSpec
Source§impl Serialize for EffectSpec
impl Serialize for EffectSpec
impl StructuralPartialEq for EffectSpec
Auto Trait Implementations§
impl Forget for EffectSpec
impl Freeze for EffectSpec
impl Move for EffectSpec
impl RefUnwindSafe for EffectSpec
impl Send for EffectSpec
impl Sync for EffectSpec
impl Unpin for EffectSpec
impl UnsafeUnpin for EffectSpec
impl UnwindSafe for EffectSpec
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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