Flutter Engine
The Flutter Engine
|
#include <GrShape.h>
Public Types | |
enum class | Type : uint8_t { kEmpty , kPoint , kRect , kRRect , kPath , kArc , kLine } |
enum | SimplifyFlags : unsigned { kSimpleFill_Flag = 0b001 , kIgnoreWinding_Flag = 0b010 , kMakeCanonical_Flag = 0b100 , kAll_Flags = 0b111 } |
using | sk_is_trivially_relocatable = std::true_type |
Public Member Functions | |
GrShape () | |
GrShape (const SkPoint &point) | |
GrShape (const SkRect &rect) | |
GrShape (const SkRRect &rrect) | |
GrShape (const SkPath &path) | |
GrShape (const SkArc &arc) | |
GrShape (const GrLineSegment &line) | |
GrShape (const GrShape &shape) | |
~GrShape () | |
GrShape & | operator= (const GrShape &shape) |
bool | isEmpty () const |
bool | isPoint () const |
bool | isRect () const |
bool | isRRect () const |
bool | isPath () const |
bool | isArc () const |
bool | isLine () const |
Type | type () const |
uint32_t | stateKey () const |
bool | inverted () const |
SkPathDirection | dir () const |
unsigned | startIndex () const |
void | setPathWindingParams (SkPathDirection dir, unsigned start) |
void | setInverted (bool inverted) |
SkPoint & | point () |
const SkPoint & | point () const |
SkRect & | rect () |
const SkRect & | rect () const |
SkRRect & | rrect () |
const SkRRect & | rrect () const |
SkPath & | path () |
const SkPath & | path () const |
SkArc & | arc () |
const SkArc & | arc () const |
GrLineSegment & | line () |
const GrLineSegment & | line () const |
void | setPoint (const SkPoint &point) |
void | setRect (const SkRect &rect) |
void | setRRect (const SkRRect &rrect) |
void | setArc (const SkArc &arc) |
void | setLine (const GrLineSegment &line) |
void | setPath (const SkPath &path) |
void | reset () |
bool | simplify (unsigned flags=kAll_Flags) |
bool | conservativeContains (const SkRect &rect) const |
bool | conservativeContains (const SkPoint &point) const |
bool | closed () const |
bool | convex (bool simpleFill=true) const |
SkRect | bounds () const |
uint32_t | segmentMask () const |
void | asPath (SkPath *out, bool simpleFill=true) const |
Static Public Attributes | |
static constexpr int | kTypeCount = static_cast<int>(Type::kLine) + 1 |
static constexpr SkPathDirection | kDefaultDir = SkPathDirection::kCW |
static constexpr unsigned | kDefaultStart = 0 |
static constexpr SkPathFillType | kDefaultFillType = SkPathFillType::kEvenOdd |
GrShape is a convenience class to represent the many different specialized geometries that Ganesh can handle, including rects, round rects, lines, as well as paths. It is intended as a data-only class where any additional complex behavior is handled by an owning type (e.g. GrStyledShape). However, it does include some basic utilities that unify common functionality (such as contains()) from the underlying shape types.
In order to have lossless simplification of the geometry, it also tracks winding direction, start index, and fill inversion. The direction and index are match the SkPath indexing scheme for the shape's type (e.g. rect, rrect, or oval).
Regarding GrShape's empty shape:
using GrShape::sk_is_trivially_relocatable = std::true_type |
enum GrShape::SimplifyFlags : unsigned |
Enumerator | |
---|---|
kSimpleFill_Flag | |
kIgnoreWinding_Flag | |
kMakeCanonical_Flag | |
kAll_Flags |
Definition at line 193 of file GrShape.h.
|
strong |
Enumerator | |
---|---|
kEmpty | |
kPoint | |
kRect | |
kRRect | |
kPath | |
kArc | |
kLine |
Definition at line 53 of file GrShape.h.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 423 of file GrShape.cpp.
SkRect GrShape::bounds | ( | ) | const |
Definition at line 367 of file GrShape.cpp.
bool GrShape::closed | ( | ) | const |
Definition at line 330 of file GrShape.cpp.
bool GrShape::conservativeContains | ( | const SkPoint & | point | ) | const |
Definition at line 313 of file GrShape.cpp.
bool GrShape::conservativeContains | ( | const SkRect & | rect | ) | const |
Definition at line 289 of file GrShape.cpp.
bool GrShape::convex | ( | bool | simpleFill = true | ) | const |
Definition at line 348 of file GrShape.cpp.
|
inline |
|
inline |
|
inline |
Definition at line 17 of file GrShape.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
uint32_t GrShape::segmentMask | ( | ) | const |
Definition at line 393 of file GrShape.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 175 of file GrShape.h.
|
inline |
|
inline |
|
inline |
|
inline |
bool GrShape::simplify | ( | unsigned | flags = kAll_Flags | ) |
Definition at line 244 of file GrShape.cpp.
|
inline |
uint32_t GrShape::stateKey | ( | ) | const |
Definition at line 49 of file GrShape.cpp.
GrLineSegment GrShape::fLine |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |