diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2018-03-27 14:10:52 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-27 18:39:13 +0000 |
commit | 26a9aad63b60c9cbbdfa87c212a4e76ce55e7373 (patch) | |
tree | d4a42afd75bdff6c7815be7bf78b42cab742df19 /src/sksl/ir/SkSLAppendStage.h | |
parent | 3560b58de36988e1fba54d9ac341735ab849e913 (diff) |
initial SkSLJIT checkin
Docs-Preview: https://skia.org/?cl=112204
Bug: skia:
Change-Id: I10042a0200db00bd8ff8078467c409b1cf191f50
Reviewed-on: https://skia-review.googlesource.com/112204
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/sksl/ir/SkSLAppendStage.h')
-rw-r--r-- | src/sksl/ir/SkSLAppendStage.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/sksl/ir/SkSLAppendStage.h b/src/sksl/ir/SkSLAppendStage.h new file mode 100644 index 0000000000..87a8210a83 --- /dev/null +++ b/src/sksl/ir/SkSLAppendStage.h @@ -0,0 +1,53 @@ +/* + * Copyright 2018 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SKSL_APPENDSTAGE +#define SKSL_APPENDSTAGE + +#ifndef SKSL_STANDALONE + +#include "SkRasterPipeline.h" +#include "SkSLContext.h" +#include "SkSLExpression.h" + +namespace SkSL { + +struct AppendStage : public Expression { + AppendStage(const Context& context, int offset, SkRasterPipeline::StockStage stage, + std::vector<std::unique_ptr<Expression>> arguments) + : INHERITED(offset, kAppendStage_Kind, *context.fVoid_Type) + , fStage(stage) + , fArguments(std::move(arguments)) {} + + String description() const { + String result = "append("; + const char* separator = ""; + for (const auto& a : fArguments) { + result += separator; + result += a->description(); + separator = ", "; + } + result += ")"; + return result; + } + + bool hasSideEffects() const { + return true; + } + + SkRasterPipeline::StockStage fStage; + + std::vector<std::unique_ptr<Expression>> fArguments; + + typedef Expression INHERITED; +}; + +} // namespace + +#endif // SKSL_STANDALONE + +#endif // SKSL_APPENDSTAGE |