Flutter Engine
The Flutter Engine
|
#include <GrStyle.h>
Public Types | |
enum class | Apply { kPathEffectOnly , kPathEffectAndStrokeRec } |
enum | KeyFlags { kClosed_KeyFlag = 0x1 , kNoJoins_KeyFlag = 0x2 } |
Static Public Member Functions | |
static const GrStyle & | SimpleFill () |
static const GrStyle & | SimpleHairline () |
static int | KeySize (const GrStyle &, Apply, uint32_t flags=0) |
static void | WriteKey (uint32_t *, const GrStyle &, Apply, SkScalar scale, uint32_t flags=0) |
static SkScalar | MatrixToScaleFactor (const SkMatrix &matrix) |
Represents the various ways that a GrStyledShape can be styled. It has fill/stroking information as well as an optional path effect. If the path effect represents dashing, the dashing information is extracted from the path effect and stored explicitly.
This will replace GrStrokeInfo as GrStyledShape is deployed.
|
strong |
enum GrStyle::KeyFlags |
Optional flags for computing keys that may remove unnecessary variation in the key due to style settings that don't affect particular classes of geometry.
Enumerator | |
---|---|
kClosed_KeyFlag | |
kNoJoins_KeyFlag |
Definition at line 53 of file GrStyle.h.
|
inlineexplicit |
|
inline |
|
default |
|
inlineexplicit |
|
inlineexplicit |
Given bounds of a path compute the bounds of path with the style applied.
Definition at line 173 of file GrStyle.h.
|
inline |
bool GrStyle::applyPathEffectToPath | ( | SkPath * | dst, |
SkStrokeRec * | remainingStoke, | ||
const SkPath & | src, | ||
SkScalar | scale | ||
) | const |
Applies just the path effect and returns remaining stroke information. This will fail if there is no path effect. dst may or may not have been overwritten on failure. Scale controls geometric approximations made by the path effect. It is typically computed from the view matrix.
Definition at line 163 of file GrStyle.cpp.
bool GrStyle::applyToPath | ( | SkPath * | dst, |
SkStrokeRec::InitStyle * | fillOrHairline, | ||
const SkPath & | src, | ||
SkScalar | scale | ||
) | const |
If this succeeds then the result path should be filled or hairlined as indicated by the returned SkStrokeRec::InitStyle value. Will fail if there is no path effect and the strokerec doesn't change the geometry. When this fails the outputs may or may not have been overwritten. Scale controls geometric approximations made by the path effect and stroker. It is typically computed from the view matrix.
Definition at line 175 of file GrStyle.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 126 of file GrStyle.h.
|
inline |
|
inline |
Computes the key length for a GrStyle. The return will be negative if it cannot be turned into a key. This occurs when there is a path effect that is not a dash. The key can either reflect just the path effect (if one) or the path effect and the strokerec. Note that a simple fill has a zero sized key.
Definition at line 11 of file GrStyle.cpp.
|
inline |
|
inline |
|
inline |
Definition at line 103 of file GrStyle.h.
|
inlinestatic |
A style object that represents a fill with no path effect. TODO: constexpr with C++14
|
inlinestatic |
|
inline |
|
static |
Writes a unique key for the style into the provided buffer. This function assumes the buffer has room for at least KeySize() values. It assumes that KeySize() returns a non-negative value for the combination of GrStyle, Apply and flags params. This is written so that the key for just dash application followed by the key for the remaining SkStrokeRec is the same as the key for applying dashing and SkStrokeRec all at once.
Definition at line 33 of file GrStyle.cpp.