Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
sksl
ir
SkSLFunctionReference.h
Go to the documentation of this file.
1
/*
2
* Copyright 2016 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
#ifndef SKSL_FUNCTIONREFERENCE
9
#define SKSL_FUNCTIONREFERENCE
10
11
#include "
src/sksl/SkSLBuiltinTypes.h
"
12
#include "
src/sksl/SkSLContext.h
"
13
#include "
src/sksl/ir/SkSLExpression.h
"
14
#include "
src/sksl/ir/SkSLFunctionDeclaration.h
"
15
16
namespace
SkSL
{
17
18
/**
19
* An identifier referring to a function name. This is an intermediate value: FunctionReferences are
20
* always eventually replaced by FunctionCalls in valid programs.
21
*/
22
class
FunctionReference
final :
public
Expression
{
23
public
:
24
inline
static
constexpr
Kind
kIRNodeKind
= Kind::kFunctionReference;
25
26
FunctionReference
(
const
Context
& context,
Position
pos
,
27
const
FunctionDeclaration
*
overloadChain
)
28
:
INHERITED
(
pos
,
kIRNodeKind
, context.fTypes.fInvalid.get())
29
, fOverloadChain(
overloadChain
) {}
30
31
const
FunctionDeclaration
*
overloadChain
()
const
{
32
return
fOverloadChain;
33
}
34
35
std::unique_ptr<Expression>
clone
(
Position
pos
)
const override
{
36
return
std::unique_ptr<Expression>(
new
FunctionReference
(
pos
, this->
overloadChain
(),
37
&this->
type
()));
38
}
39
40
std::string
description
(
OperatorPrecedence
)
const override
{
41
return
"<function>"
;
42
}
43
44
private
:
45
FunctionReference
(
Position
pos
,
const
FunctionDeclaration
*
overloadChain
,
const
Type
*
type
)
46
: INHERITED(
pos
,
kIRNodeKind
,
type
)
47
, fOverloadChain(
overloadChain
) {}
48
49
const
FunctionDeclaration* fOverloadChain;
50
51
using
INHERITED = Expression;
52
};
53
54
}
// namespace SkSL
55
56
#endif
pos
SkPoint pos
Definition
ImageShaderTest.cpp:27
SkSLBuiltinTypes.h
SkSLContext.h
SkSLExpression.h
SkSLFunctionDeclaration.h
SkSL::Context
Definition
SkSLContext.h:24
SkSL::Expression
Definition
SkSLExpression.h:30
SkSL::Expression::type
virtual const Type & type() const
Definition
SkSLExpression.h:44
SkSL::FunctionDeclaration
Definition
SkSLFunctionDeclaration.h:36
SkSL::FunctionReference
Definition
SkSLFunctionReference.h:22
SkSL::FunctionReference::clone
std::unique_ptr< Expression > clone(Position pos) const override
Definition
SkSLFunctionReference.h:35
SkSL::FunctionReference::kIRNodeKind
static constexpr Kind kIRNodeKind
Definition
SkSLFunctionReference.h:24
SkSL::FunctionReference::description
std::string description(OperatorPrecedence) const override
Definition
SkSLFunctionReference.h:40
SkSL::FunctionReference::FunctionReference
FunctionReference(const Context &context, Position pos, const FunctionDeclaration *overloadChain)
Definition
SkSLFunctionReference.h:26
SkSL::FunctionReference::overloadChain
const FunctionDeclaration * overloadChain() const
Definition
SkSLFunctionReference.h:31
SkSL::Position
Definition
SkSLPosition.h:18
SkSL
Definition
SkCapabilities.h:15
SkSL::OperatorPrecedence
OperatorPrecedence
Definition
SkSLOperator.h:57
SkSL::ExpressionKind
ExpressionKind
Definition
SkSLIRNode.h:62
Type
Definition
asyncrescaleandread.cpp:530
Generated on Fri Apr 26 2024 06:17:31 for Flutter Engine by
1.9.8