Flutter Engine
The Flutter Engine
SkSLModifiersDeclaration.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_MODIFIERDECLARATION
9#define SKSL_MODIFIERDECLARATION
10
16
17#include <memory>
18#include <string>
19
20namespace SkSL {
21
22class Context;
23struct Modifiers;
24
25/**
26 * A declaration that consists only of modifiers, e.g.:
27 *
28 * layout(blend_support_all_equations) out;
29 */
31public:
32 inline static constexpr Kind kIRNodeKind = Kind::kModifiers;
33
36 , fLayout(layout)
37 , fFlags(flags) {}
38
39 static std::unique_ptr<ModifiersDeclaration> Convert(const Context& context,
40 const Modifiers& modifiers);
41
42 static std::unique_ptr<ModifiersDeclaration> Make(const Context& context,
43 const Modifiers& modifiers);
44
45 const Layout& layout() const {
46 return fLayout;
47 }
48
50 return fFlags;
51 }
52
53 std::string description() const override {
54 return fLayout.paddedDescription() + fFlags.description() + ';';
55 }
56
57private:
58 Layout fLayout;
59 ModifierFlags fFlags;
60
61 using INHERITED = ProgramElement;
62};
63
64} // namespace SkSL
65
66#endif
SkPoint pos
std::string description() const
static std::unique_ptr< ModifiersDeclaration > Make(const Context &context, const Modifiers &modifiers)
ModifierFlags modifierFlags() const
ModifiersDeclaration(Position pos, const Layout &layout, ModifierFlags flags)
static std::unique_ptr< ModifiersDeclaration > Convert(const Context &context, const Modifiers &modifiers)
std::string description() const override
ProgramElement(Position pos, Kind kind)
FlutterSemanticsFlag flags
ProgramElementKind
Definition: SkSLIRNode.h:19
std::string paddedDescription() const