From abff956455637b12eab374fd44b99e1338799113 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Mon, 9 Oct 2017 10:54:08 -0400 Subject: initClassID no longer auto-allocates ids Auto-allocated IDs mean that the IDs depend upon the order in which classes happen to get initialized and are therefore not consistent from run to run. This change paves the way for a persistent shader cache by fixing the IDs in an enum. Bug: skia: Change-Id: I3e923c6c54f41b3b3eb616458abee83e0909c09f Reviewed-on: https://skia-review.googlesource.com/56401 Commit-Queue: Ethan Nicholas Reviewed-by: Brian Salomon --- tests/SkSLFPTest.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tests/SkSLFPTest.cpp') diff --git a/tests/SkSLFPTest.cpp b/tests/SkSLFPTest.cpp index dc9279573d..3e95d9975f 100644 --- a/tests/SkSLFPTest.cpp +++ b/tests/SkSLFPTest.cpp @@ -93,8 +93,7 @@ DEF_TEST(SkSLFPHelloWorld, r) { " const char* name() const override { return \"Test\"; }\n" "private:\n" " GrTest()\n" - " : INHERITED(kNone_OptimizationFlags) {\n" - " this->initClassID();\n" + " : INHERITED(kGrTest_ClassID, kNone_OptimizationFlags) {\n" " }\n" " GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;\n" " void onGetGLSLProcessorKey(const GrShaderCaps&,GrProcessorKeyBuilder*) " @@ -151,8 +150,7 @@ DEF_TEST(SkSLFPHelloWorld, r) { " return true;\n" "}\n" "GrTest::GrTest(const GrTest& src)\n" - ": INHERITED(src.optimizationFlags()) {\n" - " this->initClassID();\n" + ": INHERITED(kGrTest_ClassID, src.optimizationFlags()) {\n" "}\n" "std::unique_ptr GrTest::clone() const {\n" " return std::unique_ptr(new GrTest(*this));\n" @@ -279,7 +277,7 @@ DEF_TEST(SkSLFPSections, r) { "}", *SkSL::ShaderCapsFactory::Default(), { - ": INHERITED(kNone_OptimizationFlags)\n , initializers section" + ": INHERITED(kGrTest_ClassID, kNone_OptimizationFlags)\n , initializers section" }, {}); test(r, -- cgit v1.2.3