diff options
Diffstat (limited to 'gfx/skia/skia/src/sksl/ir/SkSLDiscardStatement.h')
-rw-r--r-- | gfx/skia/skia/src/sksl/ir/SkSLDiscardStatement.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/sksl/ir/SkSLDiscardStatement.h b/gfx/skia/skia/src/sksl/ir/SkSLDiscardStatement.h new file mode 100644 index 0000000000..1e947d7d0f --- /dev/null +++ b/gfx/skia/skia/src/sksl/ir/SkSLDiscardStatement.h @@ -0,0 +1,49 @@ +/* + * 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_DISCARDSTATEMENT +#define SKSL_DISCARDSTATEMENT + +#include "include/private/SkSLIRNode.h" +#include "include/private/SkSLStatement.h" +#include "include/sksl/SkSLPosition.h" + +#include <memory> +#include <string> + +namespace SkSL { + +class Context; + +/** + * A 'discard' statement. + */ +class DiscardStatement final : public Statement { +public: + inline static constexpr Kind kIRNodeKind = Kind::kDiscard; + + DiscardStatement(Position pos) : INHERITED(pos, kIRNodeKind) {} + + // Creates a discard-statement; reports errors via ErrorReporter. + static std::unique_ptr<Statement> Convert(const Context& context, Position pos); + + // Creates a discard-statement; reports errors via SkASSERT. + static std::unique_ptr<Statement> Make(const Context& context, Position pos); + + std::unique_ptr<Statement> clone() const override; + + std::string description() const override { + return "discard;"; + } + +private: + using INHERITED = Statement; +}; + +} // namespace SkSL + +#endif |