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/PrimitiveProcessorTest.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/PrimitiveProcessorTest.cpp') diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 8898e35266..004ec88cc2 100644 --- a/tests/PrimitiveProcessorTest.cpp +++ b/tests/PrimitiveProcessorTest.cpp @@ -53,8 +53,8 @@ private: void onPrepareDraws(Target* target) override { class GP : public GrGeometryProcessor { public: - GP(int numAttribs) { - this->initClassID(); + GP(int numAttribs) + : INHERITED(kGP_ClassID) { SkASSERT(numAttribs > 1); for (auto i = 0; i < numAttribs; ++i) { fAttribNames.push_back().printf("attr%d", i); @@ -89,6 +89,8 @@ private: private: SkTArray fAttribNames; + + typedef GrGeometryProcessor INHERITED; }; sk_sp gp(new GP(fNumAttribs)); QuadHelper helper; -- cgit v1.2.3