From bba3ab7cabc07655f82b76ac12f4bcce65816b37 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Mon, 19 Mar 2018 13:28:32 -0400 Subject: Reland "Check the boundary while cumulating deltas in a mask" This reverts commit 2ac541e66ce1afe174b31c24705ca47891816078. Reason for revert: try a new fix; the old one doesn't work because the deltas are not sorted. We use masks specifically because we don't want to sort deltas. Original change's description: > Revert "Check the boundary while cumulating deltas in a mask" > > This reverts commit d9779bcf93c2e11699230a54214309732b9161a7. > > Reason for revert: breaks gold > > Original change's description: > > Check the boundary while cumulating deltas in a mask > > > > Without the fix, > > > > ./out/Debug/dm --config t8888 -m complexclip_bw > > > > will trigger the assert. > > > > Note that this boundary check is already in place when deltas are > > cumulated without using a mask. > > > > Bug: skia: > > Change-Id: I68bfe2b7196d440743d3a7535d097bb8ec7689c3 > > Reviewed-on: https://skia-review.googlesource.com/113210 > > Commit-Queue: Yuqian Li > > Reviewed-by: Cary Clark > > TBR=liyuqian@google.com,reed@google.com,caryclark@skia.org > > Change-Id: Ice0e3618b02ef48b0f2a9f0662a12f76078e984a > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/113170 > Reviewed-by: Yuqian Li > Commit-Queue: Yuqian Li TBR=liyuqian@google.com,reed@google.com,caryclark@skia.org Change-Id: Ia7a3608a54bed23827ed014213dcd6248adb271d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7731 Reviewed-on: https://skia-review.googlesource.com/113520 Commit-Queue: Yuqian Li Reviewed-by: Mike Reed Reviewed-by: Yuqian Li --- src/core/SkBlitter.cpp | 3 ++- src/core/SkCoverageDelta.h | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index ccc31d093b..29294a989b 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -130,7 +130,8 @@ void SkBlitter::blitCoverageDeltas(SkCoverageDeltaList* deltas, const SkIRect& c SkFixed coverage = 0; // init coverage to 0 // skip deltas with x less than clip.fLeft; they must be precision errors - for(; i < deltas->count(y) && deltas->getDelta(y, i).fX < clip.fLeft; ++i); + for(; i < deltas->count(y) && deltas->getDelta(y, i).fX < clip.fLeft; ++i) + ; for(; i < deltas->count(y) && deltas->getDelta(y, i).fX < clip.fRight; ++i) { const SkCoverageDelta& delta = deltas->getDelta(y, i); SkASSERT(delta.fX >= lastX); // delta must be x sorted diff --git a/src/core/SkCoverageDelta.h b/src/core/SkCoverageDelta.h index 58c83ce343..13754890d0 100644 --- a/src/core/SkCoverageDelta.h +++ b/src/core/SkCoverageDelta.h @@ -107,8 +107,13 @@ private: class SkCoverageDeltaMask { public: +#ifdef SK_SUPPORT_LEGACY_PRECISION_BOUNDARY // 1 for precision error, 1 for boundary delta (e.g., -SK_Fixed1 at fBounds.fRight + 1) static constexpr int PADDING = 2; +#else + // 3 for precision error, 1 for boundary delta (e.g., -SK_Fixed1 at fBounds.fRight + 1) + static constexpr int PADDING = 4; +#endif static constexpr int SIMD_WIDTH = 8; static constexpr int SUITABLE_WIDTH = 32; -- cgit v1.2.3