Bug 58934

Summary: arc() should add a circle to the path when start and end angles are far enough apart
Product: WebKit Reporter: Matthew Delaney <mdelaney7>
Component: CanvasAssignee: Matthew Delaney <mdelaney7>
Status: RESOLVED FIXED    
Severity: Normal CC: cmarrin, mdelaney7, simon.fraser
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch
none
Patch mjs: review+

Matthew Delaney
Reported 2011-04-19 15:32:09 PDT
The spec says: "If the anticlockwise argument is omitted or false and endAngle-startAngle is equal to or greater than 2π, or, if the anticlockwise argument is true and startAngle-endAngle is equal to or greater than 2π, then the arc is the whole circumference of this circle." [http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-arc] We don't currently check for this case. The test fast/canvas/canvas-largedraws.html appears to somewhat exercise this case.
Attachments
Patch (4.45 KB, patch)
2011-04-20 10:46 PDT, Matthew Delaney
no flags
Patch (4.24 KB, patch)
2011-04-20 13:41 PDT, Matthew Delaney
no flags
Patch (4.17 KB, patch)
2011-04-20 14:21 PDT, Matthew Delaney
mjs: review+
Matthew Delaney
Comment 1 2011-04-20 10:46:08 PDT
mitz
Comment 2 2011-04-20 10:51:08 PDT
Comment on attachment 90359 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=90359&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:856 > + if (anticlockwise && sa - ea >= 2.0f * piFloat) { The coding style guidelines says that you should just write this as 2 * piFloat. > Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp:859 > + m_path.addArc(FloatPoint(x, y), r, sa, sa - piFloat, anticlockwise); > + m_path.addArc(FloatPoint(x, y), r, sa - piFloat, sa, anticlockwise); This can be done as a single 2π arc.
Matthew Delaney
Comment 3 2011-04-20 13:41:55 PDT
Matthew Delaney
Comment 4 2011-04-20 14:21:43 PDT
Maciej Stachowiak
Comment 5 2011-04-21 02:59:17 PDT
Comment on attachment 90411 [details] Patch r=me
Matthew Delaney
Comment 6 2011-04-21 11:51:36 PDT
Note You need to log in before you can comment on or make changes to this bug.