Changeset 63727 in webkit


Ignore:
Timestamp:
Jul 20, 2010 12:07:16 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-07-20 Matthew Delaney <mdelaney@apple.com>

Reviewed by Kenneth Rohde Christiansen.

Failing 2d.path.stroke.prune.curve philip canvas test
https://bugs.webkit.org/show_bug.cgi?id=42190

  • platform/mac/Skipped: Unskipped now passing tests.

2010-07-20 Matthew Delaney <mdelaney@apple.com>

Reviewed by Kenneth Rohde Christiansen.

Failing 2d.path.stroke.prune.curve philip canvas test
https://bugs.webkit.org/show_bug.cgi?id=42190

  • html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::closePath): Added check to make sure there's a non-trivial path to close. Since there is currently no way to check if the current point is the start point, or similarly if there is only 1 point in the current subpath (since these are both sufficient conditions for a trivial subpath), then checking that the bounding rectangle has both zero width and height proves also to be a sufficient condition for a trivial path. (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Added in simple bounds as per the spec. (WebCore::CanvasRenderingContext2D::bezierCurveTo): Added in simple bounds as per the spec.
  • platform/graphics/cg/PathCG.cpp: (WebCore::Path::closeSubpath): Moved the check for an empty path up on level to make it platform independent and remove redundancy.
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63726 r63727  
     12010-07-20  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Failing 2d.path.stroke.prune.curve philip canvas test
     6        https://bugs.webkit.org/show_bug.cgi?id=42190
     7
     8        * platform/mac/Skipped: Unskipped now passing tests.
     9
    1102010-07-19  Maciej Stachowiak  <mjs@apple.com>
    211
  • trunk/LayoutTests/platform/mac/Skipped

    r63689 r63727  
    212212canvas/philip/tests/2d.path.clip.empty.html
    213213canvas/philip/tests/2d.path.rect.winding.html
    214 canvas/philip/tests/2d.path.stroke.prune.closed.html
    215 canvas/philip/tests/2d.path.stroke.prune.curve.html
    216214canvas/philip/tests/2d.pattern.image.broken.html
    217215canvas/philip/tests/2d.pattern.image.incomplete.html
  • trunk/WebCore/ChangeLog

    r63723 r63727  
     12010-07-20  Matthew Delaney  <mdelaney@apple.com>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        Failing 2d.path.stroke.prune.curve philip canvas test
     6        https://bugs.webkit.org/show_bug.cgi?id=42190
     7
     8        * html/canvas/CanvasRenderingContext2D.cpp:
     9        (WebCore::CanvasRenderingContext2D::closePath): Added check to make sure there's a non-trivial path to close. Since there is currently no way to check if the current point is the start point, or similarly if there is only 1 point in the current subpath (since these are both sufficient conditions for a trivial subpath), then checking that the bounding rectangle has both zero width and height proves also to be a sufficient condition for a trivial path.
     10        (WebCore::CanvasRenderingContext2D::quadraticCurveTo): Added in simple bounds as per the spec.
     11        (WebCore::CanvasRenderingContext2D::bezierCurveTo): Added in simple bounds as per the spec.
     12        * platform/graphics/cg/PathCG.cpp:
     13        (WebCore::Path::closeSubpath): Moved the check for an empty path up on level to make it platform independent and remove redundancy.
     14
    1152010-07-19  Victoria Kirst  <vrk@google.com>
    216
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r63659 r63727  
    558558void CanvasRenderingContext2D::closePath()
    559559{
    560     m_path.closeSubpath();
     560    if (m_path.isEmpty())
     561        return;
     562
     563    FloatRect boundRect = m_path.boundingRect();
     564    if (boundRect.width() || boundRect.height())
     565        m_path.closeSubpath();
    561566}
    562567
     
    576581    if (!state().m_invertibleCTM)
    577582        return;
    578    
     583
    579584    FloatPoint p1 = FloatPoint(x, y);
    580585    if (!m_path.hasCurrentPoint())
     
    592597    if (!m_path.hasCurrentPoint())
    593598        m_path.moveTo(FloatPoint(cpx, cpy));
    594     m_path.addQuadCurveTo(FloatPoint(cpx, cpy), FloatPoint(x, y));
     599
     600    FloatPoint p1 = FloatPoint(x, y);
     601    if (p1 != m_path.currentPoint())
     602        m_path.addQuadCurveTo(FloatPoint(cpx, cpy), p1);
    595603}
    596604
     
    603611    if (!m_path.hasCurrentPoint())
    604612        m_path.moveTo(FloatPoint(cp1x, cp1y));
    605     m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), FloatPoint(x, y));
     613
     614    FloatPoint p1 = FloatPoint(x, y);
     615    if (p1 != m_path.currentPoint())
     616        m_path.addBezierCurveTo(FloatPoint(cp1x, cp1y), FloatPoint(cp2x, cp2y), p1);
    606617}
    607618
  • trunk/WebCore/platform/graphics/cg/PathCG.cpp

    r63599 r63727  
    214214void Path::closeSubpath()
    215215{
    216     if (!CGPathIsEmpty(m_path)) // to silence a warning when trying to close an empty path
    217         CGPathCloseSubpath(m_path);
     216    CGPathCloseSubpath(m_path);
    218217}
    219218
Note: See TracChangeset for help on using the changeset viewer.