aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/Sk4px.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-06-24 15:18:39 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-06-24 15:18:39 -0700
commitb5e861185a69b3e47d1c1bf622fd3f83e5f13898 (patch)
treeaee36efe12d85024fa3d04d2f6269c92ef189276 /src/core/Sk4px.h
parentc0bdecb920a957665f66adefd3f3fb865e32e5d0 (diff)
Implement four more xfermodes with Sk4px.
HardLight, Overlay, Darken, and Lighten are all ~2x faster with SSE, ~25% faster with NEON. This covers all previously-implemented NEON xfermodes. 3 previous SSE xfermodes remain. Those need division and sqrt, so I'm planning on using SkPMFloat for them. It'll help the readability and NEON speed if I move that into [0,1] space first. The main new concept here is c.thenElse(t,e), which behaves like (c ? t : e) except, of course, both t and e are evaluated. This allows us to emulate conditionals with vectors. This also removes the concept of SkNb. Instead of a standalone bool vector, each SkNi or SkNf will just return their own types for comparisons. Turns out to be a lot more manageable this way. BUG=skia: Committed: https://skia.googlesource.com/skia/+/b9d4163bebab0f5639f9c5928bb5fc15f472dddc CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot Review URL: https://codereview.chromium.org/1196713004
Diffstat (limited to 'src/core/Sk4px.h')
-rw-r--r--src/core/Sk4px.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/Sk4px.h b/src/core/Sk4px.h
index 26d4d0f865..e046e265fe 100644
--- a/src/core/Sk4px.h
+++ b/src/core/Sk4px.h
@@ -85,6 +85,8 @@ public:
// These just keep the types as Sk4px so the user doesn't have to keep casting.
Sk4px operator + (const Sk4px& o) const { return INHERITED::operator+(o); }
Sk4px operator - (const Sk4px& o) const { return INHERITED::operator-(o); }
+ Sk4px operator < (const Sk4px& o) const { return INHERITED::operator<(o); }
+ Sk4px thenElse(const Sk4px& t, const Sk4px& e) const { return INHERITED::thenElse(t,e); }
// Generally faster than (*this * o).div255().
// May be incorrect by +-1, but is always exactly correct when *this or o is 0 or 255.