Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkSL::RP::SwizzleLValue Class Referencefinal
Inheritance diagram for SkSL::RP::SwizzleLValue:
SkSL::RP::LValue

Public Member Functions

 SwizzleLValue (std::unique_ptr< LValue > p, const ComponentArray &c)
 
bool isWritable () const override
 
SlotRange fixedSlotRange (Generator *gen) override
 
AutoStackdynamicSlotRange () override
 
SkSpan< const int8_t > swizzle () override
 
bool push (Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle) override
 
bool store (Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle) override
 
- Public Member Functions inherited from SkSL::RP::LValue
virtual ~LValue ()=default
 
virtual bool isWritable () const =0
 
virtual SlotRange fixedSlotRange (Generator *gen)=0
 
virtual AutoStackdynamicSlotRange ()=0
 
virtual SkSpan< const int8_t > swizzle ()
 
virtual bool push (Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle)=0
 
virtual bool store (Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle)=0
 

Additional Inherited Members

- Public Attributes inherited from SkSL::RP::LValue
std::unique_ptr< ExpressionfScratchExpression
 

Detailed Description

Definition at line 906 of file SkSLRasterPipelineCodeGenerator.cpp.

Constructor & Destructor Documentation

◆ SwizzleLValue()

SkSL::RP::SwizzleLValue::SwizzleLValue ( std::unique_ptr< LValue p,
const ComponentArray c 
)
inlineexplicit

Definition at line 908 of file SkSLRasterPipelineCodeGenerator.cpp.

909 : fParent(std::move(p))
910 , fComponents(c) {
911 SkASSERT(!fComponents.empty() && fComponents.size() <= 4);
912 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

Member Function Documentation

◆ dynamicSlotRange()

AutoStack * SkSL::RP::SwizzleLValue::dynamicSlotRange ( )
inlineoverridevirtual

Returns a stack which holds a single integer, representing the dynamic offset of the lvalue. This value does not incorporate the fixed offset. If null is returned, the lvalue doesn't have a dynamic offset. evaluateDynamicIndices must be called before this is used.

Implements SkSL::RP::LValue.

Definition at line 922 of file SkSLRasterPipelineCodeGenerator.cpp.

922 {
923 return fParent->dynamicSlotRange();
924 }

◆ fixedSlotRange()

SlotRange SkSL::RP::SwizzleLValue::fixedSlotRange ( Generator gen)
inlineoverridevirtual

Returns the fixed slot range of the lvalue, after it is winnowed down to the selected field/index. The range is calculated assuming every dynamic index will evaluate to zero.

Implements SkSL::RP::LValue.

Definition at line 918 of file SkSLRasterPipelineCodeGenerator.cpp.

918 {
919 return fParent->fixedSlotRange(gen);
920 }
Definition: gen.py:1

◆ isWritable()

bool SkSL::RP::SwizzleLValue::isWritable ( ) const
inlineoverridevirtual

Returns true if this lvalue is actually writable–temporaries and uniforms are not.

Implements SkSL::RP::LValue.

Definition at line 914 of file SkSLRasterPipelineCodeGenerator.cpp.

914 {
915 return fParent->isWritable();
916 }

◆ push()

bool SkSL::RP::SwizzleLValue::push ( Generator gen,
SlotRange  fixedOffset,
AutoStack dynamicOffset,
SkSpan< const int8_t >  swizzle 
)
inlineoverridevirtual

Pushes values directly onto the stack.

Implements SkSL::RP::LValue.

Definition at line 930 of file SkSLRasterPipelineCodeGenerator.cpp.

933 {
934 if (!swizzle.empty()) {
935 SkDEBUGFAIL("swizzle-of-a-swizzle should have been folded out in front end");
936 return unsupported();
937 }
938 return fParent->push(gen, fixedOffset, dynamicOffset, fComponents);
939 }
#define SkDEBUGFAIL(message)
Definition: SkAssert.h:118
SkSpan< const int8_t > swizzle() override

◆ store()

bool SkSL::RP::SwizzleLValue::store ( Generator gen,
SlotRange  fixedOffset,
AutoStack dynamicOffset,
SkSpan< const int8_t >  swizzle 
)
inlineoverridevirtual

Stores topmost values from the stack directly into the lvalue.

Implements SkSL::RP::LValue.

Definition at line 941 of file SkSLRasterPipelineCodeGenerator.cpp.

944 {
945 if (!swizzle.empty()) {
946 SkDEBUGFAIL("swizzle-of-a-swizzle should have been folded out in front end");
947 return unsupported();
948 }
949 return fParent->store(gen, fixedOffset, dynamicOffset, fComponents);
950 }

◆ swizzle()

SkSpan< const int8_t > SkSL::RP::SwizzleLValue::swizzle ( )
inlineoverridevirtual

Returns the swizzle components of the lvalue, or an empty span for non-swizzle LValues.

Reimplemented from SkSL::RP::LValue.

Definition at line 926 of file SkSLRasterPipelineCodeGenerator.cpp.

926 {
927 return fComponents;
928 }

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