|
TachyonUI 0.1.0
High-performance UI for building tools.
|
#include <gui_core/graphics/gui_primitive_renderer.h>
Public Member Functions | |
| void | Reset () override |
| void | SetTransform (tachyon::float3x2 transform) override |
| void | SetOpacity (float opacity) override |
| How opaque what is drawn from now on is, 0 to 1 (1 until set). | |
| void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, uint32_t fromStyleIndex, uint32_t toStyleIndex, float blendT, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={}) override |
| Draws a styled box, blended from fromStyleIndex to toStyleIndex (flat GPU style indices) by blendT in [0, 1]. | |
| void | RenderGlyph (tachyon::float2 pos, tachyon::float2 size, tachyon::float2 uvMin, tachyon::float2 uvMax, float scale, int bpp, int mode, tachyon::VisualColorStyleIndex textColorIndex, tachyon::IntRect clipRect, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, float shadowBlur=-1.0f) override |
| A glyph from the text atlas. | |
| void | RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::int2 p2, tachyon::int2 p3, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle) override |
| void | RenderCircle (tachyon::float2 center, float radius, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle) override |
| A circle outline lineStyle.lineWidth wide, exactly round. | |
| void | RenderDot (tachyon::float2 pos, tachyon::IntRect clipRect, float size, tachyon::color4f color) override |
| void | RenderTriangle (tachyon::float2 p0, tachyon::float2 p1, tachyon::float2 p2, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, TriangleEdges hardEdges=TriangleEdges::None) override |
| A filled triangle. | |
| void | RenderQuad (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius=0.0f, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid) override |
| Draws a filled, optionally rounded and textured rect: a box without borders, style blending or element state. | |
| void | RenderShadow (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius, int blur) override |
| A box shadow: rect is the shadow's shape, which fades out over blur pixels on either side of its edge (Gaussian, sigma = blur / 2, as CSS). | |
| void | RenderOccluder (tachyon::IntRect rect, tachyon::IntRect clipRect) override |
| Draws nothing: marks rect as covered by opaque content drawn after this call, so what was drawn before it there is skipped on the GPU. | |
| PrimitiveRenderTarget & | GetTarget (tachyon::ID id) |
| void | ReleaseTarget (tachyon::ID id) |
| Drops the CPU-side target of window id, when the window is destroyed. | |
| void | ReleaseAllTargets () |
| bool | StartResizing (tachyon::ID id) override |
| void | StopResizing () override |
| bool | BeginWindow (tachyon::ID id) override |
| void | EndWindow () override |
| void | BeginScopeCapture (tachyon::ID scopeId) override |
| Starts recording primitives under scopeId, replacing its previous capture. | |
| void | EndScopeCapture (tachyon::ID scopeId) override |
| Ends the capture of scopeId and draws it into the current window. | |
| bool | ReplayScopeCapture (tachyon::ID scopeId, tachyon::int2 delta) override |
| Draws the capture of scopeId again, moved by delta pixels; false if there is none. | |
| bool | HasScopeCapture (tachyon::ID scopeId) const override |
| True when scopeId has a non-empty capture. | |
| void | InvalidateScopeCapture (tachyon::ID scopeId) override |
| Drops the capture of scopeId. | |
| void | ClearScopeCaptures () override |
| Drops every capture. | |
| void | Render (tachyon::ID id, RHI::RenderCommandList &cmdList, const PipelineSet &pipelines, GPUDrawPushConstants &push_constants) |
| size_t | LastFrameUploadBytes () const |
| Primitive bytes the last Render uploaded with the frame; cached scopes drawn from their GPU copy add nothing. | |
| size_t | ResidentScopeCount () const |
| Captured scopes with a GPU copy (made or on its way). | |
| Public Member Functions inherited from tachyon::GUIRenderer | |
| virtual | ~GUIRenderer () |
| void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, VisualBoxStyleIndex boxStyleIndex, tachyon::ElementState state, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={}) |
| void | RenderBox (tachyon::IntRect rect, tachyon::IntRect clipRect, VisualBoxStyleIndex boxStyleIndex, tachyon::VisualColorStyleIndex colorStyleIndex={}, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid, tachyon::IntRect snappedPx={}) |
| void | RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::IntRect clipRect, const LineStyle &lineStyle) |
| void | RenderFilledPolygon (std::span< const tachyon::float2 > points, tachyon::IntRect clipRect, VisualColorStyleIndex colorIndex, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid) |
| Convex polygon, fan-triangulated from points[0]; needs at least 3 points. | |
| void | RenderPolyline (std::span< const tachyon::int2 > points, bool closed, tachyon::IntRect clipRect, const LineStyle &style) |
| Outlined polyline; closed adds a segment from the last point back to the first. | |
Public Attributes | |
| std::unordered_map< tachyon::ID, PrimitiveRenderTarget > | idTargets |
| PrimitiveRenderTarget * | currentTarget { nullptr } |
| PrimitiveRenderTarget * | resizingTarget { nullptr } |
Static Public Attributes | |
| static constexpr uint64_t | kEvictAfterFrames = 240 |
| A capture neither recorded nor replayed for this many frames is dropped, its GPU copy freed (as UICacheManager drops its scopes). | |
Additional Inherited Members | |
| Static Public Member Functions inherited from tachyon::GUIRenderer | |
| static uint32_t | StyleIndex (VisualBoxStyleIndex boxStyleIndex, tachyon::ElementState state) |
| The flat GPU style index of boxStyleIndex in state, as RenderBox takes it. | |
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
How opaque what is drawn from now on is, 0 to 1 (1 until set).
Below 1, occluders are dropped: what is under the drawing shows through it.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
Draws a styled box, blended from fromStyleIndex to toStyleIndex (flat GPU style indices) by blendT in [0, 1].
colorStyleIndex overrides the background (Invalid: none). snappedPx is the box in window pixels snapped relative to its parent (SnapToParent); empty snaps the transformed rect to the pixel grid.
Implements tachyon::GUIRenderer.
|
overridevirtual |
A glyph from the text atlas.
scale is atlas texels per pixel. With a shadowBlur of 0 or more it is a text shadow instead: the glyph's shape in textColorIndex alone (a color glyph's too), blurred by that many pixels (Gaussian, sigma = blur / 2, as CSS) as far as the atlas' distance field reaches.
Implements tachyon::GUIRenderer.
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
A circle outline lineStyle.lineWidth wide, exactly round.
A gradient and dashes run clockwise from the right (+x towards +y); gradientOffset / gradientScale pick the part of the gradient that goes once around.
Implements tachyon::GUIRenderer.
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
A filled triangle.
hardEdges end without a soft edge, for edges it shares with another triangle of the same shape.
Implements tachyon::GUIRenderer.
|
overridevirtual |
Draws a filled, optionally rounded and textured rect: a box without borders, style blending or element state.
Implements tachyon::GUIRenderer.
|
overridevirtual |
A box shadow: rect is the shadow's shape, which fades out over blur pixels on either side of its edge (Gaussian, sigma = blur / 2, as CSS).
Implements tachyon::GUIRenderer.
|
overridevirtual |
Draws nothing: marks rect as covered by opaque content drawn after this call, so what was drawn before it there is skipped on the GPU.
Only for a rect the later content covers completely, with no anti-aliased edge.
Reimplemented from tachyon::GUIRenderer.
|
inline |
| void tachyon::PrimitiveRenderer::ReleaseTarget | ( | tachyon::ID | id | ) |
Drops the CPU-side target of window id, when the window is destroyed.
Transient GPU storage belongs to the window's frame slots, not to this target.
| void tachyon::PrimitiveRenderer::ReleaseAllTargets | ( | ) |
|
inlineoverridevirtual |
Implements tachyon::GUIRenderer.
|
inlineoverridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
Implements tachyon::GUIRenderer.
|
overridevirtual |
Starts recording primitives under scopeId, replacing its previous capture.
Captures don't nest.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
Ends the capture of scopeId and draws it into the current window.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
Draws the capture of scopeId again, moved by delta pixels; false if there is none.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
True when scopeId has a non-empty capture.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
Drops the capture of scopeId.
Reimplemented from tachyon::GUIRenderer.
|
overridevirtual |
Drops every capture.
Reimplemented from tachyon::GUIRenderer.
| void tachyon::PrimitiveRenderer::Render | ( | tachyon::ID | id, |
| RHI::RenderCommandList & | cmdList, | ||
| const PipelineSet & | pipelines, | ||
| GPUDrawPushConstants & | push_constants ) |
|
inline |
Primitive bytes the last Render uploaded with the frame; cached scopes drawn from their GPU copy add nothing.
| size_t tachyon::PrimitiveRenderer::ResidentScopeCount | ( | ) | const |
Captured scopes with a GPU copy (made or on its way).
| std::unordered_map<tachyon::ID, PrimitiveRenderTarget> tachyon::PrimitiveRenderer::idTargets |
| PrimitiveRenderTarget* tachyon::PrimitiveRenderer::currentTarget { nullptr } |
| PrimitiveRenderTarget* tachyon::PrimitiveRenderer::resizingTarget { nullptr } |
|
staticconstexpr |
A capture neither recorded nor replayed for this many frames is dropped, its GPU copy freed (as UICacheManager drops its scopes).