Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
sksl
ir
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
8
#include "
include/core/SkTypes.h
"
9
#include "
src/sksl/SkSLContext.h
"
10
#include "
src/sksl/SkSLErrorReporter.h
"
11
#include "
src/sksl/SkSLProgramSettings.h
"
12
#include "
src/sksl/ir/SkSLDiscardStatement.h
"
13
14
namespace
SkSL
{
15
16
std::unique_ptr<Statement>
DiscardStatement::Convert
(
const
Context
& context,
Position
pos
) {
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
}
23
24
std::unique_ptr<Statement>
DiscardStatement::Make
(
const
Context
& context,
Position
pos
) {
25
SkASSERT
(
ProgramConfig::IsFragment
(context.
fConfig
->
fKind
));
26
return
std::make_unique<DiscardStatement>(
pos
);
27
}
28
29
}
// namespace SkSL
pos
SkPoint pos
Definition
ImageShaderTest.cpp:27
SkASSERT
#define SkASSERT(cond)
Definition
SkAssert.h:116
SkSLContext.h
SkSLDiscardStatement.h
SkSLErrorReporter.h
SkSLProgramSettings.h
SkTypes.h
SkSL::Context
Definition
SkSLContext.h:24
SkSL::Context::fErrors
ErrorReporter * fErrors
Definition
SkSLContext.h:36
SkSL::Context::fConfig
ProgramConfig * fConfig
Definition
SkSLContext.h:33
SkSL::DiscardStatement::Make
static std::unique_ptr< Statement > Make(const Context &context, Position pos)
Definition
SkSLDiscardStatement.cpp:24
SkSL::DiscardStatement::Convert
static std::unique_ptr< Statement > Convert(const Context &context, Position pos)
Definition
SkSLDiscardStatement.cpp:16
SkSL::ErrorReporter::error
void error(Position position, std::string_view msg)
Definition
SkSLErrorReporter.cpp:16
SkSL::Position
Definition
SkSLPosition.h:18
SkSL
Definition
SkCapabilities.h:15
SkSL::ProgramConfig::fKind
ProgramKind fKind
Definition
SkSLProgramSettings.h:84
SkSL::ProgramConfig::IsFragment
static bool IsFragment(ProgramKind kind)
Definition
SkSLProgramSettings.h:113
Generated on Fri Apr 26 2024 06:17:31 for Flutter Engine by
1.9.8