diff options
author | liyuqian <liyuqian@google.com> | 2016-11-07 08:10:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-07 08:10:44 -0800 |
commit | 451ceba3544fa1ff810378f1e9a47c7d20f48a9f (patch) | |
tree | ec172b9ffd6a31e2d89512dd88714136f7557436 /gm/aaa.cpp | |
parent | a225e9be53001a8397344ce1e272a7df2fced499 (diff) |
Combine analytic edges with tolerance
If not, we sometimes would end up with only one edge for a convex path. That
either triggers SkASSERT(count >= 2) failure in debug build or SIGSEGV in
release build. After the change, we should return 0 edges for such a path
because everything is totally combined.
Note that this change also makes the SkAnalyticEdge's CombineVertical function
behave more similarly to SkEdge's CombineVertical function: SkEdge only
compares fFirstY and fLastY which are integer values, which is equivalent to
setting our tolerance to SK_Fixed1 (our current tolerance is 0x100, 1/256 of
SK_Fixed1). And this is intentional.
BUG=chrome:662914
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2477373002
Review-Url: https://codereview.chromium.org/2477373002
Diffstat (limited to 'gm/aaa.cpp')
-rw-r--r-- | gm/aaa.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gm/aaa.cpp b/gm/aaa.cpp index d49d3f06c3..4788969de4 100644 --- a/gm/aaa.cpp +++ b/gm/aaa.cpp @@ -50,6 +50,17 @@ protected: canvas->drawRectCoords(20, 200, 200, 200.1f, p); canvas->drawCircle(100, 100, 30, p); canvas->restore(); + + // The following path is empty but it'll reveal bug chrome:662914 + SkPath path; + path.moveTo(SkBits2Float(0x429b9d5c), SkBits2Float(0x4367a041)); // 77.8073f, 231.626f + // 77.8075f, 231.626f, 77.8074f, 231.625f, 77.8073f, 231.625f + path.cubicTo(SkBits2Float(0x429b9d71), SkBits2Float(0x4367a022), + SkBits2Float(0x429b9d64), SkBits2Float(0x4367a009), + SkBits2Float(0x429b9d50), SkBits2Float(0x43679ff2)); + path.lineTo(SkBits2Float(0x429b9d5c), SkBits2Float(0x4367a041)); // 77.8073f, 231.626f + path.close(); + canvas->drawPath(path, p); } private: |