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

Unified Diff: src/sksl/ir/SkSLVariable.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/ir/SkSLVarDeclaration.h ('k') | src/sksl/ir/SkSLVariableReference.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sksl/ir/SkSLVariable.h
diff --git a/src/sksl/ir/SkSLVariable.h b/src/sksl/ir/SkSLVariable.h
index d4ea2c4a43e78ce8c2ba829dace13b8accd3f1c4..39af3093b6ab20ce53e35501b00906c88075344e 100644
--- a/src/sksl/ir/SkSLVariable.h
+++ b/src/sksl/ir/SkSLVariable.h
@@ -27,7 +27,7 @@ struct Variable : public Symbol {
kParameter_Storage
};
- Variable(Position position, Modifiers modifiers, std::string name, std::shared_ptr<Type> type,
+ Variable(Position position, Modifiers modifiers, std::string name, const Type& type,
Storage storage)
: INHERITED(position, kVariable_Kind, std::move(name))
, fModifiers(modifiers)
@@ -37,12 +37,11 @@ struct Variable : public Symbol {
, fIsWrittenTo(false) {}
virtual std::string description() const override {
- return fModifiers.description() + fType->fName + " " + fName;
+ return fModifiers.description() + fType.fName + " " + fName;
}
const Modifiers fModifiers;
- const std::string fValue;
- const std::shared_ptr<Type> fType;
+ const Type& fType;
const Storage fStorage;
mutable bool fIsReadFrom;
@@ -53,14 +52,4 @@ struct Variable : public Symbol {
} // namespace SkSL
-namespace std {
- template <>
- struct hash<SkSL::Variable> {
- public :
- size_t operator()(const SkSL::Variable &var) const{
- return hash<std::string>()(var.fName) ^ hash<std::string>()(var.fType->description());
- }
- };
-} // namespace std
-
#endif
« no previous file with comments | « src/sksl/ir/SkSLVarDeclaration.h ('k') | src/sksl/ir/SkSLVariableReference.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698