Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
sksl
ir
SkSLSwitchCase.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2023 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 "
src/sksl/ir/SkSLSwitchCase.h
"
9
10
namespace
SkSL
{
11
12
std::unique_ptr<SwitchCase>
SwitchCase::Make
(
Position
pos
,
13
SKSL_INT
value,
14
std::unique_ptr<Statement> statement) {
15
return
std::unique_ptr<SwitchCase>(
new
SwitchCase
(
pos
,
/*isDefault=*/
false
,
value
,
16
std::move(
statement
)));
17
}
18
19
std::unique_ptr<SwitchCase>
SwitchCase::MakeDefault
(
Position
pos
,
20
std::unique_ptr<Statement> statement) {
21
return
std::unique_ptr<SwitchCase>(
new
SwitchCase
(
pos
,
/*isDefault=*/
true
,
/*value=*/
-1,
22
std::move(
statement
)));
23
}
24
25
std::string
SwitchCase::description
()
const
{
26
return
fDefault ?
"default: \n"
+ fStatement->description()
27
:
"case "
+ std::to_string(fValue) +
": \n"
+ fStatement->description();
28
}
29
30
}
// namespace SkSL
pos
SkPoint pos
Definition
ImageShaderTest.cpp:27
SKSL_INT
int64_t SKSL_INT
Definition
SkSLDefines.h:16
SkSLSwitchCase.h
SkSL::Position
Definition
SkSLPosition.h:18
SkSL::SwitchCase
Definition
SkSLSwitchCase.h:26
SkSL::SwitchCase::MakeDefault
static std::unique_ptr< SwitchCase > MakeDefault(Position pos, std::unique_ptr< Statement > statement)
Definition
SkSLSwitchCase.cpp:19
SkSL::SwitchCase::value
SKSL_INT value() const
Definition
SkSLSwitchCase.h:41
SkSL::SwitchCase::description
std::string description() const override
Definition
SkSLSwitchCase.cpp:25
SkSL::SwitchCase::Make
static std::unique_ptr< SwitchCase > Make(Position pos, SKSL_INT value, std::unique_ptr< Statement > statement)
Definition
SkSLSwitchCase.cpp:12
SkSL::SwitchCase::statement
std::unique_ptr< Statement > & statement()
Definition
SkSLSwitchCase.h:46
SkSL
Definition
SkCapabilities.h:15
Generated on Fri Apr 26 2024 06:17:32 for Flutter Engine by
1.9.8