Changeset 62300 in webkit


Ignore:
Timestamp:
Jul 1, 2010 2:56:47 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-01 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Tor Arne Vestbø.

Canvas: bezierCurveTo() and quadraticCurveTo() must ensure subpaths
https://bugs.webkit.org/show_bug.cgi?id=41192

Unskipped two tests:

  • canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
  • canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html

fast/canvas/canvas-modify-emptyPath.html was updated to expect the new behavior.

Spec links:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-beziercurveto
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-quadraticcurveto

  • canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2-expected.txt:
  • canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2-expected.txt:
  • fast/canvas/canvas-modify-emptyPath-expected.txt:
  • fast/canvas/script-tests/canvas-modify-emptyPath.js:
  • platform/mac/Skipped:
  • platform/qt/Skipped:

2010-07-01 Andreas Kling <andreas.kling@nokia.com>

Reviewed by Tor Arne Vestbø.

Canvas: bezierCurveTo() and quadraticCurveTo() must ensure subpaths
https://bugs.webkit.org/show_bug.cgi?id=41192

If the current path is empty, bezierCurveTo() and quadraticCurveTo() will now
move to the (first) control point before adding the curve.

Spec links:
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-beziercurveto
http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-quadraticcurveto

  • html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::quadraticCurveTo): (WebCore::CanvasRenderingContext2D::bezierCurveTo):
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62299 r62300  
     12010-07-01  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Tor Arne Vestbø.
     4
     5        Canvas: bezierCurveTo() and quadraticCurveTo() must ensure subpaths
     6        https://bugs.webkit.org/show_bug.cgi?id=41192
     7
     8        Unskipped two tests:
     9        - canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
     10        - canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html
     11
     12        fast/canvas/canvas-modify-emptyPath.html was updated to expect the new behavior.
     13
     14        Spec links:
     15        http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-beziercurveto
     16        http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-quadraticcurveto
     17
     18        * canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2-expected.txt:
     19        * canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2-expected.txt:
     20        * fast/canvas/canvas-modify-emptyPath-expected.txt:
     21        * fast/canvas/script-tests/canvas-modify-emptyPath.js:
     22        * platform/mac/Skipped:
     23        * platform/qt/Skipped:
     24
    1252010-07-01  Andreas Kling  <andreas.kling@nokia.com>
    226
  • trunk/LayoutTests/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2-expected.txt

    r60162 r62300  
    77
    88Passed
    9 
  • trunk/LayoutTests/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2-expected.txt

    r60162 r62300  
    77
    88Passed
    9 
  • trunk/LayoutTests/fast/canvas/canvas-modify-emptyPath-expected.txt

    r58381 r62300  
    1212PASS getColor(50,50) is [0,128,0,255]
    1313Test quadraticCurveTo
    14 PASS getColor(50,50) is [255,0,0,255]
     14PASS getColor(10,10) is [255,0,0,255]
     15PASS getColor(50,50) is [0,128,0,255]
    1516Test quadraticCurveTo endpoint
     17PASS getColor(10,10) is [255,0,0,255]
    1618PASS getColor(99,51) is [0,128,0,255]
    17 PASS getColor(50,50) is [255,0,0,255]
     19PASS getColor(50,50) is [0,128,0,255]
    1820Test bezierCurveTo
    19 PASS getColor(50,50) is [255,0,0,255]
     21PASS getColor(10,10) is [255,0,0,255]
     22PASS getColor(50,50) is [0,128,0,255]
    2023Test bezierCurveTo endpoint
     24PASS getColor(10,10) is [255,0,0,255]
    2125PASS getColor(99,51) is [0,128,0,255]
    22 PASS getColor(50,50) is [255,0,0,255]
     26PASS getColor(50,50) is [0,128,0,255]
    2327PASS successfullyParsed is true
    2428
  • trunk/LayoutTests/fast/canvas/script-tests/canvas-modify-emptyPath.js

    r58381 r62300  
    5353ctx.quadraticCurveTo(0, 50, 100, 50);
    5454ctx.stroke();
    55 shouldBe("getColor(50,50)", "[255,0,0,255]");
     55shouldBe("getColor(10,10)", "[255,0,0,255]");
     56shouldBe("getColor(50,50)", "[0,128,0,255]");
    5657ctx.clearRect(0, 0, 300, 300);
    5758
     
    6263ctx.lineTo(50, 100);
    6364ctx.stroke();
     65shouldBe("getColor(10,10)", "[255,0,0,255]");
    6466shouldBe("getColor(99,51)", "[0,128,0,255]");
    65 shouldBe("getColor(50,50)", "[255,0,0,255]");
     67shouldBe("getColor(50,50)", "[0,128,0,255]");
    6668ctx.clearRect(0, 0, 300, 300);
    6769
     
    7173ctx.bezierCurveTo(0, 50, 50, 50, 100, 50);
    7274ctx.stroke();
    73 shouldBe("getColor(50,50)", "[255,0,0,255]");
     75shouldBe("getColor(10,10)", "[255,0,0,255]");
     76shouldBe("getColor(50,50)", "[0,128,0,255]");
    7477ctx.clearRect(0, 0, 300, 300);
    7578
     
    8184ctx.lineTo(50, 100);
    8285ctx.stroke();
     86shouldBe("getColor(10,10)", "[255,0,0,255]");
    8387shouldBe("getColor(99,51)", "[0,128,0,255]");
    84 shouldBe("getColor(50,50)", "[255,0,0,255]");
     88shouldBe("getColor(50,50)", "[0,128,0,255]");
    8589ctx.clearRect(0, 0, 300, 300);
    8690
  • trunk/LayoutTests/platform/mac/Skipped

    r62299 r62300  
    231231canvas/philip/tests/2d.missingargs.html
    232232canvas/philip/tests/2d.path.arcTo.ensuresubpath.2.html
    233 canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
    234233canvas/philip/tests/2d.path.clip.empty.html
    235 canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html
    236234canvas/philip/tests/2d.path.rect.winding.html
    237235canvas/philip/tests/2d.path.rect.zero.4.html
  • trunk/LayoutTests/platform/qt/Skipped

    r62299 r62300  
    52705270canvas/philip/tests/2d.path.arcTo.collinear.2.html
    52715271canvas/philip/tests/2d.path.arcTo.collinear.3.html
    5272 canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
    5273 canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html
    52745272canvas/philip/tests/2d.path.quadraticCurveTo.scaled.html
    52755273canvas/philip/tests/2d.path.quadraticCurveTo.shape.html
  • trunk/WebCore/ChangeLog

    r62299 r62300  
     12010-07-01  Andreas Kling  <andreas.kling@nokia.com>
     2
     3        Reviewed by Tor Arne Vestbø.
     4
     5        Canvas: bezierCurveTo() and quadraticCurveTo() must ensure subpaths
     6        https://bugs.webkit.org/show_bug.cgi?id=41192
     7
     8        If the current path is empty, bezierCurveTo() and quadraticCurveTo() will now
     9        move to the (first) control point before adding the curve.
     10
     11        Spec links:
     12        http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-beziercurveto
     13        http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-quadraticcurveto
     14
     15        * html/canvas/CanvasRenderingContext2D.cpp:
     16        (WebCore::CanvasRenderingContext2D::quadraticCurveTo):
     17        (WebCore::CanvasRenderingContext2D::bezierCurveTo):
     18
    1192010-07-01  Andreas Kling  <andreas.kling@nokia.com>
    220
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r62277 r62300  
    575575        return;
    576576    if (!m_path.hasCurrentPoint())
    577         m_path.moveTo(FloatPoint(x, y));
    578     else
    579         m_path.addQuadCurveTo(FloatPoint(cpx, cpy), FloatPoint(x, y));
     577        m_path.moveTo(FloatPoint(cpx, cpy));
     578    m_path.addQuadCurveTo(FloatPoint(cpx, cpy), FloatPoint(x, y));
    580579}
    581580
     
    587586        return;
    588587    if (!m_path.hasCurrentPoint())
    589         m_path.moveTo(FloatPoint(x, y));
    590     else
    591         m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), FloatPoint(x, y));
     588        m_path.moveTo(FloatPoint(cp1x, cp1y));
     589    m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), FloatPoint(x, y));
    592590}
    593591
Note: See TracChangeset for help on using the changeset viewer.