Flutter Engine
The Flutter Engine
SkSLChildCall.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google LLC
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_CHILDCALL
9#define SKSL_CHILDCALL
10
15
16#include <cstdint>
17#include <memory>
18#include <string>
19#include <utility>
20
21namespace SkSL {
22
23class Context;
24class Type;
25class Variable;
26enum class OperatorPrecedence : uint8_t;
27
28/**
29 * A call to a child effect object (shader, color filter, or blender).
30 */
31class ChildCall final : public Expression {
32public:
33 inline static constexpr Kind kIRNodeKind = Kind::kChildCall;
34
37 , fChild(*child)
38 , fArguments(std::move(arguments)) {}
39
40 // Creates the child call; reports errors via ASSERT.
41 static std::unique_ptr<Expression> Make(const Context& context,
43 const Type* returnType,
44 const Variable& child,
46
47 const Variable& child() const {
48 return fChild;
49 }
50
52 return fArguments;
53 }
54
55 const ExpressionArray& arguments() const {
56 return fArguments;
57 }
58
59 std::unique_ptr<Expression> clone(Position pos) const override;
60
61 std::string description(OperatorPrecedence) const override;
62
63private:
64 const Variable& fChild;
65 ExpressionArray fArguments;
66
67 using INHERITED = Expression;
68};
69
70} // namespace SkSL
71
72#endif
SkPoint pos
static constexpr Kind kIRNodeKind
Definition: SkSLChildCall.h:33
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type *returnType, const Variable &child, ExpressionArray arguments)
ChildCall(Position pos, const Type *type, const Variable *child, ExpressionArray arguments)
Definition: SkSLChildCall.h:35
ExpressionArray & arguments()
Definition: SkSLChildCall.h:51
const ExpressionArray & arguments() const
Definition: SkSLChildCall.h:55
const Variable & child() const
Definition: SkSLChildCall.h:47
std::unique_ptr< Expression > clone() const
Expression(Position pos, Kind kind, const Type *type)
const Type & type() const
std::string description() const final
OperatorPrecedence
Definition: SkSLOperator.h:57
ExpressionKind
Definition: SkSLIRNode.h:62
Definition: ref_ptr.h:256