Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSLDiscardStatement.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
13
14namespace SkSL {
15
16std::unique_ptr<Statement> DiscardStatement::Convert(const Context& context, Position pos) {
18 context.fErrors->error(pos, "discard statement is only permitted in fragment shaders");
19 return nullptr;
20 }
21 return DiscardStatement::Make(context, pos);
22}
23
24std::unique_ptr<Statement> DiscardStatement::Make(const Context& context, Position pos) {
26 return std::make_unique<DiscardStatement>(pos);
27}
28
29} // namespace SkSL
SkPoint pos
#define SkASSERT(cond)
Definition SkAssert.h:116
ErrorReporter * fErrors
Definition SkSLContext.h:36
ProgramConfig * fConfig
Definition SkSLContext.h:33
static std::unique_ptr< Statement > Make(const Context &context, Position pos)
static std::unique_ptr< Statement > Convert(const Context &context, Position pos)
void error(Position position, std::string_view msg)
static bool IsFragment(ProgramKind kind)