aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-03-06 17:04:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-08 16:32:07 +0000
commit8de05ffcb26c757a6169e217ef46105286811dd9 (patch)
tree930e9b0547b6eef8cd5928ba902695f8b92d0014
parent837fcb68ff5bddbd30f6994fa859a1d98745ccad (diff)
Remove SK_SUPPORT_LEGACY_AAA flag as chromium now turns it off
BUG=skia: Change-Id: I3b385b8aeab08f402f4471637bf641cd456c8c56 Reviewed-on: https://skia-review.googlesource.com/9327 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
-rw-r--r--src/core/SkAnalyticEdge.cpp13
-rw-r--r--src/core/SkAnalyticEdge.h11
-rw-r--r--src/core/SkScan_AAAPath.cpp7
-rw-r--r--src/core/SkScan_AntiPath.cpp7
4 files changed, 2 insertions, 36 deletions
diff --git a/src/core/SkAnalyticEdge.cpp b/src/core/SkAnalyticEdge.cpp
index 213262f3b2..f6ad62f12f 100644
--- a/src/core/SkAnalyticEdge.cpp
+++ b/src/core/SkAnalyticEdge.cpp
@@ -39,11 +39,7 @@ bool SkAnalyticEdge::updateLine(SkFixed x0, SkFixed y0, SkFixed x1, SkFixed y1,
fY = y0;
fUpperY = y0;
fLowerY = y1;
-#ifdef SK_SUPPORT_LEGACY_AAA
- fDY = (absSlope | dx) == 0
-#else
fDY = (dx == 0 || slope == 0)
-#endif
? SK_MaxS32
: absSlope < kInverseTableSize
? QuickFDot6Inverse::Lookup(absSlope)
@@ -106,19 +102,10 @@ bool SkAnalyticQuadraticEdge::updateQuadratic() {
} else {
newSnappedY = SkTMin(fQEdge.fQLastY, SnapY(newy));
newSnappedX = newx;
-#ifdef SK_SUPPORT_LEGACY_AAA
- SkFDot6 diffY = SkFixedToFDot6(newy - fSnappedY);
-#else
SkFDot6 diffY = SkFixedToFDot6(newSnappedY - fSnappedY);
-#endif
slope = diffY ? QuickSkFDot6Div(SkFixedToFDot6(newx - fSnappedX), diffY)
: SK_MaxS32;
}
-#ifndef SK_SUPPORT_LEGACY_AAA
- SkASSERT(slope == SK_MaxS32 ||
- SkAbs32(fSnappedX + SkFixedMul(slope, newSnappedY - fSnappedY) - newSnappedX)
- < SkFixedMul(SK_Fixed1 >> 4, SkTMax(SK_Fixed1, SkAbs32(slope))));
-#endif
dx += fQEdge.fQDDx;
dy += fQEdge.fQDDy;
}
diff --git a/src/core/SkAnalyticEdge.h b/src/core/SkAnalyticEdge.h
index 1df3e01685..65fb11c69c 100644
--- a/src/core/SkAnalyticEdge.h
+++ b/src/core/SkAnalyticEdge.h
@@ -151,12 +151,6 @@ bool SkAnalyticEdge::setLine(const SkPoint& p0, const SkPoint& p1) {
}
// are we a zero-height line?
-#ifdef SK_SUPPORT_LEGACY_AAA
- if (y0 == y1) {
- return false;
- }
- SkFixed slope = SkFixedDiv(x1 - x0, y1 - y0);
-#else
SkFDot6 dy = SkFixedToFDot6(y1 - y0);
if (dy == 0) {
return false;
@@ -164,7 +158,6 @@ bool SkAnalyticEdge::setLine(const SkPoint& p0, const SkPoint& p1) {
SkFDot6 dx = SkFixedToFDot6(x1 - x0);
SkFixed slope = QuickSkFDot6Div(dx, dy);
SkFixed absSlope = SkAbs32(slope);
-#endif
fX = x0;
fDX = slope;
@@ -172,13 +165,9 @@ bool SkAnalyticEdge::setLine(const SkPoint& p0, const SkPoint& p1) {
fY = y0;
fUpperY = y0;
fLowerY = y1;
-#ifdef SK_SUPPORT_LEGACY_AAA
- fDY = x1 != x0 ? SkAbs32(SkFixedDiv(y1 - y0, x1 - x0)) : SK_MaxS32;
-#else
fDY = dx == 0 || slope == 0 ? SK_MaxS32 : absSlope < kInverseTableSize
? QuickFDot6Inverse::Lookup(absSlope)
: SkAbs32(QuickSkFDot6Div(dy, dx));
-#endif
fCurveCount = 0;
fWinding = SkToS8(winding);
fCurveShift = 0;
diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp
index 80a09e5740..634a82661c 100644
--- a/src/core/SkScan_AAAPath.cpp
+++ b/src/core/SkScan_AAAPath.cpp
@@ -1766,13 +1766,6 @@ void SkScan::AAAFillPath(const SkPath& path, const SkRegion& origClip, SkBlitter
if (origClip.isEmpty()) {
return;
}
- #ifdef SK_SUPPORT_LEGACY_AAA
- if (path.isInverseFillType() || !path.isConvex()) {
- // Fall back as we only implemented the algorithm for convex shapes yet.
- SkScan::AntiFillPath(path, origClip, blitter, forceRLE);
- return;
- }
- #endif
const bool isInverse = path.isInverseFillType();
SkIRect ir;
diff --git a/src/core/SkScan_AntiPath.cpp b/src/core/SkScan_AntiPath.cpp
index 16c91a9c1c..19989ff6d2 100644
--- a/src/core/SkScan_AntiPath.cpp
+++ b/src/core/SkScan_AntiPath.cpp
@@ -754,9 +754,6 @@ void SkScan::FillPath(const SkPath& path, const SkRasterClip& clip,
}
static bool suitableForAAA(const SkPath& path) {
-#ifdef SK_SUPPORT_LEGACY_AAA
- return true;
-#endif
if (gSkForceAnalyticAA.load()) {
return true;
}
@@ -764,8 +761,8 @@ static bool suitableForAAA(const SkPath& path) {
// When the path have so many points compared to the size of its bounds/resolution,
// it indicates that the path is not quite smooth in the current resolution:
// the expected number of turning points in every pixel row/column is significantly greater than
- // zero. Hence Aanlytic AA is not likely to produce visible quality improvents, and Analytic AA
- // might be slower than supersampling.
+ // zero. Hence Aanlytic AA is not likely to produce visible quality improvements, and Analytic
+ // AA might be slower than supersampling.
return path.countPoints() < SkTMax(bounds.width(), bounds.height()) / 2 - 10;
}