Flutter Engine
The Flutter Engine
Public Member Functions | Protected Attributes | List of all members
SkSL::RP::UnownedLValueSlice Class Reference
Inheritance diagram for SkSL::RP::UnownedLValueSlice:
SkSL::RP::LValue SkSL::RP::LValueSlice

Public Member Functions

 UnownedLValueSlice (LValue *p, int initialSlot, int numSlots)
 
bool isWritable () const override
 
SlotRange fixedSlotRange (Generator *gen) override
 
AutoStackdynamicSlotRange () 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
 

Protected Attributes

LValuefParent
 

Additional Inherited Members

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

Detailed Description

Definition at line 957 of file SkSLRasterPipelineCodeGenerator.cpp.

Constructor & Destructor Documentation

◆ UnownedLValueSlice()

SkSL::RP::UnownedLValueSlice::UnownedLValueSlice ( LValue p,
int  initialSlot,
int  numSlots 
)
inlineexplicit

Definition at line 959 of file SkSLRasterPipelineCodeGenerator.cpp.

960 : fParent(p)
961 , fInitialSlot(initialSlot)
962 , fNumSlots(numSlots) {
963 SkASSERT(fInitialSlot >= 0);
964 SkASSERT(fNumSlots > 0);
965 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

Member Function Documentation

◆ dynamicSlotRange()

AutoStack * SkSL::RP::UnownedLValueSlice::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 980 of file SkSLRasterPipelineCodeGenerator.cpp.

980 {
981 return fParent->dynamicSlotRange();
982 }
virtual AutoStack * dynamicSlotRange()=0

◆ fixedSlotRange()

SlotRange SkSL::RP::UnownedLValueSlice::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 971 of file SkSLRasterPipelineCodeGenerator.cpp.

971 {
972 SlotRange range = fParent->fixedSlotRange(gen);
973 SlotRange adjusted = range;
974 adjusted.index += fInitialSlot;
975 adjusted.count = fNumSlots;
976 SkASSERT((adjusted.index + adjusted.count) <= (range.index + range.count));
977 return adjusted;
978 }
virtual SlotRange fixedSlotRange(Generator *gen)=0
Definition: gen.py:1

◆ isWritable()

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

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

Implements SkSL::RP::LValue.

Definition at line 967 of file SkSLRasterPipelineCodeGenerator.cpp.

967 {
968 return fParent->isWritable();
969 }
virtual bool isWritable() const =0

◆ push()

bool SkSL::RP::UnownedLValueSlice::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 984 of file SkSLRasterPipelineCodeGenerator.cpp.

987 {
988 return fParent->push(gen, fixedOffset, dynamicOffset, swizzle);
989 }
virtual bool push(Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle)=0
virtual SkSpan< const int8_t > swizzle()

◆ store()

bool SkSL::RP::UnownedLValueSlice::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 991 of file SkSLRasterPipelineCodeGenerator.cpp.

994 {
995 return fParent->store(gen, fixedOffset, dynamicOffset, swizzle);
996 }
virtual bool store(Generator *gen, SlotRange fixedOffset, AutoStack *dynamicOffset, SkSpan< const int8_t > swizzle)=0

Member Data Documentation

◆ fParent

LValue* SkSL::RP::UnownedLValueSlice::fParent
protected

Definition at line 999 of file SkSLRasterPipelineCodeGenerator.cpp.


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