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

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

Issue 2131223002: SkSL performance improvements (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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/SkSLExpression.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
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SKSL_FIELD 8 #ifndef SKSL_FIELD
9 #define SKSL_FIELD 9 #define SKSL_FIELD
10 10
11 #include "SkSLModifiers.h" 11 #include "SkSLModifiers.h"
12 #include "SkSLPosition.h" 12 #include "SkSLPosition.h"
13 #include "SkSLSymbol.h" 13 #include "SkSLSymbol.h"
14 #include "SkSLType.h" 14 #include "SkSLType.h"
15 15
16 namespace SkSL { 16 namespace SkSL {
17 17
18 /** 18 /**
19 * A symbol which should be interpreted as a field access. Fields are added to t he symboltable 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 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. 21 * result of declaring anonymous interface blocks.
22 */ 22 */
23 struct Field : public Symbol { 23 struct Field : public Symbol {
24 Field(Position position, std::shared_ptr<Variable> owner, int fieldIndex) 24 Field(Position position, const Variable& owner, int fieldIndex)
25 : INHERITED(position, kField_Kind, owner->fType->fields()[fieldIndex].fName) 25 : INHERITED(position, kField_Kind, owner.fType.fields()[fieldIndex].fName)
26 , fOwner(owner) 26 , fOwner(owner)
27 , fFieldIndex(fieldIndex) {} 27 , fFieldIndex(fieldIndex) {}
28 28
29 virtual std::string description() const override { 29 virtual std::string description() const override {
30 return fOwner->description() + "." + fOwner->fType->fields()[fFieldIndex ].fName; 30 return fOwner.description() + "." + fOwner.fType.fields()[fFieldIndex].f Name;
31 } 31 }
32 32
33 const std::shared_ptr<Variable> fOwner; 33 const Variable& fOwner;
34 const int fFieldIndex; 34 const int fFieldIndex;
35 35
36 typedef Symbol INHERITED; 36 typedef Symbol INHERITED;
37 }; 37 };
38 38
39 } // namespace SkSL 39 } // namespace SkSL
40 40
41 #endif 41 #endif
OLDNEW
« no previous file with comments | « src/sksl/ir/SkSLExpression.h ('k') | src/sksl/ir/SkSLFieldAccess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698