A utility that generates triangles of the specified fill type given a path. More...
#include <compute_tessellator.h>
Public Types | |
enum | Status { Status::kCommandInvalid, Status::kTooManyComponents, Status::kOk } |
enum | Style { Style::kStroke } |
Public Member Functions | |
ComputeTessellator () | |
~ComputeTessellator () | |
ComputeTessellator & | SetStyle (Style value) |
ComputeTessellator & | SetStrokeWidth (Scalar value) |
ComputeTessellator & | SetStrokeJoin (Join value) |
ComputeTessellator & | SetStrokeCap (Cap value) |
ComputeTessellator & | SetMiterLimit (Scalar value) |
ComputeTessellator & | SetCubicAccuracy (Scalar value) |
ComputeTessellator & | SetQuadraticTolerance (Scalar value) |
Status | Tessellate (const Path &path, HostBuffer &host_buffer, const std::shared_ptr< Context > &context, BufferView vertex_buffer, BufferView vertex_buffer_count, const CommandBuffer::CompletionCallback &callback=nullptr) const |
Generates triangles from the path. If the data needs to be synchronized back to the CPU, e.g. because one of the buffer views are host visible and will be used without creating a blit pass to copy them back, the callback is used to determine when the GPU calculation is complete and its status. On Metal, no additional synchronization is needed as long as the buffers are not heap allocated, so no additional synchronization mechanism is provided. More... | |
Static Public Attributes | |
static constexpr size_t | kMaxCubicCount = 512 |
static constexpr size_t | kMaxQuadCount = 2048 |
static constexpr size_t | kMaxLineCount = 4096 |
static constexpr size_t | kMaxComponentCount |
A utility that generates triangles of the specified fill type given a path.
Definition at line 20 of file compute_tessellator.h.
|
strong |
Enumerator | |
---|---|
kCommandInvalid | |
kTooManyComponents | |
kOk |
Definition at line 32 of file compute_tessellator.h.
|
strong |
Enumerator | |
---|---|
kStroke |
Definition at line 38 of file compute_tessellator.h.
|
default |
|
default |
ComputeTessellator & impeller::ComputeTessellator::SetCubicAccuracy | ( | Scalar | value | ) |
Definition at line 55 of file compute_tessellator.cc.
ComputeTessellator & impeller::ComputeTessellator::SetMiterLimit | ( | Scalar | value | ) |
Definition at line 51 of file compute_tessellator.cc.
ComputeTessellator & impeller::ComputeTessellator::SetQuadraticTolerance | ( | Scalar | value | ) |
Definition at line 59 of file compute_tessellator.cc.
ComputeTessellator & impeller::ComputeTessellator::SetStrokeCap | ( | Cap | value | ) |
Definition at line 47 of file compute_tessellator.cc.
ComputeTessellator & impeller::ComputeTessellator::SetStrokeJoin | ( | Join | value | ) |
Definition at line 43 of file compute_tessellator.cc.
ComputeTessellator & impeller::ComputeTessellator::SetStrokeWidth | ( | Scalar | value | ) |
Definition at line 38 of file compute_tessellator.cc.
Referenced by impeller::testing::TEST_P().
ComputeTessellator & impeller::ComputeTessellator::SetStyle | ( | Style | value | ) |
Definition at line 33 of file compute_tessellator.cc.
ComputeTessellator::Status impeller::ComputeTessellator::Tessellate | ( | const Path & | path, |
HostBuffer & | host_buffer, | ||
const std::shared_ptr< Context > & | context, | ||
BufferView | vertex_buffer, | ||
BufferView | vertex_buffer_count, | ||
const CommandBuffer::CompletionCallback & | callback = nullptr |
||
) | const |
Generates triangles from the path. If the data needs to be synchronized back to the CPU, e.g. because one of the buffer views are host visible and will be used without creating a blit pass to copy them back, the callback is used to determine when the GPU calculation is complete and its status. On Metal, no additional synchronization is needed as long as the buffers are not heap allocated, so no additional synchronization mechanism is provided.
Definition at line 64 of file compute_tessellator.cc.
References impeller::DeviceBuffer::AsBufferView(), impeller::HostBuffer::EmplaceStorageBuffer(), impeller::HostBuffer::EmplaceUniform(), impeller::Path::EnumerateComponents(), impeller::Path::GetComponentCount(), kCommandInvalid, impeller::Path::kCubic, impeller::Path::kLinear, kMaxCubicCount, kMaxLineCount, kMaxQuadCount, kOk, impeller::Path::kQuadratic, kStroke, and kTooManyComponents.
Referenced by impeller::testing::TEST_P().
|
staticconstexpr |
Definition at line 29 of file compute_tessellator.h.
|
staticconstexpr |
Definition at line 26 of file compute_tessellator.h.
Referenced by Tessellate().
|
staticconstexpr |
Definition at line 28 of file compute_tessellator.h.
Referenced by Tessellate().
|
staticconstexpr |
Definition at line 27 of file compute_tessellator.h.
Referenced by Tessellate().