SkSLNop.h 730 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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_NOP
  8. #define SKSL_NOP
  9. #include "src/sksl/ir/SkSLStatement.h"
  10. #include "src/sksl/ir/SkSLSymbolTable.h"
  11. namespace SkSL {
  12. /**
  13. * A no-op statement that does nothing.
  14. */
  15. struct Nop : public Statement {
  16. Nop()
  17. : INHERITED(-1, kNop_Kind) {}
  18. virtual bool isEmpty() const override {
  19. return true;
  20. }
  21. String description() const override {
  22. return String(";");
  23. }
  24. std::unique_ptr<Statement> clone() const override {
  25. return std::unique_ptr<Statement>(new Nop());
  26. }
  27. typedef Statement INHERITED;
  28. };
  29. } // namespace
  30. #endif