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

Side by Side Diff: src/sksl/ir/SkSLField.h

Issue 1984363002: initial checkin of SkSL compiler (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fixed CMake build Created 4 years, 5 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/ir/SkSLExtension.h ('k') | src/sksl/ir/SkSLFieldAccess.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_FIELD
9 #define SKSL_FIELD
10
11 #include "SkSLModifiers.h"
12 #include "SkSLPosition.h"
13 #include "SkSLSymbol.h"
14 #include "SkSLType.h"
15
16 namespace SkSL {
17
18 /**
19 * A symbol which should be interpreted as a field access. Fields are added to t he symboltable
20 * whenever a bare reference to an identifier should refer to a struct field; in GLSL, this is the
21 * result of declaring anonymous interface blocks.
22 */
23 struct Field : public Symbol {
24 Field(Position position, std::shared_ptr<Variable> owner, int fieldIndex)
25 : INHERITED(position, kField_Kind, owner->fType->fields()[fieldIndex].fName)
26 , fOwner(owner)
27 , fFieldIndex(fieldIndex) {}
28
29 virtual std::string description() const override {
30 return fOwner->description() + "." + fOwner->fType->fields()[fFieldIndex ].fName;
31 }
32
33 const std::shared_ptr<Variable> fOwner;
34 const int fFieldIndex;
35
36 typedef Symbol INHERITED;
37 };
38
39 } // namespace SkSL
40
41 #endif
OLDNEW
« no previous file with comments | « src/sksl/ir/SkSLExtension.h ('k') | src/sksl/ir/SkSLFieldAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698