aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrSimpleTextureEffect.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-10-09 10:54:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-09 15:20:33 +0000
commitabff956455637b12eab374fd44b99e1338799113 (patch)
tree77f932f38b3f00f904faeae1c847f1218f61d0c4 /src/gpu/effects/GrSimpleTextureEffect.h
parent4e7cdd5a0052aa76bed6f80ec325be19e09e6ab1 (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/GrSimpleTextureEffect.h')
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index 6e8fa28efc..7f98b13fd2 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -56,17 +56,17 @@ public:
private:
GrSimpleTextureEffect(sk_sp<GrTextureProxy> image, sk_sp<GrColorSpaceXform> colorXform,
SkMatrix44 matrix, GrSamplerState samplerParams)
- : INHERITED((OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag |
- (GrPixelConfigIsOpaque(image->config())
- ? kPreservesOpaqueInput_OptimizationFlag
- : kNone_OptimizationFlags))
+ : INHERITED(kGrSimpleTextureEffect_ClassID,
+ (OptimizationFlags)kCompatibleWithCoverageAsAlpha_OptimizationFlag |
+ (GrPixelConfigIsOpaque(image->config())
+ ? kPreservesOpaqueInput_OptimizationFlag
+ : kNone_OptimizationFlags))
, fImage(std::move(image), samplerParams)
, fColorXform(colorXform)
, fMatrix(matrix)
, fImageCoordTransform(matrix, fImage.proxy()) {
this->addTextureSampler(&fImage);
this->addCoordTransform(&fImageCoordTransform);
- this->initClassID<GrSimpleTextureEffect>();
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;