SkSLProgramElement.h 822 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_PROGRAMELEMENT
  8. #define SKSL_PROGRAMELEMENT
  9. #include "src/sksl/ir/SkSLIRNode.h"
  10. #include <memory>
  11. namespace SkSL {
  12. /**
  13. * Represents a top-level element (e.g. function or global variable) in a program.
  14. */
  15. struct ProgramElement : public IRNode {
  16. enum Kind {
  17. kEnum_Kind,
  18. kExtension_Kind,
  19. kFunction_Kind,
  20. kInterfaceBlock_Kind,
  21. kModifiers_Kind,
  22. kSection_Kind,
  23. kVar_Kind
  24. };
  25. ProgramElement(int offset, Kind kind)
  26. : INHERITED(offset)
  27. , fKind(kind) {}
  28. Kind fKind;
  29. virtual std::unique_ptr<ProgramElement> clone() const = 0;
  30. typedef IRNode INHERITED;
  31. };
  32. } // namespace
  33. #endif