Flutter Engine
The Flutter Engine
|
#include <Shape.h>
Public Types | |
enum class | Type : uint8_t { kEmpty , kLine , kRect , kRRect , kPath } |
Public Member Functions | |
Shape () | |
Shape (const Shape &shape) | |
Shape (Shape &&)=delete | |
Shape (SkPoint p0, SkPoint p1) | |
Shape (SkV2 p0, SkV2 p1) | |
Shape (skvx::float2 p0, skvx::float2 p1) | |
Shape (const Rect &rect) | |
Shape (const SkRect &rect) | |
Shape (const SkRRect &rrect) | |
Shape (const SkPath &path) | |
~Shape () | |
Shape & | operator= (Shape &&)=delete |
Shape & | operator= (const Shape &) |
Type | type () const |
bool | isEmpty () const |
bool | isLine () const |
bool | isRect () const |
bool | isRRect () const |
bool | isPath () const |
bool | inverted () const |
void | setInverted (bool inverted) |
SkPathFillType | fillType () const |
bool | conservativeContains (const Rect &rect) const |
bool | conservativeContains (skvx::float2 point) const |
bool | convex (bool simpleFill=true) const |
Rect | bounds () const |
SkPath | asPath () const |
skvx::float2 | p0 () const |
skvx::float2 | p1 () const |
skvx::float4 | line () const |
const Rect & | rect () const |
const SkRRect & | rrect () const |
const SkPath & | path () const |
void | setLine (SkPoint p0, SkPoint p1) |
void | setLine (SkV2 p0, SkV2 p1) |
void | setLine (skvx::float2 p0, skvx::float2 p1) |
void | setRect (const SkRect &rect) |
void | setRect (const Rect &rect) |
void | setRRect (const SkRRect &rrect) |
void | setPath (const SkPath &path) |
void | reset () |
int | keySize () const |
bool | hasKey () const |
void | writeKey (uint32_t *key, bool includeInverted) const |
Static Public Attributes | |
static constexpr int | kTypeCount = static_cast<int>(Type::kPath) + 1 |
Shape is effectively a std::variant over different geometric shapes, with the most complex being an SkPath. It provides a consistent way to query geometric properties, such as convexity, point containment, or iteration.
|
strong |
Enumerator | |
---|---|
kEmpty | |
kLine | |
kRect | |
kRRect | |
kPath |
Definition at line 30 of file Shape.h.
|
inline |
|
delete |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
SkPath skgpu::graphite::Shape::asPath | ( | ) | const |
Rect skgpu::graphite::Shape::bounds | ( | ) | const |
bool skgpu::graphite::Shape::conservativeContains | ( | const Rect & | rect | ) | const |
Definition at line 37 of file Shape.cpp.
bool skgpu::graphite::Shape::conservativeContains | ( | skvx::float2 | point | ) | const |
Definition at line 48 of file Shape.cpp.
bool skgpu::graphite::Shape::convex | ( | bool | simpleFill = true | ) | const |
|
inline |
|
inline |
int skgpu::graphite::Shape::keySize | ( | ) | const |
Gets the size of the key for the shape represented by this Shape. A negative value is returned if the shape has no key (shouldn't be cached).
Definition at line 140 of file Shape.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 136 of file Shape.h.
|
inline |
|
inline |
|
inline |
|
inline |
void skgpu::graphite::Shape::writeKey | ( | uint32_t * | key, |
bool | includeInverted | ||
) | const |
Writes keySize() bytes into the provided pointer. Assumes that there is enough space allocated for the key and that keySize() does not return a negative value for this shape. If includeInverted is false, non-inverted state will be written into the key regardless of the Shape's state.
Definition at line 177 of file Shape.cpp.
|
inlinestaticconstexpr |