#[repr(C)]pub struct VnLayer {Show 14 fields
pub order: DrawOrder,
pub group: u32,
pub segment_start: u32,
pub segment_count: u32,
pub fill_rule: u32,
pub pad: [u32; 3],
pub color_matrix: [f32; 20],
pub bounds: Bounds<ScaledPixels>,
pub content_mask: ContentMask<ScaledPixels>,
pub snapshot: [u32; 2],
pub flags: u32,
pub opacity: f32,
pub source_rect: [f32; 4],
pub source_transform: [f32; 8],
}Expand description
vue-native fork: the composite of one isolated layer. The renderer draws
group group into an offscreen target the size of the window, then
composites it over its parent’s, multiplied by the coverage of the
segments segment_start..segment_start + segment_count of
Scene::vn_clip_segments under fill_rule (bit 0: 0 nonzero, 1
evenodd), and by the content mask. Bits 1–2 of fill_rule name a mask
(Scene::vn_begin_mask): 1 multiplies by the alpha, 2 by the luminance
of group group + 1, which the renderer draws into a target of its own.
A snapshot composite (vn_layer_flags::SNAPSHOT) samples the snapshot
instead: each device pixel maps through source_transform into the
capture’s device space, where the snapshot covers source_rect.
Keep in sync with struct VnLayer in gpui_windows/src/shaders.hlsl
(60 words); the renderer uploads this vector as it is.
Fields§
§order: DrawOrder§group: u32The group, an index into Scene::vn_group_ranges (never 0, the root).
segment_start: u32§segment_count: u32§fill_rule: u32§pad: [u32; 3]§color_matrix: [f32; 20]Four coefficient rows and the bias column, matching the shader.
bounds: Bounds<ScaledPixels>The device pixels the composite covers: the shape’s box, out to whole pixels and one more for the antialiased edge, cut by the mask.
content_mask: ContentMask<ScaledPixels>§snapshot: [u32; 2]The snapshot id, low and high words.
flags: u32§opacity: f32§source_rect: [f32; 4][x, y, width, height] of the snapshot in capture device pixels.
source_transform: [f32; 8]Rows [a, b, tx, _] and [c, d, ty, _]: device pixel to capture
device pixel.
Implementations§
Source§impl VnLayer
impl VnLayer
Sourcepub fn snapshot_id(&self) -> Option<u64>
pub fn snapshot_id(&self) -> Option<u64>
The snapshot a vn_layer_flags::SNAPSHOT composite samples.
Trait Implementations§
Auto Trait Implementations§
impl Forget for VnLayer
impl Freeze for VnLayer
impl Move for VnLayer
impl RefUnwindSafe for VnLayer
impl Send for VnLayer
impl Sync for VnLayer
impl Unpin for VnLayer
impl UnsafeUnpin for VnLayer
impl UnwindSafe for VnLayer
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> 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