aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-04-07 16:55:09 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-04-17 14:06:33 +0000
commit7fee90cb5eda2345bb8ec9be706aea1a09866005 (patch)
tree90b83b6ddee7df58914a4fa001300b59b3aae576 /src/opts
parentc589b0b5c0235c3adedc574c8846fb62414ed93c (diff)
add a callback stage to SkRasterPipeline
This lets us temporarily escape to piece of code outside SkRasterPipeline. We should be able to use this to replace - parametric_{r,g,b,a} - table_{r,g,b,a} - color_lookup_table - shader_adapter* * We want to obsolete shader_adapter for other reasons anyway, but we _could_ replace it with this if we want to. Change-Id: I42b657b3c19c679796ed1876856cae0c8471307e Reviewed-on: https://skia-review.googlesource.com/12102 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkRasterPipeline_opts.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index 1146b3d7fb..b15ebf36d8 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -1098,6 +1098,11 @@ STAGE_CTX(shader_adapter, SkShader::Context*) {
SkNf::Load4(buf, &r, &g, &b, &a);
}
+STAGE_CTX(callback, const void*) {
+ auto c = (const SkJumper_CallbackCtx*)ctx;
+ c->fn(c->arg, tail ? tail : N);
+}
+
SI Fn enum_to_Fn(SkRasterPipeline::StockStage st) {
switch (st) {
#define M(stage) case SkRasterPipeline::stage: return stage;