Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::PrecompileBlendShader Class Referencefinal
Inheritance diagram for skgpu::graphite::PrecompileBlendShader:
skgpu::graphite::PrecompileShader skgpu::graphite::PrecompileBase SkRefCnt SkRefCntBase

Public Member Functions

 PrecompileBlendShader (SkSpan< const sk_sp< PrecompileBlender > > runtimeBlendEffects, SkSpan< const sk_sp< PrecompileShader > > dsts, SkSpan< const sk_sp< PrecompileShader > > srcs, bool needsPorterDuffBased, bool needsSeparableMode)
 
- Public Member Functions inherited from skgpu::graphite::PrecompileShader
sk_sp< PrecompileShadermakeWithLocalMatrix ()
 
sk_sp< PrecompileShadermakeWithColorFilter (sk_sp< PrecompileColorFilter >)
 
sk_sp< PrecompileShadermakeWithWorkingColorSpace (sk_sp< SkColorSpace >)
 
PrecompileShaderPriv priv ()
 
const PrecompileShaderPriv priv () const
 
- Public Member Functions inherited from skgpu::graphite::PrecompileBase
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
 

Additional Inherited Members

- Public Types inherited from skgpu::graphite::PrecompileBase
enum class  Type {
  kBlender , kColorFilter , kImageFilter , kMaskFilter ,
  kShader
}
 
- Protected Member Functions inherited from skgpu::graphite::PrecompileShader
 PrecompileShader ()
 
 ~PrecompileShader () override
 
virtual bool isConstant (int) const
 
virtual bool isALocalMatrixShader () const
 
- Protected Member Functions inherited from skgpu::graphite::PrecompileBase
 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 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 109 of file PrecompileShader.cpp.

Constructor & Destructor Documentation

◆ PrecompileBlendShader()

skgpu::graphite::PrecompileBlendShader::PrecompileBlendShader ( SkSpan< const sk_sp< PrecompileBlender > >  runtimeBlendEffects,
SkSpan< const sk_sp< PrecompileShader > >  dsts,
SkSpan< const sk_sp< PrecompileShader > >  srcs,
bool  needsPorterDuffBased,
bool  needsSeparableMode 
)
inline

Definition at line 111 of file PrecompileShader.cpp.

116 : fRuntimeBlendEffects(runtimeBlendEffects.begin(), runtimeBlendEffects.end())
117 , fDstOptions(dsts.begin(), dsts.end())
118 , fSrcOptions(srcs.begin(), srcs.end()) {
119
120 fNumBlenderCombos = 0;
121 for (const auto& rt : fRuntimeBlendEffects) {
122 fNumBlenderCombos += rt->priv().numCombinations();
123 }
124 if (needsPorterDuffBased) {
125 ++fNumBlenderCombos;
126 }
127 if (needsSeparableMode) {
128 ++fNumBlenderCombos;
129 }
130
131 SkASSERT(fNumBlenderCombos >= 1);
132
133 fNumDstCombos = 0;
134 for (const auto& d : fDstOptions) {
135 fNumDstCombos += d->priv().numCombinations();
136 }
137
138 fNumSrcCombos = 0;
139 for (const auto& s : fSrcOptions) {
140 fNumSrcCombos += s->priv().numCombinations();
141 }
142
143 if (needsPorterDuffBased) {
144 fPorterDuffIndex = 0;
145 if (needsSeparableMode) {
146 fSeparableModeIndex = 1;
147 if (!fRuntimeBlendEffects.empty()) {
148 fBlenderIndex = 2;
149 }
150 } else if (!fRuntimeBlendEffects.empty()) {
151 fBlenderIndex = 1;
152 }
153 } else if (needsSeparableMode) {
154 fSeparableModeIndex = 0;
155 if (!fRuntimeBlendEffects.empty()) {
156 fBlenderIndex = 1;
157 }
158 } else {
159 SkASSERT(!fRuntimeBlendEffects.empty());
160 fBlenderIndex = 0;
161 }
162 }
static const char * srcs[2]
Definition: EncodeBench.cpp:88
#define SkASSERT(cond)
Definition: SkAssert.h:116
constexpr T * begin() const
Definition: SkSpan_impl.h:90
constexpr T * end() const
Definition: SkSpan_impl.h:91
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
struct MyStruct s

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