Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
SkSL::DiscardStatement Class Referencefinal

#include <SkSLDiscardStatement.h>

Inheritance diagram for SkSL::DiscardStatement:
SkSL::Statement SkSL::IRNode SkSL::Poolable

Public Member Functions

 DiscardStatement (Position pos)
 
std::string description () const override
 
- Public Member Functions inherited from SkSL::Statement
 Statement (Position pos, Kind kind)
 
Kind kind () const
 
virtual bool isEmpty () const
 
- Public Member Functions inherited from SkSL::IRNode
virtual ~IRNode ()
 
 IRNode (const IRNode &)=delete
 
IRNodeoperator= (const IRNode &)=delete
 
Position position () const
 
void setPosition (Position p)
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
Tas ()
 

Static Public Member Functions

static std::unique_ptr< StatementConvert (const Context &context, Position pos)
 
static std::unique_ptr< StatementMake (const Context &context, Position pos)
 
- Static Public Member Functions inherited from SkSL::Poolable
static void * operator new (const size_t size)
 
static void operator delete (void *ptr)
 

Static Public Attributes

static constexpr Kind kIRNodeKind = Kind::kDiscard
 

Additional Inherited Members

- Public Types inherited from SkSL::Statement
using Kind = StatementKind
 
- Public Attributes inherited from SkSL::IRNode
Position fPosition
 
- Protected Member Functions inherited from SkSL::IRNode
 IRNode (Position position, int kind)
 
- Protected Attributes inherited from SkSL::IRNode
int fKind
 

Detailed Description

A 'discard' statement.

Definition at line 25 of file SkSLDiscardStatement.h.

Constructor & Destructor Documentation

◆ DiscardStatement()

SkSL::DiscardStatement::DiscardStatement ( Position  pos)
inline

Definition at line 29 of file SkSLDiscardStatement.h.

29: INHERITED(pos, kIRNodeKind) {}
SkPoint pos
static constexpr Kind kIRNodeKind

Member Function Documentation

◆ Convert()

std::unique_ptr< Statement > SkSL::DiscardStatement::Convert ( const Context context,
Position  pos 
)
static

Definition at line 16 of file SkSLDiscardStatement.cpp.

16 {
17 if (!ProgramConfig::IsFragment(context.fConfig->fKind)) {
18 context.fErrors->error(pos, "discard statement is only permitted in fragment shaders");
19 return nullptr;
20 }
21 return DiscardStatement::Make(context, pos);
22}
static std::unique_ptr< Statement > Make(const Context &context, Position pos)
static bool IsFragment(ProgramKind kind)

◆ description()

std::string SkSL::DiscardStatement::description ( ) const
inlineoverridevirtual

Implements SkSL::IRNode.

Definition at line 37 of file SkSLDiscardStatement.h.

37 {
38 return "discard;";
39 }

◆ Make()

std::unique_ptr< Statement > SkSL::DiscardStatement::Make ( const Context context,
Position  pos 
)
static

Definition at line 24 of file SkSLDiscardStatement.cpp.

24 {
25 SkASSERT(ProgramConfig::IsFragment(context.fConfig->fKind));
26 return std::make_unique<DiscardStatement>(pos);
27}
#define SkASSERT(cond)
Definition SkAssert.h:116

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::DiscardStatement::kIRNodeKind = Kind::kDiscard
inlinestaticconstexpr

Definition at line 27 of file SkSLDiscardStatement.h.


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