Skip to main content

Crate gpui_engine

Crate gpui_engine 

Source
Expand description

GPUI’s engine contract: the scene representation that gpui builds and the platform backends present.

This crate holds the intermediate representation (the Scene and its draw primitives) together with the interfaces its collaborators implement. It deliberately has no dependency on the windowing layer, on taffy, or on any GPU driver, so alternative renderers and engines can reuse or replace the scene representation without depending on those implementations.

Structs§

AtlasTextureId
Identifies a texture within the sprite atlas.
AtlasTile
A tile within a sprite atlas texture.
Boundary
A boundary between two lines of text.
EngineLayoutStyle
The layout-affecting subset of an element’s style.
Font
The configuration details for identifying a specific font.
FontFallbacks
The fallback fonts that can be configured for a given font. Fallback fonts family names are stored here.
FontFamilyId
An opaque identifier for a specific font family.
FontFeatures
The OpenType features that can be configured for a given font.
FontId
An opaque identifier for a specific font.
FontMetrics
A struct for storing font metrics. It is used to define the measurements of a typeface.
FontRun
A run of text with a single font.
FontWeight
The degree of blackness or stroke thickness of a font. This value ranges from 100.0 to 900.0, with 400.0 as normal.
FrameSession
A window’s layout engine session.
GlyphId
An identifier for a specific glyph, as returned by the platform text system.
GridTemplate
A simplified representation of the grid-template-* value
GridTemplateRefinement
A refinable version of [#ident], see that documentation for details.
ImageId
A unique identifier for the image cache
LayoutId
A unique identifier for a layout node, generated when a layout is requested.
LineLayout
A laid out and styled line of text
LineLayoutIndex
A saved position in a line-layout cache, used to reuse or truncate the layouts produced during a frame.
LineWrapper
The GPUI line wrapper, used to wrap lines of text to a given width.
LineWrapperHandle
A line wrapper borrowed from a TextSystem pool, returned on drop.
MeasureHandles
The handles a facade supplies for the duration of one layout pass.
MissingGlyph
A grapheme cluster that could not be represented by any available font.
MonochromeSprite
NoopTextSystem
PaddedBool32
A boolean stored as a u32 so that GPU-facing structs contain no compiler-inserted padding bytes, which would be undefined behavior to reinterpret as &[u8] when writing instance buffers. Guaranteed to be 0 or 1 by construction; shaders read it as a u32/uint.
PaintSurface
Path
A line made up of a series of vertices and control points.
PathId
PathVertex
PolychromeSprite
Quad
RenderGlyphParams
Parameters for rendering a glyph, used as cache keys for raster bounds.
RenderImageParams
RenderSvgParams
Scene
ShapedGlyph
A single glyph, ready to paint.
ShapedRun
A run of text that has been shaped .
SubpixelSprite
TextRun
A styled run of text.
TileId
The unique ID of a tile within its texture.
TransformationMatrix
A data type representing a 2 dimensional transformation that can be applied to an element.
Underline
WrapBoundary
A boundary at which a line was wrapped.
WrappedLineLayout
A line of text that has been wrapped to fit a given width.

Enums§

AlignContent
Sets the distribution of space between and around content items For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
AlignItems
Used to control how child nodes are aligned. For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
AtlasKey
AtlasTextureKind
The kind of content stored in an atlas texture.
BorderStyle
The style of a border.
Display
Sets the layout used for the children of this node
FallbackFontClass
The spacing behavior required of a fallback font.
FlexDirection
The direction of the flexbox layout main axis.
FlexWrap
Controls whether flex items are forced onto one line or can wrap onto multiple lines.
FontStyle
Allows italic or oblique faces to be selected.
GridTemplateMinSize
The minimum size of a column or row in a grid layout
LineFragment
A fragment of a line that can be wrapped.
Overflow
How children overflowing their container should affect layout
Position
The positioning strategy for this item.
Primitive
PrimitiveBatch
TextRenderingMode
The text rendering mode to use for drawing glyphs.
TruncateFrom
Determines whether to truncate text from the start or end.

Constants§

SUBPIXEL_VARIANTS_X
Number of subpixel glyph variants along the X axis.
SUBPIXEL_VARIANTS_Y
Number of subpixel glyph variants along the Y axis.

Traits§

LayoutEngine
A layout solver.
MeasureContext
The handles a custom measure callback receives from the engine.
MissingGlyphReports
A stream of grapheme clusters that exhausted font fallback.
MissingGlyphSink
Accepts missing glyphs detected by a platform text system.
PlatformAtlas
PlatformTextSystem
SceneRenderer
A renderer that presents a Scene to some target.
TextSystem
The text shaping, metric, wrapping, and line-layout surface.

Functions§

font
Get a Font for a given name.
font_name_with_fallbacks
Maps well-known virtual font names to their concrete equivalents.
font_name_with_fallbacks_shared
Like font_name_with_fallbacks but accepts and returns SharedString references.
get_gamma_correction_ratios
Compute gamma correction ratios for subpixel text rendering.
update_runs_after_truncation
Trims runs to match result after truncate_line replaced the removed text with ellipsis.

Type Aliases§

AlignSelf
Used to control how the specified nodes is aligned. Overrides the parent Node’s AlignItems property. For Flexbox it controls alignment in the cross axis For Grid it controls alignment in the block axis
BoxedMeasureFn
A type-erased measure callback supplied to LayoutEngine::request_measured_layout.
JustifyContent
Sets the distribution of space between and around content items For Flexbox it controls alignment in the main axis For Grid it controls alignment in the inline axis
JustifyItems
Used to control how child nodes are aligned. Does not apply to Flexbox, and will be ignored if specified on a flex container For Grid it controls alignment in the inline axis
JustifySelf
Used to control how the specified nodes is aligned. Overrides the parent Node’s JustifyItems property. Does not apply to Flexbox, and will be ignored if specified on a flex child For Grid it controls alignment in the inline axis
PathVertex_ScaledPixels