Skip to main content

Crate drmkit_csd

Crate drmkit_csd 

Source
Expand description

Client-side window decorations.

Port of src/csd/. Title bars, shadows, rounded corners and the buttons on them — drawn by the client rather than by a compositor, which is what makes them client-side.

Drawing is CPU work over a pixel buffer. The one part that touches a DRM device is Surface, which allocates, maps and exports the dumb buffer a decoration is drawn into. The presenters only compute the property writes that put those pixels on screen; committing them is the caller’s business.

Structs§

BlitItem
One decoration to blend in.
Button
One button’s two states.
Buttons
The three window buttons.
Canvas
Where a decoration is being drawn.
Color
An 8-bit-per-channel color with alpha.
Colors
Every color a decoration uses.
DamageRect
A rectangle of the canvas that has to be repainted.
DamageSlot
One decoration’s footprint on the canvas, as of some frame.
DecorationGeometry
Where everything sits inside a decoration of a given size.
Dirty
What changed since the decoration was last drawn.
FbTarget
The framebuffer being composited into.
OverlayReservation
Overlay planes claimed for decorations, per CRTC.
PlaneSlot
The property ids for one reserved plane, and what to write to the ones whose values do not come from the surface.
PropertyWrite
One property write, as compute_writes and compute_canvas_writes produce them.
Renderer
Draws decorations.
RendererConfig
How to build a renderer.
ShadowCache
Rendered shadows, most recently used last.
ShadowDest
Where a shadow is being blitted to.
ShadowKey
What identifies one cached shadow.
Surface
A decoration’s pixels, and the framebuffer they scan out through.
SurfaceConfig
How big a decoration surface is.
SurfaceRef
A decoration surface and where it goes.
Theme
A complete decoration theme.
TitleBar
The title bar’s geometry and type.
WindowAnim
The animations one decorated window is running.
WindowState
A decorated window, as the renderer sees it.

Enums§

ColorError
Why a color could not be read.
DrawError
Why a decoration could not be drawn.
Elevation
How much shadow a window casts.
HoverButton
Which window button the pointer is over.
PlaneError
Why the writes could not be computed.
ReserveError
Why a reservation could not be made.
SurfaceError
Why a surface could not be created or used.
ThemeError
Why a theme could not be read.
Tier
Which way a decoration reaches the screen.

Constants§

DEFAULT_CAPACITY
How many shadows to keep when the caller does not say.
PROGRESS_UNSET
The progress value a state carries before an animator has written one.
SURFACE_FOURCC
The one format a decoration is ever drawn in.

Functions§

choose_presenter_tier
Pick a tier from what the hardware can offer.
compose_into_framebuffer
Blend items into target over damage.
compute_canvas_writes
The property writes that arm the canvas plane.
compute_damage
What changed between two frames’ worth of slots.
compute_writes
Convert surfaces to a full set of property writes over slots.
decoration_geometry
Lay out a decoration deco_w by deco_h under theme.
ease_out_cubic
Ease-out cubic, clamped to 0..=1.
fb_fourcc_for
Pick a FourCC from what fbdev reports about the framebuffer.
glass_default
The reference theme.
glass_lite
The same look, cheaper to draw.
glass_minimal
No shadow, no animation, no noise.
intersect_rect
The overlap between a rectangle and a damage region.
load_theme_file
Load a theme from a file, filling anything absent from base.
load_theme_str
Load a theme from TOML text, filling anything absent from base.
theme_id
A hash of the theme fields that affect a decoration’s pixels.
union_rect
The smallest rectangle covering both.