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

Public Types

enum class  Flags { kNone , kIncludeWithOutVariant }
 
- Public Types inherited from skgpu::graphite::PrecompileBase
enum class  Type {
  kBlender , kColorFilter , kImageFilter , kMaskFilter ,
  kShader
}
 

Public Member Functions

 PrecompileLocalMatrixShader (SkSpan< const sk_sp< PrecompileShader > > wrapped, Flags flags=Flags::kNone)
 
bool isConstant (int desiredCombination) const override
 
- 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

- 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 570 of file PrecompileShader.cpp.

Member Enumeration Documentation

◆ Flags

Enumerator
kNone 
kIncludeWithOutVariant 

Definition at line 572 of file PrecompileShader.cpp.

572 {
573 kNone,
574 kIncludeWithOutVariant,
575 };
@ kNone
Definition: layer.h:53

Constructor & Destructor Documentation

◆ PrecompileLocalMatrixShader()

skgpu::graphite::PrecompileLocalMatrixShader::PrecompileLocalMatrixShader ( SkSpan< const sk_sp< PrecompileShader > >  wrapped,
Flags  flags = Flags::kNone 
)
inline

Definition at line 577 of file PrecompileShader.cpp.

579 : fWrapped(wrapped.begin(), wrapped.end())
580 , fFlags(flags) {
581 fNumWrappedCombos = 0;
582 for (const auto& s : fWrapped) {
583 fNumWrappedCombos += s->priv().numCombinations();
584 }
585 }
static sk_sp< GrTextureProxy > wrapped(skiatest::Reporter *reporter, GrRecordingContext *rContext, GrProxyProvider *proxyProvider, SkBackingFit fit)
struct MyStruct s
FlutterSemanticsFlag flags

Member Function Documentation

◆ isConstant()

bool skgpu::graphite::PrecompileLocalMatrixShader::isConstant ( int  desiredCombination) const
inlineoverridevirtual

Reimplemented from skgpu::graphite::PrecompileShader.

Definition at line 587 of file PrecompileShader.cpp.

587 {
588 SkASSERT(desiredCombination < this->numCombinations());
589
590 /*
591 * Regardless of whether the LocalMatrixShader elides itself or not, we always want
592 * the Constant-ness of the wrapped shader.
593 */
594 int desiredWrappedCombination = desiredCombination / kNumIntrinsicCombinations;
595 SkASSERT(desiredWrappedCombination < fNumWrappedCombos);
596
597 std::pair<sk_sp<PrecompileShader>, int> wrapped =
598 PrecompileBase::SelectOption(SkSpan(fWrapped), desiredWrappedCombination);
599 if (wrapped.first) {
600 return wrapped.first->priv().isConstant(wrapped.second);
601 }
602
603 return false;
604 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkSpan(Container &&) -> SkSpan< std::remove_pointer_t< decltype(std::data(std::declval< Container >()))> >
GrSurfaceProxyPriv priv()
static std::pair< sk_sp< T >, int > SelectOption(SkSpan< const sk_sp< T > > options, int desiredOption)

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