Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkSL::RP::AutoStack Class Reference

Public Member Functions

 AutoStack (Generator *g)
 
 ~AutoStack ()
 
void enter ()
 
void exit ()
 
int stackID ()
 
void pushClone (int slots)
 
void pushClone (SlotRange range, int offsetFromStackTop)
 
void pushCloneIndirect (SlotRange range, int dynamicStackID, int offsetFromStackTop)
 

Detailed Description

Definition at line 148 of file SkSLRasterPipelineCodeGenerator.cpp.

Constructor & Destructor Documentation

◆ AutoStack()

SkSL::RP::AutoStack::AutoStack ( Generator g)
explicit

Creates a temporary stack. The caller is responsible for discarding every entry on this stack before ~AutoStack is reached.

Definition at line 564 of file SkSLRasterPipelineCodeGenerator.cpp.

565 : fGenerator(g)
566 , fStackID(g->createStack()) {}

◆ ~AutoStack()

SkSL::RP::AutoStack::~AutoStack ( )

Definition at line 568 of file SkSLRasterPipelineCodeGenerator.cpp.

568 {
569 fGenerator->recycleStack(fStackID);
570}

Member Function Documentation

◆ enter()

void SkSL::RP::AutoStack::enter ( )

Activates the associated stack.

Definition at line 572 of file SkSLRasterPipelineCodeGenerator.cpp.

572 {
573 fParentStackID = fGenerator->currentStack();
574 fGenerator->setCurrentStack(fStackID);
575}

◆ exit()

void SkSL::RP::AutoStack::exit ( )

Undoes a call to enter, returning to the previously-active stack.

Definition at line 577 of file SkSLRasterPipelineCodeGenerator.cpp.

577 {
578 SkASSERT(fGenerator->currentStack() == fStackID);
579 fGenerator->setCurrentStack(fParentStackID);
580}
#define SkASSERT(cond)
Definition SkAssert.h:116

◆ pushClone() [1/2]

void SkSL::RP::AutoStack::pushClone ( int  slots)

Clones values from this stack onto the top of the active stack.

Definition at line 582 of file SkSLRasterPipelineCodeGenerator.cpp.

582 {
583 this->pushClone(SlotRange{0, slots}, /*offsetFromStackTop=*/slots);
584}

◆ pushClone() [2/2]

void SkSL::RP::AutoStack::pushClone ( SlotRange  range,
int  offsetFromStackTop 
)

Clones values from a fixed range of this stack onto the top of the active stack.

Definition at line 586 of file SkSLRasterPipelineCodeGenerator.cpp.

586 {
587 fGenerator->builder()->push_clone_from_stack(range, fStackID, offsetFromStackTop);
588}
void push_clone_from_stack(SlotRange range, int otherStackID, int offsetFromStackTop)

◆ pushCloneIndirect()

void SkSL::RP::AutoStack::pushCloneIndirect ( SlotRange  range,
int  dynamicStackID,
int  offsetFromStackTop 
)

Clones values from a dynamic range of this stack onto the top of the active stack.

Definition at line 590 of file SkSLRasterPipelineCodeGenerator.cpp.

590 {
592 range, dynamicStackID, /*otherStackID=*/fStackID, offsetFromStackTop);
593}
void push_clone_indirect_from_stack(SlotRange fixedOffset, int dynamicStackID, int otherStackID, int offsetFromStackTop)

◆ stackID()

int SkSL::RP::AutoStack::stackID ( )
inline

Returns the stack ID of this AutoStack.

Definition at line 164 of file SkSLRasterPipelineCodeGenerator.cpp.

164{ return fStackID; }

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