aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-03 12:22:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-03 17:15:15 +0000
commit668661700127e8e340c1d731d2b9fc5ea443163f (patch)
treee4236242117029f5c78e5b8e24c2ef23cc319524 /src/opts
parent37d1b49ae85a6f0299b36104c666defbc513dbb9 (diff)
Basic pipeline blend mode strength reductions:
- when the shader is opaque, srcover becomes src - don't load dst when blitting in src mode with full coverage - fold coverage into src alpha when in srcover mode It's not obvious that we can fold coverage into src alpha when using a 565 mask, so I've not attempted that. What would we do about alpha? Over all GMs this causes a single 1-bit difference in sRGB mode. No 565 or f16 diffs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4349 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: Ib9161f498c4efa6b348ca74522166da64d09a7da Reviewed-on: https://skia-review.googlesource.com/4349 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkRasterPipeline_opts.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index 9f15391918..950264efb1 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -235,6 +235,16 @@ STAGE(constant_color, true) {
a = color->a();
}
+// s' = sc for a constant c.
+STAGE(scale_constant_float, true) {
+ SkNf c = *(const float*)ctx;
+
+ r *= c;
+ g *= c;
+ b *= c;
+ a *= c;
+}
+
// s' = d(1-c) + sc, for a constant c.
STAGE(lerp_constant_float, true) {
SkNf c = *(const float*)ctx;