Remove gradient onGetGLSLProcessorKey() overrides
None of the gradient processor subclassess contributes anything to the
base class key. Relocate the key logic to GrGradientEffect, and remove
unneeded builerplate.
Change-Id: I6b33ad359212579adedf95c0c3d481373c83d4c4
Reviewed-on: https://skia-review.googlesource.com/67721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 0ef8626..93c0709 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -274,6 +274,8 @@
GrGradientEffect(ClassID classID, const CreateArgs&, bool isOpaque);
explicit GrGradientEffect(const GrGradientEffect&); // facilitates clone() implementations
+ void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const final;
+
// Helper function used by derived class factories to handle color space transformation and
// modulation by input alpha.
static std::unique_ptr<GrFragmentProcessor> AdjustFP(
@@ -362,16 +364,10 @@
fCachedYCoord = SK_ScalarMax;
}
-protected:
- void onSetData(const GrGLSLProgramDataManager&, const GrFragmentProcessor&) override;
+ static uint32_t GenBaseGradientKey(const GrProcessor&);
protected:
- /**
- * Subclasses must call this. It will return a key for the part of the shader code controlled
- * by the base class. The subclasses must stick it in their key and then pass it to the below
- * emit* functions from their emitCode function.
- */
- static uint32_t GenBaseGradientKey(const GrProcessor&);
+ void onSetData(const GrGLSLProgramDataManager&, const GrFragmentProcessor&) override;
// Emits the uniform used as the y-coord to texture samples in derived classes. Subclasses
// should call this method from their emitCode().