Changeset 59767 in webkit


Ignore:
Timestamp:
May 19, 2010 8:55:12 AM (14 years ago)
Author:
chang.shu@nokia.com
Message:

2010-05-19 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Simon Hausmann.

[Qt] REGRESSION: CoolClock isn't rendered properly

https://bugs.webkit.org/show_bug.cgi?id=38526

CanvasRenderingContext2D's arc() should connect to the previous point
with a straight line (HTML5 spec 4.8.11.1.8), but if the path is empty
to begin with, we don't want a line back to (0,0)
This also fixes the rendering artifact discussed in bug 36226.

Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-arc

Test: fast/canvas/canvas-arc-connecting-line.html

  • platform/graphics/qt/PathQt.cpp: (WebCore::Path::addArc):

2010-05-19 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Simon Hausmann.

Add test to verify that CanvasRenderingContext2D's arc() connects arcs
by a straight line (unless it's the first element in the path.)
https://bugs.webkit.org/show_bug.cgi?id=38526

  • fast/canvas/canvas-arc-connecting-line-expected.txt: Added.
  • fast/canvas/canvas-arc-connecting-line.html: Added.
  • fast/canvas/script-tests/canvas-arc-connecting-line.js: Added. (deg2rad):
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r59766 r59767  
     12010-05-19  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        Add test to verify that CanvasRenderingContext2D's arc() connects arcs
     6        by a straight line (unless it's the first element in the path.)
     7        https://bugs.webkit.org/show_bug.cgi?id=38526
     8
     9        * fast/canvas/canvas-arc-connecting-line-expected.txt: Added.
     10        * fast/canvas/canvas-arc-connecting-line.html: Added.
     11        * fast/canvas/script-tests/canvas-arc-connecting-line.js: Added.
     12        (deg2rad):
     13
    1142010-05-19  Peter Varga  <pvarga@inf.u-szeged.hu>
    215
  • trunk/WebCore/ChangeLog

    r59762 r59767  
     12010-05-19  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] REGRESSION: CoolClock isn't rendered properly
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=38526
     8
     9        CanvasRenderingContext2D's arc() should connect to the previous point
     10        with a straight line (HTML5 spec 4.8.11.1.8), but if the path is empty
     11        to begin with, we don't want a line back to (0,0)
     12        This also fixes the rendering artifact discussed in bug 36226.
     13
     14        Spec link:
     15        http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-arc
     16
     17        Test: fast/canvas/canvas-arc-connecting-line.html
     18
     19        * platform/graphics/qt/PathQt.cpp:
     20        (WebCore::Path::addArc):
     21
    1222010-05-19  Alexander Pavlov  <apavlov@chromium.org>
    223
  • trunk/WebCore/platform/graphics/qt/PathQt.cpp

    r58207 r59767  
    299299    }
    300300
    301     // connect to the previous point by a straight line
    302     m_path.lineTo(QPointF(xc + radius  * cos(sar),
    303                           yc - radius  * sin(sar)));
     301    // If the path is empty, move to where the arc will start to avoid painting a line from (0,0)
     302    // NOTE: QPainterPath::isEmpty() won't work here since it ignores a lone MoveToElement
     303    if (!m_path.elementCount())
     304        m_path.arcMoveTo(xs, ys, width, height, sa);
    304305
    305306    m_path.arcTo(xs, ys, width, height, sa, span);
Note: See TracChangeset for help on using the changeset viewer.