diff options
author | Yuqian Li <liyuqian@google.com> | 2016-11-17 09:23:26 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-17 17:54:50 +0000 |
commit | 4eb35bb7d72d0e87f1546e822909929e1eef12bb (patch) | |
tree | a4331db4ef64afdc92f8e758dbd3fc4dc6828b9e /src/core/SkAnalyticEdge.h | |
parent | e60ad620fe236ce4c1e85a31bd53ed0c848da8c3 (diff) |
Use SkFixedMul instead of SkFixedMul_lowprec
It seems that SkFixedMul_lowprec doesn't have too much performance gain (maybe
1%). But its precision loss is siginificant. No serious issues have been found
in convex cases, but things get much trickier for concave shapes. I'm removing
it now to improve the stability and reliability of our algorithm, which may
potentially benefit our Chrome landing. (Even if we do not remove
SkFixedMul_lowprec now, we eventually will remove it when we land concave AAA
code.)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4926
Change-Id: Iae5739a3780bb77ce6237888eee51a502fea5cf2
Reviewed-on: https://skia-review.googlesource.com/4926
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkAnalyticEdge.h')
-rw-r--r-- | src/core/SkAnalyticEdge.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/core/SkAnalyticEdge.h b/src/core/SkAnalyticEdge.h index a55ab2a71e..7f5e62c519 100644 --- a/src/core/SkAnalyticEdge.h +++ b/src/core/SkAnalyticEdge.h @@ -10,11 +10,6 @@ #include "SkEdge.h" -inline SkFixed SkFixedMul_lowprec(SkFixed a, SkFixed b) { - SkASSERT(((int64_t)a >> 8) * (b >> 8) <= SK_MaxS32); - return (a >> 8) * (b >> 8); -} - struct SkAnalyticEdge { // Similar to SkEdge, the conic edges will be converted to quadratic edges enum Type { @@ -55,7 +50,7 @@ struct SkAnalyticEdge { } else if (y != fY) { // Drop lower digits as our alpha only has 8 bits // (fDX and y - fUpperY may be greater than SK_Fixed1) - fX = fUpperX + SkFixedMul_lowprec(fDX, y - fUpperY); + fX = fUpperX + SkFixedMul(fDX, y - fUpperY); fY = y; } } |