Flutter Engine
The Flutter Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
skgpu::graphite::PrecompileBase Class Referenceabstract

#include <PrecompileBase.h>

Inheritance diagram for skgpu::graphite::PrecompileBase:
SkRefCnt SkRefCntBase skgpu::graphite::PrecompileBlender skgpu::graphite::PrecompileColorFilter skgpu::graphite::PrecompileImageFilter skgpu::graphite::PrecompileMaskFilter skgpu::graphite::PrecompileShader skgpu::graphite::PrecompileBlendModeBlender skgpu::graphite::PrecompileBlendModeColorFilter skgpu::graphite::PrecompileColorSpaceXformColorFilter skgpu::graphite::PrecompileComposeColorFilter skgpu::graphite::PrecompileGaussianColorFilter skgpu::graphite::PrecompileMatrixColorFilter skgpu::graphite::PrecompileTableColorFilter skgpu::graphite::PrecompileWithWorkingFormatColorFilter skgpu::graphite::PrecompileBlendFilterImageFilter skgpu::graphite::PrecompileBlurImageFilter skgpu::graphite::PrecompileColorFilterImageFilter skgpu::graphite::PrecompileDisplacementMapImageFilter skgpu::graphite::PrecompileLightingImageFilter skgpu::graphite::PrecompileMatrixConvolutionImageFilter skgpu::graphite::PrecompileMorphologyImageFilter skgpu::graphite::PrecompileBlurMaskFilter skgpu::graphite::PrecompileBlendShader skgpu::graphite::PrecompileBlurShader skgpu::graphite::PrecompileCTMShader skgpu::graphite::PrecompileColorFilterShader skgpu::graphite::PrecompileColorShader skgpu::graphite::PrecompileCoordClampShader skgpu::graphite::PrecompileDisplacementShader skgpu::graphite::PrecompileEmptyShader skgpu::graphite::PrecompileGradientShader skgpu::graphite::PrecompileImageShader skgpu::graphite::PrecompileLightingShader skgpu::graphite::PrecompileLocalMatrixShader skgpu::graphite::PrecompileMatrixConvolutionShader skgpu::graphite::PrecompileMorphologyShader skgpu::graphite::PrecompilePerlinNoiseShader skgpu::graphite::PrecompileWorkingColorSpaceShader skgpu::graphite::PrecompileYUVImageShader

Public Types

enum class  Type {
  kBlender , kColorFilter , kImageFilter , kMaskFilter ,
  kShader
}
 

Public Member Functions

Type type () const
 
PrecompileBasePriv priv ()
 
const PrecompileBasePriv priv () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

 PrecompileBase (Type type)
 
virtual int numIntrinsicCombinations () const
 
virtual int numChildCombinations () const
 
int numCombinations () const
 
virtual void addToKey (const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, int desiredCombination) const =0
 

Static Protected Member Functions

template<typename T >
static std::pair< sk_sp< T >, intSelectOption (SkSpan< const sk_sp< T > > options, int desiredOption)
 
template<typename T >
static void AddToKey (const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, SkSpan< const sk_sp< T > > options, int desiredOption)
 

Friends

class PaintOptions
 
class PrecompileBasePriv
 

Detailed Description

This is the base class for all the objects that can be attached to PaintOptions.

Definition at line 24 of file PrecompileBase.h.

Member Enumeration Documentation

◆ Type

Enumerator
kBlender 
kColorFilter 
kImageFilter 
kMaskFilter 
kShader 

Definition at line 26 of file PrecompileBase.h.

26 {
27 kBlender,
29 kImageFilter,
30 kMaskFilter,
31 kShader,
32 };

Constructor & Destructor Documentation

◆ PrecompileBase()

skgpu::graphite::PrecompileBase::PrecompileBase ( Type  type)
inlineprotected

Definition at line 41 of file PrecompileBase.h.

41: fType(type) {}

Member Function Documentation

◆ addToKey()

virtual void skgpu::graphite::PrecompileBase::addToKey ( const KeyContext ,
PaintParamsKeyBuilder ,
PipelineDataGatherer ,
int  desiredCombination 
) const
protectedpure virtual

◆ AddToKey()

template<typename T >
void skgpu::graphite::PrecompileBase::AddToKey ( const KeyContext keyContext,
PaintParamsKeyBuilder builder,
PipelineDataGatherer gatherer,
SkSpan< const sk_sp< T > >  options,
int  desiredOption 
)
staticprotected

Definition at line 31 of file PrecompileBaseComplete.h.

35 {
36 auto [option, childOptions] = SelectOption(options, desiredOption);
37 if (option) {
38 option->priv().addToKey(keyContext, builder, gatherer, childOptions);
39 }
40}
const char * options
static std::pair< sk_sp< T >, int > SelectOption(SkSpan< const sk_sp< T > > options, int desiredOption)

◆ numChildCombinations()

virtual int skgpu::graphite::PrecompileBase::numChildCombinations ( ) const
inlineprotectedvirtual

Definition at line 44 of file PrecompileBase.h.

44{ return 1; }

◆ numCombinations()

int skgpu::graphite::PrecompileBase::numCombinations ( ) const
inlineprotected

This call returns the number of combinations generated from this object and its childen.

Returns
number of precompilation combinations generated by this object

Definition at line 50 of file PrecompileBase.h.

50 {
51 return this->numIntrinsicCombinations() * this->numChildCombinations();
52 }
virtual int numChildCombinations() const
virtual int numIntrinsicCombinations() const

◆ numIntrinsicCombinations()

virtual int skgpu::graphite::PrecompileBase::numIntrinsicCombinations ( ) const
inlineprotectedvirtual

Definition at line 43 of file PrecompileBase.h.

43{ return 1; }

◆ priv() [1/2]

PrecompileBasePriv skgpu::graphite::PrecompileBase::priv ( )
inline

Definition at line 51 of file PrecompileBasePriv.h.

51{ return PrecompileBasePriv(this); }

◆ priv() [2/2]

const PrecompileBasePriv skgpu::graphite::PrecompileBase::priv ( ) const
inline

Definition at line 54 of file PrecompileBasePriv.h.

54 {
55 return PrecompileBasePriv(const_cast<PrecompileBase *>(this));
56}

◆ SelectOption()

template<typename T >
std::pair< sk_sp< T >, int > skgpu::graphite::PrecompileBase::SelectOption ( SkSpan< const sk_sp< T > >  options,
int  desiredOption 
)
staticprotected

Definition at line 19 of file PrecompileBaseComplete.h.

20 {
21 for (const sk_sp<T>& option : options) {
22 if (desiredOption < (option ? option->numCombinations() : 1)) {
23 return { option, desiredOption };
24 }
25 desiredOption -= option ? option->numCombinations() : 1;
26 }
27 return { nullptr, 0 };
28}

◆ type()

Type skgpu::graphite::PrecompileBase::type ( ) const
inline

Definition at line 34 of file PrecompileBase.h.

34{ return fType; }

Friends And Related Function Documentation

◆ PaintOptions

friend class PaintOptions
friend

Definition at line 74 of file PrecompileBase.h.

◆ PrecompileBasePriv

friend class PrecompileBasePriv
friend

Definition at line 75 of file PrecompileBase.h.


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