Changeset 66979 in webkit


Ignore:
Timestamp:
Sep 8, 2010 7:07:01 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-09-08 Jan E Hanssen <jhanssen@sencha.com>

Reviewed by Dirk Schulze.

Add a test for getting a point beyond the length of the path
https://bugs.webkit.org/show_bug.cgi?id=43837

  • svg/dom/path-pointAtLength-expected.txt:
  • svg/dom/script-tests/path-pointAtLength.js:

2010-09-08 Jan E Hanssen <jhanssen@sencha.com>

Reviewed by Dirk Schulze.

[Qt] PathQt should use the QPainterPath functionality for calculations
https://bugs.webkit.org/show_bug.cgi?id=43837

Change PathQt to use the built-in functionality of QPainterPath for
calculating length(), pointAtLength() and normalAngleAtLength().

  • platform/graphics/Path.cpp:
  • platform/graphics/qt/PathQt.cpp: (WebCore::Path::length): (WebCore::Path::pointAtLength): (WebCore::Path::normalAngleAtLength):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66974 r66979  
     12010-09-08  Jan E Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Add a test for getting a point beyond the length of the path
     6        https://bugs.webkit.org/show_bug.cgi?id=43837
     7
     8        * svg/dom/path-pointAtLength-expected.txt:
     9        * svg/dom/script-tests/path-pointAtLength.js:
     10
    1112010-09-08  Yael Aharon  <yael.aharon@nokia.com>
    212
  • trunk/LayoutTests/svg/dom/path-pointAtLength-expected.txt

    r66208 r66979  
    77PASS pointAtLengthOfPath('M0,20 L400,20 L640,20 z') is '(580, 20)'
    88PASS pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20') is '(100, 20)'
     9PASS pointAtLengthOfPath('M0,20 L20,40') is '(20, 40)'
    910PASS successfullyParsed is true
    1011
  • trunk/LayoutTests/svg/dom/script-tests/path-pointAtLength.js

    r66208 r66979  
    1313shouldBe("pointAtLengthOfPath('M0,20 L400,20 L640,20 z')", "'(580, 20)'");
    1414shouldBe("pointAtLengthOfPath('M0,20 L400,20 z M 320,20 L640,20')", "'(100, 20)'");
     15shouldBe("pointAtLengthOfPath('M0,20 L20,40')", "'(20, 40)'");
    1516
    1617var successfullyParsed = true;
  • trunk/WebCore/ChangeLog

    r66978 r66979  
     12010-09-08  Jan E Hanssen  <jhanssen@sencha.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        [Qt] PathQt should use the QPainterPath functionality for calculations
     6        https://bugs.webkit.org/show_bug.cgi?id=43837
     7
     8        Change PathQt to use the built-in functionality of QPainterPath for
     9        calculating length(), pointAtLength() and normalAngleAtLength().
     10
     11        * platform/graphics/Path.cpp:
     12        * platform/graphics/qt/PathQt.cpp:
     13        (WebCore::Path::length):
     14        (WebCore::Path::pointAtLength):
     15        (WebCore::Path::normalAngleAtLength):
     16
    1172010-09-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
    218
  • trunk/WebCore/platform/graphics/Path.cpp

    r65370 r66979  
    4040namespace WebCore {
    4141
    42 #if !PLATFORM(OPENVG)
     42#if !PLATFORM(OPENVG) && !PLATFORM(QT)
    4343static void pathLengthApplierFunction(void* info, const PathElement* element)
    4444{
  • trunk/WebCore/platform/graphics/qt/PathQt.cpp

    r66948 r66979  
    475475}
    476476
     477float Path::length()
     478{
     479    return m_path.length();
     480}
     481
     482FloatPoint Path::pointAtLength(float length, bool& ok)
     483{
     484    ok = (length >= 0 && length <= m_path.length());
     485
     486    qreal percent = m_path.percentAtLength(length);
     487    QPointF point = m_path.pointAtPercent(percent);
     488
     489    return point;
     490}
     491
     492float Path::normalAngleAtLength(float length, bool& ok)
     493{
     494    ok = (length >= 0 && length <= m_path.length());
     495
     496    qreal percent = m_path.percentAtLength(length);
     497    qreal angle = m_path.angleAtPercent(percent);
     498
     499    return angle;
     500}
     501
    477502}
    478503
Note: See TracChangeset for help on using the changeset viewer.