aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/SkShaderBase.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-06-06 12:26:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-06 18:51:59 +0000
commit47e55a5115bd1d47bdb097d37b6b9e0ecdd4fa86 (patch)
treec5cf66fbebd5974028bf16675a0e20c02c5940f0 /src/shaders/SkShaderBase.h
parent15f4d02738895663daa484e4c8677cbad41bcab5 (diff)
Opt-in burst mechanism for pipeline shaders
Add a dedicated virtual for shaders to select burst mode. Enabled for linear gradients with more than 8 stops, as a start. BUG=skia:6710 Change-Id: I1b19124f42d1d805de27a5db6a26601c386bb9ff Reviewed-on: https://skia-review.googlesource.com/18628 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/shaders/SkShaderBase.h')
-rw-r--r--src/shaders/SkShaderBase.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shaders/SkShaderBase.h b/src/shaders/SkShaderBase.h
index ee8d5c02dc..8dc9354e53 100644
--- a/src/shaders/SkShaderBase.h
+++ b/src/shaders/SkShaderBase.h
@@ -148,6 +148,15 @@ public:
*/
Context* makeContext(const ContextRec&, SkArenaAlloc*) const;
+ /**
+ * Shaders may opt-in for burst mode, if they can operate
+ * significantly more efficiently in that mode.
+ *
+ * Burst mode is prioritized in SkRasterPipelineBlitter over
+ * regular (appendStages) pipeline operation.
+ */
+ Context* makeBurstPipelineContext(const ContextRec&, SkArenaAlloc*) const;
+
#if SK_SUPPORT_GPU
struct AsFPArgs {
AsFPArgs() {}
@@ -240,6 +249,13 @@ protected:
return nullptr;
}
+ /**
+ * Overriden by shaders which prefer burst mode.
+ */
+ virtual Context* onMakeBurstPipelineContext(const ContextRec&, SkArenaAlloc*) const {
+ return nullptr;
+ }
+
virtual bool onAsLuminanceColor(SkColor*) const {
return false;
}