Go to file
mtklein afe2ffb8ba Rework SSE and NEON Color32 algorithms to be more correct and faster.
This algorithm changes the blend math, guarded by SK_LEGACY_COLOR32_MATH.  The new math is more correct: it's never off by more than 1, and correct in all the interesting 0x00 and 0xFF edge cases, where the old math was never off by more than 2, and not always correct on the edges.

If you look at tests/BlendTest.cpp, the old code was using the `blend_256_plus1_trunc` algorithm, while the new code uses `blend_256_round_alt`.  Neither uses `blend_perfect`, which is about ~35% slower than `blend_256_round_alt`.

This will require an unfathomable number of rebaselines, first to Skia, then to Blink when I remove the guard.

I plan to follow up with some integer SIMD abstractions that can unify these two implementations into a single algorithm.  This was originally what I was working on here, but the correctness gains seem to be quite compelling.  The only places these two algorithms really differ greatly now is the kernel function, and even there they can really both be expressed abstractly as:
  - multiply 8-bits and 8-bits producing 16-bits
  - add 16-bits to 16-bits, returning the top 8 bits.
All the constants are the same, except SSE is a little faster to keep 8 16-bit inverse alphas, NEON's a little faster to keep 8 8-bit inverse alphas.  I may need to take this small speed win back to unify the two.

We should expect a ~25% speedup on Intel (mostly from unrolling to 8 pixels) and a ~20% speedup on ARM (mostly from using vaddhn to add `color`, round, and narrow back down to 8-bit all into one instruction.

(I am probably missing several more related bugs here.)
BUG=skia:3738,skia:420,chromium:111470

Review URL: https://codereview.chromium.org/1092433002
2015-04-17 11:00:55 -07:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/) 2015-04-16 20:10:55 -07:00
bin tools: add sync-and-gyp script 2015-03-27 12:11:49 -07:00
debugger [SkDebugger] Flatten drawPicture ops 2015-04-01 20:58:37 -07:00
dm SkJpegCodec 2015-04-15 07:32:20 -07:00
docs Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
example C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
experimental default to 8888 for ganesh in sampleapp on iOS 2015-04-09 13:43:22 -07:00
forth Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
gm adding new gm to rotate, translate, and scale textblobs 2015-04-17 09:01:05 -07:00
gyp adding new gm to rotate, translate, and scale textblobs 2015-04-17 09:01:05 -07:00
include Remove filename from SkFontDescriptor. 2015-04-17 11:00:06 -07:00
platform_tools Fail gracefully when dm.json is not present 2015-04-08 15:20:25 -04:00
resources Add test font for large glyphs. 2015-04-02 12:18:38 -07:00
samplecode Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/) 2015-04-16 20:10:55 -07:00
site contrib: Simplify the command to create a feature branch. 2015-04-16 13:28:06 -07:00
src Rework SSE and NEON Color32 algorithms to be more correct and faster. 2015-04-17 11:00:55 -07:00
tests Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/) 2015-04-16 20:10:55 -07:00
third_party Enable both static and dynamically linked libpng 2015-04-03 12:35:27 -07:00
tools Start canonicalizing color for all A8 textblobs 2015-04-14 12:17:27 -07:00
.gitignore git: add skps to .gitignore 2015-02-13 18:57:33 -08:00
AUTHORS Return cropBitmap 2015-04-15 05:48:54 -07:00
codereview.settings Automatically add a docs preview link and NOTRY=true when there are only docs changes. 2015-02-26 10:16:13 -08:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS add new Skia team member to committers list 2015-02-03 11:10:57 -08:00
DEPS Roll common DEPS: fix string concat error in gs_utils upload 2015-04-15 04:49:32 -07:00
Doxyfile C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
gyp_skia allow caller to override the default output directory for gyp 2014-09-29 11:42:25 -07:00
gyp_skia.py Roll gyp deps from 1765 to 1796. 2013-11-21 18:11:14 +00:00
HASHTAGS Fix cr SKPs naming 2015-03-31 08:03:02 -07:00
LICENSE Manually update copyright notices in files that defied the automated process 2011-07-28 14:24:55 +00:00
make.bat Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
make.py Run gyp on Win with --no-parallel -G config=$(BUILDTYPE), fix pylint 2015-03-03 13:15:38 -05:00
Makefile Run gyp with --no-parallel -G config=$(BUILDTYPE) 2015-03-03 06:05:56 -08:00
OWNERS add root files from chrome 2013-08-13 19:11:15 +00:00
PRESUBMIT.py Bypass owners check for dry run CLs. 2015-04-07 07:41:51 -07:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium add root files from chrome 2013-08-13 19:11:15 +00:00
skia.gyp Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
SKP_VERSION Update SKP version 2015-04-05 01:14:18 -07:00
whitespace.txt Whitespace change to see if Android bots are fixed 2015-03-27 09:46:25 -07:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.