summaryrefslogtreecommitdiffstats
path: root/gfx/skia/skia/include/private/SkSLProgramElement.h
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/skia/skia/include/private/SkSLProgramElement.h')
-rw-r--r--gfx/skia/skia/include/private/SkSLProgramElement.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/gfx/skia/skia/include/private/SkSLProgramElement.h b/gfx/skia/skia/include/private/SkSLProgramElement.h
new file mode 100644
index 0000000000..34d57bcdf8
--- /dev/null
+++ b/gfx/skia/skia/include/private/SkSLProgramElement.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SKSL_PROGRAMELEMENT
+#define SKSL_PROGRAMELEMENT
+
+#include "include/private/SkSLIRNode.h"
+
+#include <memory>
+
+namespace SkSL {
+
+/**
+ * Represents a top-level element (e.g. function or global variable) in a program.
+ */
+class ProgramElement : public IRNode {
+public:
+ using Kind = ProgramElementKind;
+
+ ProgramElement(Position pos, Kind kind)
+ : INHERITED(pos, (int) kind) {
+ SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast);
+ }
+
+ Kind kind() const {
+ return (Kind) fKind;
+ }
+
+ virtual std::unique_ptr<ProgramElement> clone() const = 0;
+
+private:
+ using INHERITED = IRNode;
+};
+
+} // namespace SkSL
+
+#endif