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>
diff --git a/src/shaders/gradients/SkRadialGradient.cpp b/src/shaders/gradients/SkRadialGradient.cpp
index 94d823c..5c31688 100644
--- a/src/shaders/gradients/SkRadialGradient.cpp
+++ b/src/shaders/gradients/SkRadialGradient.cpp
@@ -81,13 +81,9 @@
private:
explicit GrRadialGradient(const CreateArgs& args)
- : INHERITED(args, args.fShader->colorsAreOpaque()) {
- this->initClassID<GrRadialGradient>();
- }
+ : INHERITED(kGrRadialGradient_ClassID, args, args.fShader->colorsAreOpaque()) {}
- explicit GrRadialGradient(const GrRadialGradient& that) : INHERITED(that) {
- this->initClassID<GrRadialGradient>();
- }
+ explicit GrRadialGradient(const GrRadialGradient& that) : INHERITED(that) {}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;