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/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h
index 0c3efd1..4ec9262 100644
--- a/src/gpu/GrFragmentProcessor.h
+++ b/src/gpu/GrFragmentProcessor.h
@@ -275,7 +275,9 @@
}
}
- GrFragmentProcessor(OptimizationFlags optimizationFlags) : fFlags(optimizationFlags) {
+ GrFragmentProcessor(ClassID classID, OptimizationFlags optimizationFlags)
+ : INHERITED(classID)
+ , fFlags(optimizationFlags) {
SkASSERT((fFlags & ~kAll_OptimizationFlags) == 0);
}