#[repr(C)]pub struct Quad {
pub order: DrawOrder,
pub border_style: BorderStyle,
pub bounds: Bounds<ScaledPixels>,
pub content_mask: ContentMask<ScaledPixels>,
pub background: Background,
pub border_color: Hsla,
pub corner_radii: Corners<ScaledPixels>,
pub border_widths: Edges<ScaledPixels>,
pub transformation: TransformationMatrix,
pub corner_shapes: CornerShapes,
}Expand description
Keep the field order in sync with struct Quad in
gpui_windows/src/shaders.hlsl (85 words / 340 bytes) — the DirectX
renderer uploads this straight into a StructuredBuffer and
StructureByteStride is size_of::<Quad>(), so the Rust layout IS the
shader layout.
Fields§
§order: DrawOrder§border_style: BorderStyle§bounds: Bounds<ScaledPixels>§content_mask: ContentMask<ScaledPixels>§background: Background§border_color: Hsla§corner_radii: Corners<ScaledPixels>§border_widths: Edges<ScaledPixels>§transformation: TransformationMatrixA paint-time transformation of the quad about its own centre — CSS
transform.
bounds stays the UNTRANSFORMED rect and is still what the scene sorts
and culls by; the vertex shader applies this on top and the fragment
shader keeps doing its SDF work in the untransformed local frame. That
split is deliberate: it is what lets the rounded corners, the border
widths and the dash phase stay correct under rotation without any of
them learning about the matrix.
corner_shapes: CornerShapesvue-native fork: CSS corner-shape of corner_radii.
Trait Implementations§
impl Copy for Quad
Auto Trait Implementations§
impl Forget for Quad
impl Freeze for Quad
impl Move for Quad
impl RefUnwindSafe for Quad
impl Send for Quad
impl Sync for Quad
impl Unpin for Quad
impl UnsafeUnpin for Quad
impl UnwindSafe for Quad
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