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

Public Member Functions

 PrecompileBlurShader (sk_sp< PrecompileShader > wrapped)
 
- Public Member Functions inherited from skgpu::graphite::PrecompileShader
 PrecompileShader ()
 
virtual bool isConstant (int desiredCombination) const
 
sk_sp< PrecompileShadermakeWithLocalMatrix ()
 
sk_sp< PrecompileShadermakeWithColorFilter (sk_sp< PrecompileColorFilter >)
 
sk_sp< PrecompileShadermakeWithWorkingColorSpace (sk_sp< SkColorSpace >)
 
sk_sp< PrecompileShadermakeWithCTM ()
 
- Public Member Functions inherited from skgpu::graphite::PrecompileBase
 PrecompileBase (Type type)
 
Type type () 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 numIntrinsicCombinations () const override
 
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 933 of file FactoryFunctions.cpp.

Constructor & Destructor Documentation

◆ PrecompileBlurShader()

skgpu::graphite::PrecompileBlurShader::PrecompileBlurShader ( sk_sp< PrecompileShader wrapped)
inline

Definition at line 935 of file FactoryFunctions.cpp.

936 : fWrapped(std::move(wrapped)) {
937 fNumWrappedCombos = fWrapped->numCombinations();
938 }
static sk_sp< GrTextureProxy > wrapped(skiatest::Reporter *reporter, GrRecordingContext *rContext, GrProxyProvider *proxyProvider, SkBackingFit fit)

Member Function Documentation

◆ addToKey()

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

Implements skgpu::graphite::PrecompileBase.

Definition at line 948 of file FactoryFunctions.cpp.

951 {
952 SkASSERT(desiredCombination < this->numCombinations());
953
954 using namespace SkKnownRuntimeEffects;
955
956 int desiredBlurCombination = desiredCombination % kNumIntrinsicCombinations;
957 int desiredWrappedCombination = desiredCombination / kNumIntrinsicCombinations;
958 SkASSERT(desiredWrappedCombination < fNumWrappedCombos);
959
960 static const StableKey kIDs[kNumIntrinsicCombinations] = {
961 StableKey::k1DBlur4, StableKey::k1DBlur8, StableKey::k1DBlur12,
962 StableKey::k1DBlur16, StableKey::k1DBlur20, StableKey::k1DBlur28,
963
964 StableKey::k2DBlur4, StableKey::k2DBlur8, StableKey::k2DBlur12,
965 StableKey::k2DBlur16, StableKey::k2DBlur20, StableKey::k2DBlur28,
966 };
967
968 const SkRuntimeEffect* fEffect = GetKnownRuntimeEffect(kIDs[desiredBlurCombination]);
969
970 KeyContextWithScope childContext(keyContext, KeyContext::Scope::kRuntimeEffect);
971
972 RuntimeEffectBlock::BeginBlock(keyContext, builder, gatherer, { sk_ref_sp(fEffect) });
973 fWrapped->priv().addToKey(childContext, builder, gatherer, desiredWrappedCombination);
974 builder->endBlock();
975 }
#define SkASSERT(cond)
Definition SkAssert.h:116
sk_sp< T > sk_ref_sp(T *obj)
Definition SkRefCnt.h:381
const SkRuntimeEffect * GetKnownRuntimeEffect(StableKey stableKey)
static void BeginBlock(const KeyContext &, PaintParamsKeyBuilder *, PipelineDataGatherer *, const ShaderData &)

◆ numChildCombinations()

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

Reimplemented from skgpu::graphite::PrecompileBase.

Definition at line 946 of file FactoryFunctions.cpp.

946{ return fNumWrappedCombos; }

◆ numIntrinsicCombinations()

int skgpu::graphite::PrecompileBlurShader::numIntrinsicCombinations ( ) const
inlineoverrideprivatevirtual

Reimplemented from skgpu::graphite::PrecompileBase.

Definition at line 944 of file FactoryFunctions.cpp.

944{ return kNumIntrinsicCombinations; }

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