diff options
author | 2016-07-25 10:08:54 -0700 | |
---|---|---|
committer | 2016-07-25 10:08:54 -0700 | |
commit | d598f7981f34811e6f2a949207dc13638852f3f7 (patch) | |
tree | 83dd4cf4983f90125651a0ab380f4f71cb3e27f2 /src/sksl/ir/SkSLVariable.h | |
parent | d9ddad2952cdfd0809249abbd94a285abdb6b1d0 (diff) |
SkSL performance improvements (plus a couple of minor warning fixes)
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131223002
Committed: https://skia.googlesource.com/skia/+/9fd67a1f53809f5eff1210dd107241b450c48acc
Review-Url: https://codereview.chromium.org/2131223002
Diffstat (limited to 'src/sksl/ir/SkSLVariable.h')
-rw-r--r-- | src/sksl/ir/SkSLVariable.h | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/sksl/ir/SkSLVariable.h b/src/sksl/ir/SkSLVariable.h index d4ea2c4a43..39af3093b6 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 |