Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4288)

Unified Diff: src/core/SkAAClip.cpp

Issue 2477393002: Relax the extra span's alpha (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkAAClip.cpp
diff --git a/src/core/SkAAClip.cpp b/src/core/SkAAClip.cpp
index c7e1ead9098f2df92d43a751947544e2ea128019..1a60754d91370a1888a6b99842bf77de24b88580 100644
--- a/src/core/SkAAClip.cpp
+++ b/src/core/SkAAClip.cpp
@@ -1331,12 +1331,16 @@ public:
}
// The supersampler's buffer can be the width of the device, so
- // we may have to trim the run to our bounds. If so, we assert that
- // the extra spans are always alpha==0
+ // we may have to trim the run to our bounds. Previously, we assert that
+ // the extra spans are always alpha==0.
+ // However, the analytic AA is too sensitive to precision errors
+ // so it may have extra spans with very tiny alpha because after several
+ // arithmatic operations, the edge may bleed the path boundary a little bit.
+ // Therefore, instead of always asserting alpha==0, we assert alpha < 0x10.
caryclark 2016/11/07 16:50:51 The assert below disagrees with the comment; it as
liyuqian 2016/11/08 16:33:47 Is SkASSERT(0x10 > *alpha) equivalent to SkASSERT(
int localX = x;
int localCount = count;
if (x < fLeft) {
- SkASSERT(0 == *alpha);
+ SkASSERT(0x10 > *alpha);
int gap = fLeft - x;
SkASSERT(gap <= count);
localX += gap;
@@ -1344,7 +1348,7 @@ public:
}
int right = x + count;
if (right > fRight) {
- SkASSERT(0 == *alpha);
+ SkASSERT(0x10 > *alpha);
localCount -= right - fRight;
SkASSERT(localCount >= 0);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698