aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrFragmentProcessor.h
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-07-25 09:43:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-25 14:00:53 +0000
commit0e05a823f6ff6e9d799172f002e77ab9f2015f0f (patch)
tree4fac7a1b648be3b11aaf3a65122d26bce1df03c4 /src/gpu/GrFragmentProcessor.h
parent22115b4fc6ab169d45a1cfb65dae2dc7e544c80a (diff)
Add GrFragmentProcessor::clone(), implementation for ColorTableEffect, and unit test.
We occasionally make copies of GrPaints. clone() fill facilitate this case when GrFragmentProcessors are non-shareable.. Change-Id: I004e34f6ce8c293f9e0664d26532e44bd6b9fdff Reviewed-on: https://skia-review.googlesource.com/26360 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrFragmentProcessor.h')
-rw-r--r--src/gpu/GrFragmentProcessor.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h
index a4b28c21c0..e86d798b00 100644
--- a/src/gpu/GrFragmentProcessor.h
+++ b/src/gpu/GrFragmentProcessor.h
@@ -86,6 +86,14 @@ public:
~GrFragmentProcessor() override;
+ /**
+ * Makes a copy of this fragment processor that draws equivalently to the original.
+ * If the processor has child processors they are cloned as well. Currently this
+ * has a default implementation that fails. This is temporary until it can be implemented
+ * for all fragemnt processor leaf classes.
+ */
+ virtual sk_sp<GrFragmentProcessor> clone() { return nullptr; }
+
GrGLSLFragmentProcessor* createGLSLInstance() const;
void getGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const {