|
TachyonUI 0.1.0
High-performance UI for building tools.
|
#include <gui_core/graphics/gui_primitive_renderer.h>
Classes | |
| struct | Stream |
| Per-kind primitive stream: CPU bytes appended by the emit methods and packed together into the current frame slot's GPU upload arena. More... | |
| struct | ScopeReplay |
| A cached scope drawn here, moved delta window pixels from where it was captured; its primitives' draw orders start at baseOrder. More... | |
Public Member Functions | |
| void | FinishRenderPass () |
| void | StartRenderPass (PrimitiveKind kind) |
| void | AppendCaptured (const PrimitiveRenderTarget &src, tachyon::int2 delta) |
| Appends another target's passes, translated by delta pixels. | |
| void | AddReplay (tachyon::ID scope, tachyon::int2 delta, uint32_t primitiveCount) |
| Closes the open pass and adds a pass that draws cached scope scope, moved by delta; it takes primitiveCount draw orders. | |
| size_t | Render (RHI::RenderCommandList &cmdList, const PipelineSet &pipelines, GPUDrawPushConstants &push_constants) |
| Uploads the streams and draws the passes; replay passes are left to the caller (PrimitiveRenderer). | |
| void | Reset () |
| void | SetTransform (tachyon::float3x2 transform) |
| void | SetOpacity (float opacity) |
| 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={}) |
| 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) |
| void | RenderLine (tachyon::int2 p0, tachyon::int2 p1, tachyon::int2 p2, tachyon::int2 p3, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle) |
| void | RenderCircle (tachyon::float2 center, float radius, tachyon::IntRect clipRect, const tachyon::LineStyle &lineStyle) |
| void | RenderDot (tachyon::float2 pos, tachyon::IntRect clipRect, float size, tachyon::color4f color) |
| 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) |
| void | RenderQuad (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius=0.0f, tachyon::ImageIndex textureIndex=tachyon::ImageIndex::Invalid) |
| void | RenderShadow (tachyon::IntRect rect, tachyon::IntRect clipRect, tachyon::VisualColorStyleIndex colorStyleIndex, float cornerRadius, int blur) |
| void | RenderOccluder (tachyon::IntRect rect, tachyon::IntRect clipRect) |
Public Attributes | |
| std::array< Stream, kPrimitiveKindCount > | streams |
| std::vector< PrimitiveRenderPass > | renderPasses |
| int | currentKind = -1 |
| kind of the open pass; -1 when none | |
| tachyon::float3x2 | currentTransform |
| float | currentOpacity = 1.0f |
| 0 to 1, stamped into each primitive | |
| std::vector< ScopeReplay > | replays |
| uint32_t | nextOrder = 0 |
| The draw order the next primitive gets; also counts a replay's primitives. | |
| void tachyon::PrimitiveRenderTarget::FinishRenderPass | ( | ) |
| void tachyon::PrimitiveRenderTarget::StartRenderPass | ( | PrimitiveKind | kind | ) |
| void tachyon::PrimitiveRenderTarget::AppendCaptured | ( | const PrimitiveRenderTarget & | src, |
| tachyon::int2 | delta ) |
Appends another target's passes, translated by delta pixels.
Works for every kind: each primitive starts with the same header (transform0, transform1, clipMin, clipMax).
| void tachyon::PrimitiveRenderTarget::AddReplay | ( | tachyon::ID | scope, |
| tachyon::int2 | delta, | ||
| uint32_t | primitiveCount ) |
Closes the open pass and adds a pass that draws cached scope scope, moved by delta; it takes primitiveCount draw orders.
| size_t tachyon::PrimitiveRenderTarget::Render | ( | RHI::RenderCommandList & | cmdList, |
| const PipelineSet & | pipelines, | ||
| GPUDrawPushConstants & | push_constants ) |
Uploads the streams and draws the passes; replay passes are left to the caller (PrimitiveRenderer).
Returns the bytes uploaded.
| void tachyon::PrimitiveRenderTarget::Reset | ( | ) |
| void tachyon::PrimitiveRenderTarget::SetTransform | ( | tachyon::float3x2 | transform | ) |
|
inline |
| void tachyon::PrimitiveRenderTarget::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 = {} ) |
| void tachyon::PrimitiveRenderTarget::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 ) |
| void tachyon::PrimitiveRenderTarget::RenderLine | ( | tachyon::int2 | p0, |
| tachyon::int2 | p1, | ||
| tachyon::int2 | p2, | ||
| tachyon::int2 | p3, | ||
| tachyon::IntRect | clipRect, | ||
| const tachyon::LineStyle & | lineStyle ) |
| void tachyon::PrimitiveRenderTarget::RenderCircle | ( | tachyon::float2 | center, |
| float | radius, | ||
| tachyon::IntRect | clipRect, | ||
| const tachyon::LineStyle & | lineStyle ) |
| void tachyon::PrimitiveRenderTarget::RenderDot | ( | tachyon::float2 | pos, |
| tachyon::IntRect | clipRect, | ||
| float | size, | ||
| tachyon::color4f | color ) |
| void tachyon::PrimitiveRenderTarget::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 ) |
| void tachyon::PrimitiveRenderTarget::RenderQuad | ( | tachyon::IntRect | rect, |
| tachyon::IntRect | clipRect, | ||
| tachyon::VisualColorStyleIndex | colorStyleIndex, | ||
| float | cornerRadius = 0.0f, | ||
| tachyon::ImageIndex | textureIndex = tachyon::ImageIndex::Invalid ) |
| void tachyon::PrimitiveRenderTarget::RenderShadow | ( | tachyon::IntRect | rect, |
| tachyon::IntRect | clipRect, | ||
| tachyon::VisualColorStyleIndex | colorStyleIndex, | ||
| float | cornerRadius, | ||
| int | blur ) |
| void tachyon::PrimitiveRenderTarget::RenderOccluder | ( | tachyon::IntRect | rect, |
| tachyon::IntRect | clipRect ) |
| std::array<Stream, kPrimitiveKindCount> tachyon::PrimitiveRenderTarget::streams |
| std::vector<PrimitiveRenderPass> tachyon::PrimitiveRenderTarget::renderPasses |
| int tachyon::PrimitiveRenderTarget::currentKind = -1 |
kind of the open pass; -1 when none
| tachyon::float3x2 tachyon::PrimitiveRenderTarget::currentTransform |
| float tachyon::PrimitiveRenderTarget::currentOpacity = 1.0f |
0 to 1, stamped into each primitive
| std::vector<ScopeReplay> tachyon::PrimitiveRenderTarget::replays |
| uint32_t tachyon::PrimitiveRenderTarget::nextOrder = 0 |
The draw order the next primitive gets; also counts a replay's primitives.