2 * Copyright 2021 Google LLC
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
11 #include "include/private/SkTArray.h"
12 #include "src/sksl/ir/SkSLExpression.h"
13 #include "src/sksl/ir/SkSLVariable.h"
18 * A call to a child effect object (shader, color filter, or blender).
20 class ChildCall final : public Expression {
22 inline static constexpr Kind kExpressionKind = Kind::kChildCall;
24 ChildCall(Position pos, const Type* type, const Variable* child, ExpressionArray arguments)
25 : INHERITED(pos, kExpressionKind, type)
27 , fArguments(std::move(arguments)) {}
29 // Creates the child call; reports errors via ASSERT.
30 static std::unique_ptr<Expression> Make(const Context& context,
32 const Type* returnType,
33 const Variable& child,
34 ExpressionArray arguments);
36 const Variable& child() const {
40 ExpressionArray& arguments() {
44 const ExpressionArray& arguments() const {
48 bool hasProperty(Property property) const override;
50 std::unique_ptr<Expression> clone(Position pos) const override;
52 std::string description() const override;
55 const Variable& fChild;
56 ExpressionArray fArguments;
58 using INHERITED = Expression;