aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/gradients/SkGradientShaderPriv.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-11-03 08:46:18 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-03 13:43:50 +0000
commite657dc8ce6cb17136dfd21be905b97a3957e957e (patch)
tree1c9e6cb0a1212917edb0e1ba32dcddf73b415c0c /src/shaders/gradients/SkGradientShaderPriv.h
parent9539a8c5e66f36cda9d7aa2a9d3eef2dfb595c91 (diff)
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>
Diffstat (limited to 'src/shaders/gradients/SkGradientShaderPriv.h')
-rw-r--r--src/shaders/gradients/SkGradientShaderPriv.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 0ef86265a4..93c07094dc 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -274,6 +274,8 @@ protected:
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 @@ public:
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().