From 737b9a9d4806e376ee960d22578d08ea088c6ccd Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Thu, 3 May 2018 11:28:28 -0400 Subject: [PATCH] Remove legacy guard flags Bug: skia: Change-Id: I3b526f2caec6766faea72cdc89550f50e17c71d2 Reviewed-on: https://skia-review.googlesource.com/125746 Reviewed-by: Cary Clark Reviewed-by: Florin Malita Commit-Queue: Yuqian Li --- src/core/SkScan.cpp | 7 +------ src/core/SkScan_AAAPath.cpp | 14 +------------- tests/PathTest.cpp | 3 --- tools/flags/SkCommonFlags.cpp | 2 +- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/src/core/SkScan.cpp b/src/core/SkScan.cpp index 2603284f32..be9ea9c7c8 100644 --- a/src/core/SkScan.cpp +++ b/src/core/SkScan.cpp @@ -13,12 +13,7 @@ std::atomic gSkUseAnalyticAA{true}; std::atomic gSkForceAnalyticAA{false}; -#if defined(SK_SUPPORT_LEGACY_DELTA_AA) - std::atomic gSkUseDeltaAA{false}; -#else - std::atomic gSkUseDeltaAA{true}; -#endif - +std::atomic gSkUseDeltaAA{true}; std::atomic gSkForceDeltaAA{false}; static inline void blitrect(SkBlitter* blitter, const SkIRect& r) { diff --git a/src/core/SkScan_AAAPath.cpp b/src/core/SkScan_AAAPath.cpp index 3d78525d31..5e7f232ff7 100644 --- a/src/core/SkScan_AAAPath.cpp +++ b/src/core/SkScan_AAAPath.cpp @@ -1287,12 +1287,7 @@ static inline bool edges_too_close(SkAnalyticEdge* prev, SkAnalyticEdge* next, S // even if prev->fX and next->fX are close and within one pixel (e.g., prev->fX == 0.1, // next->fX == 0.9). Adding SLACK = 1 to the formula would guarantee it to be true if two // edges prev and next are within one pixel. - constexpr SkFixed SLACK = -#ifdef SK_SUPPORT_LEGACY_AA_BEHAVIOR - 0; -#else - SK_Fixed1; -#endif + constexpr SkFixed SLACK = SK_Fixed1; // Note that even if the following test failed, the edges might still be very close to each // other at some point within the current pixel row because of prev->fDX and next->fDX. @@ -1480,17 +1475,10 @@ static void aaa_walk_edges(SkAnalyticEdge* prevHead, SkAnalyticEdge* nextTail, } else { SkFixed rite = currE->fX; currE->goY(nextY, yShift); -#ifdef SK_SUPPORT_LEGACY_DELTA_AA - leftE->fX = SkTMax(leftClip, leftE->fX); - rite = SkTMin(rightClip, rite); - currE->fX = SkTMin(rightClip, currE->fX); - blit_trapezoid_row(blitter, y >> 16, left, rite, leftE->fX, currE->fX, -#else SkFixed nextLeft = SkTMax(leftClip, leftE->fX); rite = SkTMin(rightClip, rite); SkFixed nextRite = SkTMin(rightClip, currE->fX); blit_trapezoid_row(blitter, y >> 16, left, rite, nextLeft, nextRite, -#endif leftDY, currE->fDY, fullAlpha, maskRow, isUsingMask, noRealBlitter || (fullAlpha == 0xFF && ( edges_too_close(prevRite, left, leftE->fX) || diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp index 477b02b7c0..9d8c18f997 100644 --- a/tests/PathTest.cpp +++ b/tests/PathTest.cpp @@ -4373,7 +4373,6 @@ static void test_fuzz_crbug_662730(skiatest::Reporter* reporter) { test_draw_AA_path(100, 100, path); } -#if !defined(SK_SUPPORT_LEGACY_DELTA_AA) static void test_skbug_6947() { SkPath path; SkPoint points[] = @@ -4433,8 +4432,6 @@ static void test_skbug_7051() { test_draw_AA_path(100, 100, path); } -#endif - static void test_interp(skiatest::Reporter* reporter) { SkPath p1, p2, out; REPORTER_ASSERT(reporter, p1.isInterpolatable(p2)); diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp index 90656077c2..42a5cdee7c 100644 --- a/tools/flags/SkCommonFlags.cpp +++ b/tools/flags/SkCommonFlags.cpp @@ -91,7 +91,7 @@ DEFINE_bool(forceAnalyticAA, false, "Force analytic anti-aliasing even if the pa "whether it's concave or convex, we consider a path complicated" "if its number of points is comparable to its resolution."); -#if defined(SK_SUPPORT_LEGACY_DELTA_AA) || (defined(_MSC_VER) && !defined(__clang__)) +#if (defined(_MSC_VER) && !defined(__clang__)) constexpr bool kDefaultDeltaAA = false; #else constexpr bool kDefaultDeltaAA = true;