aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ast
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-10-11 10:03:56 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-10-11 10:03:56 -0700
commit9df16b5e85ef37c44e02257e49eb996efca0e173 (patch)
tree8e1c6f575bd28fdc5277cf63c232a7bb89842c59 /src/sksl/ast
parenta5a31dd99467604f345850881dc8540c62aa506c (diff)
Revert of Turned on SkSL->GLSL compiler (patchset #49 id:1240001 of https://codereview.chromium.org/2288033003/ )
Reason for revert: Pre-emptive revert. Sorry, but we're getting back up on our roll and Chrome reverted our last one for apparently no reason. Original issue's description: > Turned on SkSL->GLSL compiler > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2288033003 > > Committed: https://skia.googlesource.com/skia/+/9b0fe3d125f237d9884732a48414fa85fc71b4e3 > Committed: https://skia.googlesource.com/skia/+/b12b3c6908c62c908b3680be01e3b5bfd30de310 > Committed: https://skia.googlesource.com/skia/+/f008b0a59f45c0d4bea3e66faf3b01805009ec89 > Committed: https://skia.googlesource.com/skia/+/08b2ccf398e2b81bc05d2c105837e5419899469b > Committed: https://skia.googlesource.com/skia/+/dcfe6dba4a335e50e86ff68e3252065d4197432c > Committed: https://skia.googlesource.com/skia/+/ccb1dd8f267f9d7fe7c9d0ce222ebc81b41853b3 TBR=benjaminwagner@google.com,bsalomon@google.com,egdaniel@google.com,ethannicholas@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2408193002
Diffstat (limited to 'src/sksl/ast')
-rw-r--r--src/sksl/ast/SkSLASTDeclaration.h4
-rw-r--r--src/sksl/ast/SkSLASTIndexSuffix.h16
-rw-r--r--src/sksl/ast/SkSLASTLayout.h17
-rw-r--r--src/sksl/ast/SkSLASTModifiersDeclaration.h37
-rw-r--r--src/sksl/ast/SkSLASTPrecision.h45
5 files changed, 6 insertions, 113 deletions
diff --git a/src/sksl/ast/SkSLASTDeclaration.h b/src/sksl/ast/SkSLASTDeclaration.h
index 70f0ebc72d..8b55ecf832 100644
--- a/src/sksl/ast/SkSLASTDeclaration.h
+++ b/src/sksl/ast/SkSLASTDeclaration.h
@@ -20,9 +20,7 @@ struct ASTDeclaration : public ASTPositionNode {
kVar_Kind,
kFunction_Kind,
kInterfaceBlock_Kind,
- kExtension_Kind,
- kPrecision_Kind,
- kModifiers_Kind
+ kExtension_Kind
};
ASTDeclaration(Position position, Kind kind)
diff --git a/src/sksl/ast/SkSLASTIndexSuffix.h b/src/sksl/ast/SkSLASTIndexSuffix.h
index 755029b0a2..44d91fa4c4 100644
--- a/src/sksl/ast/SkSLASTIndexSuffix.h
+++ b/src/sksl/ast/SkSLASTIndexSuffix.h
@@ -14,27 +14,17 @@
namespace SkSL {
/**
- * A bracketed expression, as in '[0]', indicating an array access. Empty brackets (as occur in
- * 'float[](5, 6)' are represented with a null fExpression.
+ * A bracketed expression, as in '[0]', indicating an array access.
*/
struct ASTIndexSuffix : public ASTSuffix {
- ASTIndexSuffix(Position position)
- : INHERITED(position, ASTSuffix::kIndex_Kind)
- , fExpression(nullptr) {}
-
ASTIndexSuffix(std::unique_ptr<ASTExpression> expression)
- : INHERITED(expression ? expression->fPosition : Position(), ASTSuffix::kIndex_Kind)
+ : INHERITED(expression->fPosition, ASTSuffix::kIndex_Kind)
, fExpression(std::move(expression)) {}
std::string description() const override {
- if (fExpression) {
- return "[" + fExpression->description() + "]";
- } else {
- return "[]";
- }
+ return "[" + fExpression->description() + "]";
}
- // may be null
std::unique_ptr<ASTExpression> fExpression;
typedef ASTSuffix INHERITED;
diff --git a/src/sksl/ast/SkSLASTLayout.h b/src/sksl/ast/SkSLASTLayout.h
index 515eb2bdbb..08d67531c3 100644
--- a/src/sksl/ast/SkSLASTLayout.h
+++ b/src/sksl/ast/SkSLASTLayout.h
@@ -20,16 +20,13 @@ namespace SkSL {
*/
struct ASTLayout : public ASTNode {
// For all parameters, a -1 means no value
- ASTLayout(int location, int binding, int index, int set, int builtin, bool originUpperLeft,
- bool overrideCoverage, bool blendSupportAllEquations)
+ ASTLayout(int location, int binding, int index, int set, int builtin, bool originUpperLeft)
: fLocation(location)
, fBinding(binding)
, fIndex(index)
, fSet(set)
, fBuiltin(builtin)
- , fOriginUpperLeft(originUpperLeft)
- , fOverrideCoverage(overrideCoverage)
- , fBlendSupportAllEquations(blendSupportAllEquations) {}
+ , fOriginUpperLeft(originUpperLeft) {}
std::string description() const {
std::string result;
@@ -58,14 +55,6 @@ struct ASTLayout : public ASTNode {
result += separator + "origin_upper_left";
separator = ", ";
}
- if (fOverrideCoverage) {
- result += separator + "override_coverage";
- separator = ", ";
- }
- if (fBlendSupportAllEquations) {
- result += separator + "blend_support_all_equations";
- separator = ", ";
- }
if (result.length() > 0) {
result = "layout (" + result + ")";
}
@@ -78,8 +67,6 @@ struct ASTLayout : public ASTNode {
const int fSet;
const int fBuiltin;
const bool fOriginUpperLeft;
- const bool fOverrideCoverage;
- const bool fBlendSupportAllEquations;
};
} // namespace
diff --git a/src/sksl/ast/SkSLASTModifiersDeclaration.h b/src/sksl/ast/SkSLASTModifiersDeclaration.h
deleted file mode 100644
index f5cc620899..0000000000
--- a/src/sksl/ast/SkSLASTModifiersDeclaration.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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_ASTMODIFIERDECLARATION
-#define SKSL_ASTMODIFIERDECLARATION
-
-#include "SkSLASTDeclaration.h"
-#include "SkSLASTModifiers.h"
-
-namespace SkSL {
-
-/**
- * A declaration that consists only of modifiers, e.g.:
- *
- * layout(blend_support_all_equations) out;
- */
-struct ASTModifiersDeclaration : public ASTDeclaration {
- ASTModifiersDeclaration(ASTModifiers modifiers)
- : INHERITED(Position(), kModifiers_Kind)
- , fModifiers(modifiers) {}
-
- std::string description() const {
- return fModifiers.description() + ";";
- }
-
- ASTModifiers fModifiers;
-
- typedef ASTDeclaration INHERITED;
-};
-
-} // namespace
-
-#endif
diff --git a/src/sksl/ast/SkSLASTPrecision.h b/src/sksl/ast/SkSLASTPrecision.h
deleted file mode 100644
index a7df57948e..0000000000
--- a/src/sksl/ast/SkSLASTPrecision.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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_ASTPRECISION
-#define SKSL_ASTPRECISION
-
-#include "SkSLASTDeclaration.h"
-#include "../ir/SkSLModifiers.h"
-
-namespace SkSL {
-
-/**
- * Represents a precision declaration (e.g. 'precision mediump float;').
- */
-struct ASTPrecision : public ASTDeclaration {
- // FIXME handle the type
- ASTPrecision(Position position, Modifiers::Flag precision)
- : INHERITED(position, kPrecision_Kind)
- , fPrecision(precision) {}
-
- std::string description() const {
- switch (fPrecision) {
- case Modifiers::kLowp_Flag: return "precision lowp float;";
- case Modifiers::kMediump_Flag: return "precision mediump float;";
- case Modifiers::kHighp_Flag: return "precision highp float;";
- default:
- ASSERT(false);
- return "<error>";
- }
- ASSERT(false);
- return "<error>";
- }
-
- const Modifiers::Flag fPrecision;
-
- typedef ASTDeclaration INHERITED;
-};
-
-} // namespace
-
-#endif