diff --git a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h index 122f567189..5addbf9214 100644 --- a/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h +++ b/src/gpu/gradients/generated/GrTwoPointConicalGradientLayout.h @@ -22,7 +22,7 @@ class GrTwoPointConicalGradientLayout : public GrFragmentProcessor { public: - enum class Type { kFocal = 2, kRadial = 0, kStrip = 1 }; + enum class Type { kRadial = 0, kStrip = 1, kFocal = 2 }; static std::unique_ptr Make(const SkTwoPointConicalGradient& gradient, const GrFPArgs& args); diff --git a/src/sksl/ir/SkSLEnum.h b/src/sksl/ir/SkSLEnum.h index 4801e4b423..b18e9ea4ee 100644 --- a/src/sksl/ir/SkSLEnum.h +++ b/src/sksl/ir/SkSLEnum.h @@ -54,11 +54,9 @@ public: sortedSymbols.push_back(symbol); }); std::sort(sortedSymbols.begin(), sortedSymbols.end(), - [](const Symbol* a, const Symbol* b) { return a->name() < b->name(); }); - for (const auto& s : sortedSymbols) { - const Expression& initialValue = *s->as().initialValue(); - result += separator + " " + s->name() + " = " + - to_string(initialValue.as().value()); + [](const Symbol* a, const Symbol* b) { return EnumValue(a) < EnumValue(b); }); + for (const Symbol* s : sortedSymbols) { + result += separator + " " + s->name() + " = " + to_string(EnumValue(s)); separator = ",\n"; } result += "\n};"; @@ -70,6 +68,10 @@ public: } private: + static int EnumValue(const Symbol* symbol) { + return symbol->as().initialValue()->as().value(); + } + using INHERITED = ProgramElement; };