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 /src/gpu/effects/GrMatrixConvolutionEffect.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 'src/gpu/effects/GrMatrixConvolutionEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrMatrixConvolutionEffect.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 73fce4d630..ffbcf500ab 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -155,7 +155,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(sk_sp<GrTextureProxy> proxy bool convolveAlpha) // To advertise either the modulation or opaqueness optimizations we'd have to examine the // parameters. - : INHERITED(kNone_OptimizationFlags) + : INHERITED(kGrMatrixConvolutionEffect_ClassID, kNone_OptimizationFlags) , fCoordTransform(proxy.get()) , fDomain(proxy.get(), GrTextureDomain::MakeTexelDomainForMode(bounds, tileMode), tileMode) , fTextureSampler(std::move(proxy)) @@ -163,7 +163,6 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(sk_sp<GrTextureProxy> proxy , fGain(SkScalarToFloat(gain)) , fBias(SkScalarToFloat(bias) / 255.0f) , fConvolveAlpha(convolveAlpha) { - this->initClassID<GrMatrixConvolutionEffect>(); this->addCoordTransform(&fCoordTransform); this->addTextureSampler(&fTextureSampler); for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { @@ -174,7 +173,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(sk_sp<GrTextureProxy> proxy } GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(const GrMatrixConvolutionEffect& that) - : INHERITED(kNone_OptimizationFlags) + : INHERITED(kGrMatrixConvolutionEffect_ClassID, kNone_OptimizationFlags) , fCoordTransform(that.fCoordTransform) , fDomain(that.fDomain) , fTextureSampler(that.fTextureSampler) @@ -182,7 +181,6 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(const GrMatrixConvolutionEf , fGain(that.fGain) , fBias(that.fBias) , fConvolveAlpha(that.fConvolveAlpha) { - this->initClassID<GrMatrixConvolutionEffect>(); this->addCoordTransform(&fCoordTransform); this->addTextureSampler(&fTextureSampler); memcpy(fKernel, that.fKernel, sizeof(float) * fKernelSize.width() * fKernelSize.height()); |