Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Side by Side Diff: src/sksl/ast/SkSLASTPrecision.h

Issue 2288033003: Turned on SkSL->GLSL compiler (Closed)
Patch Set: changed <iostream> to <ostream> Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/sksl/ast/SkSLASTModifiersDeclaration.h ('k') | src/sksl/ir/SkSLIndexExpression.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
8 #ifndef SKSL_ASTPRECISION
9 #define SKSL_ASTPRECISION
10
11 #include "SkSLASTDeclaration.h"
12 #include "../ir/SkSLModifiers.h"
13
14 namespace SkSL {
15
16 /**
17 * Represents a precision declaration (e.g. 'precision mediump float;').
18 */
19 struct ASTPrecision : public ASTDeclaration {
20 // FIXME handle the type
21 ASTPrecision(Position position, Modifiers::Flag precision)
22 : INHERITED(position, kPrecision_Kind)
23 , fPrecision(precision) {}
24
25 std::string description() const {
26 switch (fPrecision) {
27 case Modifiers::kLowp_Flag: return "precision lowp float;";
28 case Modifiers::kMediump_Flag: return "precision mediump float;";
29 case Modifiers::kHighp_Flag: return "precision highp float;";
30 default:
31 ASSERT(false);
32 return "<error>";
33 }
34 ASSERT(false);
35 return "<error>";
36 }
37
38 const Modifiers::Flag fPrecision;
39
40 typedef ASTDeclaration INHERITED;
41 };
42
43 } // namespace
44
45 #endif
OLDNEW
« no previous file with comments | « src/sksl/ast/SkSLASTModifiersDeclaration.h ('k') | src/sksl/ir/SkSLIndexExpression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698