diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-10-09 10:54:08 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-09 15:20:33 +0000 |
commit | abff956455637b12eab374fd44b99e1338799113 (patch) | |
tree | 77f932f38b3f00f904faeae1c847f1218f61d0c4 /tests/SkSLFPTest.cpp | |
parent | 4e7cdd5a0052aa76bed6f80ec325be19e09e6ab1 (diff) |
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 <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/SkSLFPTest.cpp')
-rw-r--r-- | tests/SkSLFPTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
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<GrTest>();\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<GrTest>();\n" + ": INHERITED(kGrTest_ClassID, src.optimizationFlags()) {\n" "}\n" "std::unique_ptr<GrFragmentProcessor> GrTest::clone() const {\n" " return std::unique_ptr<GrFragmentProcessor>(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, |