Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
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)
ExpressionArray & arguments()
const ExpressionArray & arguments() const
const Variable & child() const
virtual const Type & type() const
std::unique_ptr< Expression > clone() const
std::string description() const final
OperatorPrecedence
ExpressionKind
Definition SkSLIRNode.h:62
Definition ref_ptr.h:256