Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
skgpu::graphite::PrecompileWithWorkingFormatColorFilter Class Reference
Inheritance diagram for skgpu::graphite::PrecompileWithWorkingFormatColorFilter:
skgpu::graphite::PrecompileColorFilter skgpu::graphite::PrecompileBase SkRefCnt SkRefCntBase

Public Member Functions

 PrecompileWithWorkingFormatColorFilter (SkSpan< const sk_sp< PrecompileColorFilter > > childOptions)
 
- Public Member Functions inherited from skgpu::graphite::PrecompileColorFilter
 PrecompileColorFilter ()
 
sk_sp< PrecompileColorFiltermakeComposed (sk_sp< PrecompileColorFilter > inner) const
 
- Public Member Functions inherited from skgpu::graphite::PrecompileBase
 PrecompileBase (Type type)
 
Type type () const
 
virtual int numIntrinsicCombinations () const
 
int numCombinations () 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
 

Private Member Functions

int numChildCombinations () const override
 
void addToKey (const KeyContext &keyContext, PaintParamsKeyBuilder *builder, PipelineDataGatherer *gatherer, int desiredCombination) const override
 

Additional Inherited Members

- Public Types inherited from skgpu::graphite::PrecompileBase
enum class  Type {
  kBlender , kColorFilter , kImageFilter , kMaskFilter ,
  kShader
}
 
- Static Protected Member Functions inherited from skgpu::graphite::PrecompileBase
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)
 

Detailed Description

Definition at line 1242 of file FactoryFunctions.cpp.

Constructor & Destructor Documentation

◆ PrecompileWithWorkingFormatColorFilter()

skgpu::graphite::PrecompileWithWorkingFormatColorFilter::PrecompileWithWorkingFormatColorFilter ( SkSpan< const sk_sp< PrecompileColorFilter > >  childOptions)
inline

Definition at line 1244 of file FactoryFunctions.cpp.

1245 : fChildOptions(childOptions.begin(), childOptions.end()) {
1246
1247 fNumChildCombos = 0;
1248 for (const auto& childOption : fChildOptions) {
1249 fNumChildCombos += childOption->numCombinations();
1250 }
1251 }
constexpr T * begin() const
Definition SkSpan_impl.h:90
constexpr T * end() const
Definition SkSpan_impl.h:91

Member Function Documentation

◆ addToKey()

void skgpu::graphite::PrecompileWithWorkingFormatColorFilter::addToKey ( const KeyContext keyContext,
PaintParamsKeyBuilder builder,
PipelineDataGatherer gatherer,
int  desiredCombination 
) const
inlineoverrideprivatevirtual

Implements skgpu::graphite::PrecompileBase.

Definition at line 1256 of file FactoryFunctions.cpp.

1259 {
1260 SkASSERT(desiredCombination < fNumChildCombos);
1261
1262 constexpr SkAlphaType kAlphaType = kPremul_SkAlphaType;
1263 ColorSpaceTransformBlock::ColorSpaceTransformData csData(sk_srgb_singleton(), kAlphaType,
1264 sk_srgb_singleton(), kAlphaType);
1265
1266 // Use two nested compose blocks to chain (dst->working), child, and (working->dst) together
1267 // while appearing as one block to the parent node.
1268 Compose(keyContext, builder, gatherer,
1269 /* addInnerToKey= */ [&]() -> void {
1270 // Inner compose
1271 Compose(keyContext, builder, gatherer,
1272 /* addInnerToKey= */ [&]() -> void {
1273 // Innermost (inner of inner compose)
1274 ColorSpaceTransformBlock::AddBlock(keyContext, builder, gatherer,
1275 csData);
1276 },
1277 /* addOuterToKey= */ [&]() -> void {
1278 // Middle (outer of inner compose)
1279 AddToKey<PrecompileColorFilter>(keyContext, builder, gatherer,
1280 fChildOptions, desiredCombination);
1281 });
1282 },
1283 /* addOuterToKey= */ [&]() -> void {
1284 // Outermost (outer of outer compose)
1285 ColorSpaceTransformBlock::AddBlock(keyContext, builder, gatherer, csData);
1286 });
1287 }
SkAlphaType
Definition SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
#define SkASSERT(cond)
Definition SkAssert.h:116
SkColorSpace * sk_srgb_singleton()
void Compose(const KeyContext &keyContext, PaintParamsKeyBuilder *keyBuilder, PipelineDataGatherer *gatherer, AddToKeyFn addInnerToKey, AddToKeyFn addOuterToKey)
static void AddBlock(const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, const ColorSpaceTransformData &)

◆ numChildCombinations()

int skgpu::graphite::PrecompileWithWorkingFormatColorFilter::numChildCombinations ( ) const
inlineoverrideprivatevirtual

Reimplemented from skgpu::graphite::PrecompileBase.

Definition at line 1254 of file FactoryFunctions.cpp.

1254{ return fNumChildCombos; }

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