Flutter Engine
The Flutter Engine
SkSLLiteral.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
10
11namespace SkSL {
12
14 if (this->type().isBoolean()) {
15 return fValue ? "true" : "false";
16 }
17 if (this->type().isInteger()) {
18 return std::to_string(this->intValue());
19 }
20 return skstd::to_string(this->floatValue());
21}
22
23} // namespace SkSL
const Type & type() const
std::string description() const final
float floatValue() const
Definition: SkSLLiteral.h:92
SKSL_INT intValue() const
Definition: SkSLLiteral.h:97
OperatorPrecedence
Definition: SkSLOperator.h:57
std::string to_string(float value)
Definition: SkSLString.cpp:50
static SkString to_string(int n)
Definition: nanobench.cpp:119