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

Issue 2281953002: avoid generating degenerate conic from arc (Closed)

Created:
4 years, 3 months ago by caryclark
Modified:
4 years, 2 months ago
Reviewers:
Mark Kilgard, bsalomon
CC:
reviews_skia.org
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : add isolated test case #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -2 lines) Patch
M gm/circulararcs.cpp View 1 1 chunk +23 lines, -0 lines 0 comments Download
M src/core/SkGeometry.cpp View 1 1 chunk +4 lines, -2 lines 1 comment Download

Messages

Total messages: 18 (12 generated)
caryclark
4 years, 3 months ago (2016-08-26 16:12:29 UTC) #8
bsalomon
lgtm
4 years, 3 months ago (2016-08-26 16:15:02 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2281953002/20001
4 years, 3 months ago (2016-08-26 16:53:31 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/f71ab8f58b0a7abb7818cf665dfb116ef370d572
4 years, 3 months ago (2016-08-26 16:54:28 UTC) #15
Mark Kilgard
You should avoid epsilon calculations. I don't think this is a good approach. https://codereview.chromium.org/2281953002/diff/20001/src/core/SkGeometry.cpp File ...
4 years, 3 months ago (2016-08-26 17:13:07 UTC) #17
xidachen
4 years, 2 months ago (2016-09-29 20:11:15 UTC) #18
Message was sent while issue was closed.
On 2016/08/26 17:13:07, Mark Kilgard wrote:
> You should avoid epsilon calculations.
> 
> I don't think this is a good approach.
> 
> https://codereview.chromium.org/2281953002/diff/20001/src/core/SkGeometry.cpp
> File src/core/SkGeometry.cpp (right):
> 
>
https://codereview.chromium.org/2281953002/diff/20001/src/core/SkGeometry.cpp...
> src/core/SkGeometry.cpp:1357: }
> I don't like this epsilon handling here.  It's just going to shift the issue.
> 
> The method looks much as I expected it to look.  It divides large arcs into 90
> degree quadrants.
> 
> Can you instead figure out how many even segments to divide the arc into?
> 
> This approach has two advantages:
> 1) more stable, no epsilon change
> 2) each conic's w value will be identical
> 
> Example:  If the angle is 200 degrees, notice that ceil(200/90) is 3 (2.222
> rounds up to 3) then 200/3 = 66.66.  Now you can do the sqrt((1+dot)/2) math
to
> determine a single w where dot is cos of 66.66 degrees.
> 
> Make sense?  I think this can be a simpler overall algorithm than what you
have
> here.
> 
> Keep in mind if somebody had a abnormally large miter limit and used a miter
> join, they might still be able to get zinged join geometry.

I did some investigation, and this change is the cause of this bug (due to the
epsilon):
https://bugs.chromium.org/p/skia/issues/detail?id=5807

Powered by Google App Engine
This is Rietveld 408576698