SkSLModifiersDeclaration.h 936 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #ifndef SKSL_MODIFIERDECLARATION
  8. #define SKSL_MODIFIERDECLARATION
  9. #include "src/sksl/ir/SkSLModifiers.h"
  10. #include "src/sksl/ir/SkSLProgramElement.h"
  11. namespace SkSL {
  12. /**
  13. * A declaration that consists only of modifiers, e.g.:
  14. *
  15. * layout(blend_support_all_equations) out;
  16. */
  17. struct ModifiersDeclaration : public ProgramElement {
  18. ModifiersDeclaration(Modifiers modifiers)
  19. : INHERITED(-1, kModifiers_Kind)
  20. , fModifiers(modifiers) {}
  21. std::unique_ptr<ProgramElement> clone() const override {
  22. return std::unique_ptr<ProgramElement>(new ModifiersDeclaration(fModifiers));
  23. }
  24. String description() const override {
  25. return fModifiers.description() + ";";
  26. }
  27. Modifiers fModifiers;
  28. typedef ProgramElement INHERITED;
  29. };
  30. } // namespace
  31. #endif