ARM Skia NEON patches - 07 - Equation simplification

Misc: simplify the equation of the exclusion Xfermode

The equation can be dramatically simplified. The results with gm are
the same except that the code is faster.

BUG=
R=djsollen@google.com, reed@google.com, bsalomon@google.com, cabanier@adobe.com

Author: kevin.petit.arm@gmail.com

Review URL: https://chromiumcodereview.appspot.com/18112016

git-svn-id: http://skia.googlecode.com/svn/trunk@10069 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2013-07-15 12:20:36 +00:00
parent afbb685123
commit e38e53b532

View File

@ -400,9 +400,12 @@ static SkPMColor difference_modeproc(SkPMColor src, SkPMColor dst) {
}
// kExclusion_Mode
static inline int exclusion_byte(int sc, int dc, int sa, int da) {
static inline int exclusion_byte(int sc, int dc, int, int) {
// this equations is wacky, wait for SVG to confirm it
int r = sc * da + dc * sa - 2 * sc * dc + sc * (255 - da) + dc * (255 - sa);
//int r = sc * da + dc * sa - 2 * sc * dc + sc * (255 - da) + dc * (255 - sa);
// The above equation can be simplified as follows
int r = 255*(sc + dc) - 2 * sc * dc;
return clamp_div255round(r);
}
static SkPMColor exclusion_modeproc(SkPMColor src, SkPMColor dst) {