Flutter Engine
The Flutter Engine
|
#include <SkGradientBaseShader.h>
Classes | |
struct | Descriptor |
class | DescriptorScope |
Public Types | |
using | Interpolation = SkGradientShader::Interpolation |
Public Types inherited from SkShaderBase | |
enum class | ShaderType { M } |
enum class | GradientType { kNone , M } |
enum | Flags { kOpaqueAlpha_Flag = 1 << 0 } |
Public Types inherited from SkFlattenable | |
enum | Type { kSkColorFilter_Type , kSkBlender_Type , kSkDrawable_Type , kSkDrawLooper_Type , kSkImageFilter_Type , kSkMaskFilter_Type , kSkPathEffect_Type , kSkShader_Type } |
typedef sk_sp< SkFlattenable >(* | Factory) (SkReadBuffer &) |
Public Member Functions | |
SkGradientBaseShader (const Descriptor &desc, const SkMatrix &ptsToUnit) | |
~SkGradientBaseShader () override | |
ShaderType | type () const final |
bool | isOpaque () const override |
bool | interpolateInPremul () const |
const SkMatrix & | getGradientMatrix () const |
int | getColorCount () const |
const float * | getPositions () const |
const Interpolation & | getInterpolation () const |
SkScalar | getPos (int i) const |
SkColor | getLegacyColor (int i) const |
bool | colorsAreOpaque () const |
SkTileMode | getTileMode () const |
const SkBitmap & | cachedBitmap () const |
void | setCachedBitmap (SkBitmap b) const |
Public Member Functions inherited from SkShaderBase | |
~SkShaderBase () override | |
sk_sp< SkShader > | makeInvertAlpha () const |
sk_sp< SkShader > | makeWithCTM (const SkMatrix &) const |
virtual bool | isConstant () const |
virtual ShaderType | type () const =0 |
virtual GradientType | asGradient (GradientInfo *info=nullptr, SkMatrix *localMatrix=nullptr) const |
Context * | makeContext (const ContextRec &, SkArenaAlloc *) const |
bool | asLuminanceColor (SkColor4f *) const |
bool | appendRootStages (const SkStageRec &rec, const SkMatrix &ctm) const |
virtual bool | appendStages (const SkStageRec &, const SkShaders::MatrixRec &) const =0 |
virtual SkImage * | onIsAImage (SkMatrix *, SkTileMode[2]) const |
virtual SkRuntimeEffect * | asRuntimeEffect () const |
Type | getFlattenableType () const override |
virtual sk_sp< SkShader > | makeAsALocalMatrixShader (SkMatrix *localMatrix) const |
Public Member Functions inherited from SkShader | |
virtual bool | isOpaque () const |
SkImage * | isAImage (SkMatrix *localMatrix, SkTileMode xy[2]) const |
bool | isAImage () const |
sk_sp< SkShader > | makeWithLocalMatrix (const SkMatrix &) const |
sk_sp< SkShader > | makeWithColorFilter (sk_sp< SkColorFilter >) const |
sk_sp< SkShader > | makeWithWorkingColorSpace (sk_sp< SkColorSpace >) const |
Public Member Functions inherited from SkFlattenable | |
SkFlattenable () | |
virtual Factory | getFactory () const =0 |
virtual const char * | getTypeName () const =0 |
virtual void | flatten (SkWriteBuffer &) const |
virtual Type | getFlattenableType () const =0 |
sk_sp< SkData > | serialize (const SkSerialProcs *=nullptr) const |
size_t | serialize (void *memory, size_t memory_size, const SkSerialProcs *=nullptr) const |
Public Member Functions inherited from SkRefCntBase | |
SkRefCntBase () | |
virtual | ~SkRefCntBase () |
bool | unique () const |
void | ref () const |
void | unref () const |
Static Public Member Functions | |
static bool | ValidGradient (const SkColor4f colors[], int count, SkTileMode tileMode, const Interpolation &interpolation) |
static sk_sp< SkShader > | MakeDegenerateGradient (const SkColor4f colors[], const SkScalar pos[], int colorCount, sk_sp< SkColorSpace > colorSpace, SkTileMode mode) |
static void | AppendGradientFillStages (SkRasterPipeline *p, SkArenaAlloc *alloc, const SkPMColor4f *colors, const SkScalar *positions, int count) |
static void | AppendInterpolatedToDstStages (SkRasterPipeline *p, SkArenaAlloc *alloc, bool colorsAreOpaque, const Interpolation &interpolation, const SkColorSpace *intermediateColorSpace, const SkColorSpace *dstColorSpace) |
Static Public Member Functions inherited from SkShaderBase | |
static Type | GetFlattenableType () |
static sk_sp< SkShaderBase > | Deserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr) |
static void | RegisterFlattenables () |
static SkMatrix | ConcatLocalMatrices (const SkMatrix &parentLM, const SkMatrix &childLM) |
Static Public Member Functions inherited from SkFlattenable | |
static Factory | NameToFactory (const char name[]) |
static const char * | FactoryToName (Factory) |
static void | Register (const char name[], Factory) |
static sk_sp< SkFlattenable > | Deserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr) |
Public Attributes | |
SkColor4f * | fColors |
SkScalar * | fPositions |
int | fColorCount |
sk_sp< SkColorSpace > | fColorSpace |
Interpolation | fInterpolation |
bool | fFirstStopIsImplicit |
bool | fLastStopIsImplicit |
Static Public Attributes | |
static constexpr SkScalar | kDegenerateThreshold = SK_Scalar1 / (1 << 15) |
Protected Member Functions | |
void | flatten (SkWriteBuffer &) const override |
void | commonAsAGradient (GradientInfo *) const |
bool | onAsLuminanceColor (SkColor4f *) const override |
bool | appendStages (const SkStageRec &, const SkShaders::MatrixRec &) const override |
virtual void | appendGradientStages (SkArenaAlloc *alloc, SkRasterPipeline *tPipeline, SkRasterPipeline *postPipeline) const =0 |
Protected Member Functions inherited from SkShaderBase | |
SkShaderBase () | |
void | flatten (SkWriteBuffer &) const override |
virtual bool | onAsLuminanceColor (SkColor4f *) const |
Protected Attributes | |
const SkMatrix | fPtsToUnit |
SkTileMode | fTileMode |
Definition at line 35 of file SkGradientBaseShader.h.
Definition at line 37 of file SkGradientBaseShader.h.
SkGradientBaseShader::SkGradientBaseShader | ( | const Descriptor & | desc, |
const SkMatrix & | ptsToUnit | ||
) |
Definition at line 178 of file SkGradientBaseShader.cpp.
|
override |
Definition at line 303 of file SkGradientBaseShader.cpp.
|
static |
Definition at line 372 of file SkGradientBaseShader.cpp.
|
protectedpure virtual |
Implemented in SkLinearGradient, SkConicalGradient, SkRadialGradient, and SkSweepGradient.
|
static |
Definition at line 460 of file SkGradientBaseShader.cpp.
|
overrideprotectedvirtual |
Adds stages to implement this shader. To ensure that the correct input coords are present in r,g MatrixRec::apply() must be called (unless the shader doesn't require it's input coords). The default impl creates shadercontext and calls that (not very efficient).
Implements SkShaderBase.
Definition at line 529 of file SkGradientBaseShader.cpp.
|
inline |
Definition at line 152 of file SkGradientBaseShader.h.
|
inline |
Definition at line 148 of file SkGradientBaseShader.h.
|
protected |
Definition at line 972 of file SkGradientBaseShader.cpp.
|
overrideprotectedvirtual |
Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()).
DEPRECATED public : will move to protected ... use serialize() instead
Reimplemented from SkFlattenable.
Reimplemented in SkLinearGradient, SkRadialGradient, and SkSweepGradient.
Definition at line 75 of file SkGradientBaseShader.cpp.
|
inline |
Definition at line 81 of file SkGradientBaseShader.h.
|
inline |
Definition at line 80 of file SkGradientBaseShader.h.
|
inline |
Definition at line 83 of file SkGradientBaseShader.h.
Definition at line 135 of file SkGradientBaseShader.h.
Definition at line 130 of file SkGradientBaseShader.h.
|
inline |
Definition at line 82 of file SkGradientBaseShader.h.
|
inline |
Definition at line 150 of file SkGradientBaseShader.h.
|
inline |
Definition at line 76 of file SkGradientBaseShader.h.
|
overridevirtual |
Returns true if the shader is guaranteed to produce only opaque colors, subject to the SkPaint using the shader to apply an opaque alpha value. Subclasses should override this to allow some optimizations.
Reimplemented from SkShader.
Definition at line 587 of file SkGradientBaseShader.cpp.
|
static |
Definition at line 1075 of file SkGradientBaseShader.cpp.
|
overrideprotectedvirtual |
Reimplemented from SkShaderBase.
Definition at line 591 of file SkGradientBaseShader.cpp.
|
inline |
Definition at line 153 of file SkGradientBaseShader.h.
|
inlinefinalvirtual |
Implements SkShaderBase.
Definition at line 72 of file SkGradientBaseShader.h.
|
static |
Definition at line 996 of file SkGradientBaseShader.cpp.
int SkGradientBaseShader::fColorCount |
Definition at line 142 of file SkGradientBaseShader.h.
SkColor4f* SkGradientBaseShader::fColors |
Definition at line 140 of file SkGradientBaseShader.h.
sk_sp<SkColorSpace> SkGradientBaseShader::fColorSpace |
Definition at line 143 of file SkGradientBaseShader.h.
bool SkGradientBaseShader::fFirstStopIsImplicit |
Definition at line 145 of file SkGradientBaseShader.h.
Interpolation SkGradientBaseShader::fInterpolation |
Definition at line 144 of file SkGradientBaseShader.h.
bool SkGradientBaseShader::fLastStopIsImplicit |
Definition at line 146 of file SkGradientBaseShader.h.
SkScalar* SkGradientBaseShader::fPositions |
Definition at line 141 of file SkGradientBaseShader.h.
|
protected |
Definition at line 113 of file SkGradientBaseShader.h.
|
protected |
Definition at line 114 of file SkGradientBaseShader.h.
|
staticconstexpr |
Definition at line 98 of file SkGradientBaseShader.h.