Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkBlendModeColorFilter Class Referencefinal

#include <SkBlendModeColorFilter.h>

Inheritance diagram for SkBlendModeColorFilter:
SkColorFilterBase SkColorFilter SkFlattenable SkRefCnt SkRefCntBase

Public Member Functions

 SkBlendModeColorFilter (const SkColor4f &color, SkBlendMode mode)
 
bool appendStages (const SkStageRec &rec, bool shaderIsOpaque) const override
 
bool onIsAlphaUnchanged () const override
 
SkColorFilterBase::Type type () const override
 
SkColor4f color () const
 
SkBlendMode mode () const
 
- Public Member Functions inherited from SkColorFilterBase
virtual bool appendStages (const SkStageRec &rec, bool shaderIsOpaque) const =0
 
virtual bool onIsAlphaUnchanged () const
 
virtual Type type () const =0
 
bool affectsTransparentBlack () const
 
virtual SkRuntimeEffectasRuntimeEffect () const
 
SkFlattenable::Type getFlattenableType () const override
 
virtual SkPMColor4f onFilterColor4f (const SkPMColor4f &color, SkColorSpace *dstCS) const
 
- Public Member Functions inherited from SkColorFilter
bool asAColorMode (SkColor *color, SkBlendMode *mode) const
 
bool asAColorMatrix (float matrix[20]) const
 
bool isAlphaUnchanged () const
 
SkColor filterColor (SkColor) const
 
SkColor4f filterColor4f (const SkColor4f &srcColor, SkColorSpace *srcCS, SkColorSpace *dstCS) const
 
sk_sp< SkColorFiltermakeComposed (sk_sp< SkColorFilter > inner) const
 
sk_sp< SkColorFiltermakeWithWorkingColorSpace (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< SkDataserialize (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
 

Additional Inherited Members

- Public Types inherited from SkColorFilterBase
enum class  Type { kNoop , M }
 
- 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 &)
 
- Static Public Member Functions inherited from SkColorFilterBase
static SkFlattenable::Type GetFlattenableType ()
 
static sk_sp< SkColorFilterDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
- Static Public Member Functions inherited from SkColorFilter
static sk_sp< SkColorFilterDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
- 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< SkFlattenableDeserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
 
- Protected Member Functions inherited from SkColorFilterBase
 SkColorFilterBase ()
 
virtual bool onAsAColorMatrix (float[20]) const
 
virtual bool onAsAColorMode (SkColor *color, SkBlendMode *bmode) const
 

Detailed Description

Definition at line 19 of file SkBlendModeColorFilter.h.

Constructor & Destructor Documentation

◆ SkBlendModeColorFilter()

SkBlendModeColorFilter::SkBlendModeColorFilter ( const SkColor4f color,
SkBlendMode  mode 
)

Definition at line 35 of file SkBlendModeColorFilter.cpp.

36 : fColor(color), fMode(mode) {}

Member Function Documentation

◆ appendStages()

bool SkBlendModeColorFilter::appendStages ( const SkStageRec rec,
bool  shaderIsOpaque 
) const
overridevirtual

Implements SkColorFilterBase.

Definition at line 79 of file SkBlendModeColorFilter.cpp.

79 {
80 rec.fPipeline->append(SkRasterPipelineOp::move_src_dst);
84 return true;
85}
static SkRGBA4f< kDstAT > map_color(const SkColor4f &c, SkColorSpace *src, SkColorSpace *dst)
void SkBlendMode_AppendStages(SkBlendMode mode, SkRasterPipeline *p)
Definition: SkBlendMode.cpp:97
SkColorSpace * sk_srgb_singleton()
void append(SkRasterPipelineOp, void *=nullptr)
void appendConstantColor(SkArenaAlloc *, const float rgba[4])
SkRasterPipeline * fPipeline
Definition: SkEffectPriv.h:21
SkColorSpace * fDstCS
Definition: SkEffectPriv.h:24
SkArenaAlloc * fAlloc
Definition: SkEffectPriv.h:22

◆ color()

SkColor4f SkBlendModeColorFilter::color ( ) const
inline

Definition at line 29 of file SkBlendModeColorFilter.h.

29{ return fColor; }

◆ mode()

SkBlendMode SkBlendModeColorFilter::mode ( ) const
inline

Definition at line 30 of file SkBlendModeColorFilter.h.

30{ return fMode; }

◆ onIsAlphaUnchanged()

bool SkBlendModeColorFilter::onIsAlphaUnchanged ( ) const
overridevirtual

Returns the flags for this filter. Override in subclasses to return custom flags.

< [Da, Dc]

< [Da, Sc * Da + (1 - Sa) * Dc]

Reimplemented from SkColorFilterBase.

Definition at line 48 of file SkBlendModeColorFilter.cpp.

48 {
49 switch (fMode) {
50 case SkBlendMode::kDst: //!< [Da, Dc]
51 case SkBlendMode::kSrcATop: //!< [Da, Sc * Da + (1 - Sa) * Dc]
52 return true;
53 default:
54 break;
55 }
56 return false;
57}
@ kSrcATop
r = s*da + d*(1-sa)

◆ type()

SkColorFilterBase::Type SkBlendModeColorFilter::type ( ) const
inlineoverridevirtual

Implements SkColorFilterBase.

Definition at line 27 of file SkBlendModeColorFilter.h.

27{ return SkColorFilterBase::Type::kBlendMode; }

The documentation for this class was generated from the following files: