Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
SkColorFilterBase Class Referenceabstract

#include <SkColorFilterBase.h>

Inheritance diagram for SkColorFilterBase:
SkColorFilter SkFlattenable SkRefCnt SkRefCntBase FailureColorFilter SkBlendModeColorFilter SkColorSpaceXformColorFilter SkComposeColorFilter SkGaussianColorFilter SkMatrixColorFilter SkRuntimeColorFilter SkTableColorFilter SkWorkingFormatColorFilter

Public Types

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 &)
 

Public Member Functions

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
 

Static Public Member Functions

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

 SkColorFilterBase ()
 
virtual bool onAsAColorMatrix (float[20]) const
 
virtual bool onAsAColorMode (SkColor *color, SkBlendMode *bmode) const
 

Friends

class SkColorFilter
 

Detailed Description

Definition at line 35 of file SkColorFilterBase.h.

Member Enumeration Documentation

◆ Type

enum class SkColorFilterBase::Type
strong
Enumerator
kNoop 

Definition at line 43 of file SkColorFilterBase.h.

43 {
44 // Used for stubs/tests
45 kNoop,
46#define M(type) k##type,
48#undef M
49
50 };
#define SK_ALL_COLOR_FILTERS(M)

Constructor & Destructor Documentation

◆ SkColorFilterBase()

SkColorFilterBase::SkColorFilterBase ( )
inlineprotected

Definition at line 79 of file SkColorFilterBase.h.

79{}

Member Function Documentation

◆ affectsTransparentBlack()

bool SkColorFilterBase::affectsTransparentBlack ( ) const
inline

Definition at line 54 of file SkColorFilterBase.h.

54 {
55 return this->filterColor4f(SkColors::kTransparent, nullptr, nullptr) !=
57 }
SkColor4f filterColor4f(const SkColor4f &srcColor, SkColorSpace *srcCS, SkColorSpace *dstCS) const
constexpr SkColor4f kTransparent
Definition: SkColor.h:434

◆ appendStages()

virtual bool SkColorFilterBase::appendStages ( const SkStageRec rec,
bool  shaderIsOpaque 
) const
pure virtual

◆ asRuntimeEffect()

virtual SkRuntimeEffect * SkColorFilterBase::asRuntimeEffect ( ) const
inlinevirtual

Reimplemented in SkRuntimeColorFilter.

Definition at line 59 of file SkColorFilterBase.h.

59{ return nullptr; }

◆ Deserialize()

static sk_sp< SkColorFilter > SkColorFilterBase::Deserialize ( const void *  data,
size_t  size,
const SkDeserialProcs procs = nullptr 
)
inlinestatic

Definition at line 69 of file SkColorFilterBase.h.

70 {
71 return sk_sp<SkColorFilter>(static_cast<SkColorFilter*>(
73 kSkColorFilter_Type, data, size, procs).release()));
74 }
static sk_sp< SkFlattenable > Deserialize(Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ GetFlattenableType()

static SkFlattenable::Type SkColorFilterBase::GetFlattenableType ( )
inlinestatic

Definition at line 61 of file SkColorFilterBase.h.

61 {
63 }

◆ getFlattenableType()

SkFlattenable::Type SkColorFilterBase::getFlattenableType ( ) const
inlineoverridevirtual

Implements SkFlattenable.

Definition at line 65 of file SkColorFilterBase.h.

65 {
67 }

◆ onAsAColorMatrix()

bool SkColorFilterBase::onAsAColorMatrix ( float  matrix[20]) const
protectedvirtual

Definition at line 29 of file SkColorFilterBase.cpp.

29 {
30 return false;
31}

◆ onAsAColorMode()

bool SkColorFilterBase::onAsAColorMode ( SkColor color,
SkBlendMode bmode 
) const
protectedvirtual

Definition at line 25 of file SkColorFilterBase.cpp.

25 {
26 return false;
27}

◆ onFilterColor4f()

SkPMColor4f SkColorFilterBase::onFilterColor4f ( const SkPMColor4f color,
SkColorSpace dstCS 
) const
virtual

Reimplemented in SkWorkingFormatColorFilter.

Definition at line 33 of file SkColorFilterBase.cpp.

34 {
35 constexpr size_t kEnoughForCommonFilters = 2048; // big enough for a tiny SkSL program
37 SkRasterPipeline pipeline(&alloc);
38 pipeline.appendConstantColor(&alloc, color.vec());
39 SkSurfaceProps props{}; // default OK; colorFilters don't render text
40 SkStageRec rec = {&pipeline, &alloc, kRGBA_F32_SkColorType, dstCS, color.unpremul(), props};
41
42 if (as_CFB(this)->appendStages(rec, color.fA == 1)) {
44 SkRasterPipeline_MemoryCtx dstPtr = { &dst, 0 };
45 pipeline.append(SkRasterPipelineOp::store_f32, &dstPtr);
46 pipeline.run(0,0, 1,1);
47 return dst;
48 }
49
50 SkDEBUGFAIL("onFilterColor4f unimplemented for this filter");
51 return SkPMColor4f{0,0,0,0};
52}
#define SkDEBUGFAIL(message)
Definition: SkAssert.h:118
static SkColorFilterBase * as_CFB(SkColorFilter *filter)
@ kRGBA_F32_SkColorType
pixel using C float for red, green, blue, alpha; in 128-bit word
Definition: SkColorType.h:40
virtual bool appendStages(const SkStageRec &rec, bool shaderIsOpaque) const =0
DlColor color
dst
Definition: cp.py:12

◆ onIsAlphaUnchanged()

virtual bool SkColorFilterBase::onIsAlphaUnchanged ( ) const
inlinevirtual

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

Reimplemented in SkBlendModeColorFilter, SkComposeColorFilter, SkMatrixColorFilter, SkRuntimeColorFilter, and SkWorkingFormatColorFilter.

Definition at line 41 of file SkColorFilterBase.h.

41{ return false; }

◆ type()

virtual Type SkColorFilterBase::type ( ) const
pure virtual

Friends And Related Function Documentation

◆ SkColorFilter

friend class SkColorFilter
friend

Definition at line 85 of file SkColorFilterBase.h.


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