Changeset 39008 in webkit


Ignore:
Timestamp:
Dec 4, 2008 4:03:08 PM (15 years ago)
Author:
kevino@webkit.org
Message:

Reviewed by Kevin Ollivier.

wx implementations for Path API.

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

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r39007 r39008  
     12008-12-04  Kevin Watters  <kevinwatters@gmail.com>
     2
     3        Reviewed by Kevin Ollivier.
     4
     5        wx implementations for Path API.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=22661
     8
     9        * platform/graphics/wx/PathWx.cpp:
     10        (WebCore::Path::~Path):
     11        (WebCore::Path::contains):
     12        (WebCore::Path::addLineTo):
     13        (WebCore::Path::addQuadCurveTo):
     14        (WebCore::Path::addBezierCurveTo):
     15        (WebCore::Path::addArcTo):
     16        (WebCore::Path::closeSubpath):
     17        (WebCore::Path::addArc):
     18        (WebCore::Path::addRect):
     19        (WebCore::Path::addEllipse):
     20        (WebCore::Path::transform):
     21        (WebCore::Path::isEmpty):
     22
    1232008-12-04  Julien Chaffraix  <jchaffraix@webkit.org>
    224
  • trunk/WebCore/platform/graphics/wx/PathWx.cpp

    r30363 r39008  
    6565
    6666Path::~Path()
    67 { 
     67{
    6868}
    6969
     
    7575bool Path::contains(const FloatPoint& point, const WindRule rule) const
    7676{
     77    if (m_path) {
     78        return m_path->Contains(point.x(), point.y(), getWxWindRuleForWindRule(rule));
     79    }
    7780    return false;
    7881}
     
    122125}
    123126
    124 void Path::addLineTo(const FloatPoint&)
     127void Path::addLineTo(const FloatPoint& point)
    125128{
    126     notImplemented();
     129    if (m_path)
     130        m_path->AddLineToPoint(point.x(), point.y());
    127131}
    128132
    129 void Path::addQuadCurveTo(const FloatPoint&, const FloatPoint&)
     133void Path::addQuadCurveTo(const FloatPoint& control, const FloatPoint& end)
    130134{
    131     notImplemented();
     135    if (m_path)
     136        m_path->AddQuadCurveToPoint(control.x(), control.y(), end.x(), end.y());
    132137}
    133138
    134 void Path::addBezierCurveTo(const FloatPoint&, const FloatPoint&, const FloatPoint&)
     139void Path::addBezierCurveTo(const FloatPoint& control1, const FloatPoint& control2, const FloatPoint& end)
    135140{
    136     notImplemented();
     141    if (m_path)
     142        m_path->AddCurveToPoint(control1.x(), control1.y(), control2.x(), control2.y(), end.x(), end.y());
    137143}
    138144
    139 void Path::addArcTo(const FloatPoint&, const FloatPoint&, float)
     145void Path::addArcTo(const FloatPoint& point1, const FloatPoint& point2, float radius)
    140146{
    141     notImplemented();
     147    if (m_path)
     148        m_path->AddArcToPoint(point1.x(), point1.y(), point2.x(), point2.y(), radius);
    142149}
    143150
    144151void Path::closeSubpath()
    145152{
    146     notImplemented();
     153    if (m_path)
     154        m_path->CloseSubpath();
    147155}
    148156
    149 void Path::addArc(const FloatPoint&, float, float, float, bool)
     157void Path::addArc(const FloatPoint& point, float radius, float startAngle, float endAngle, bool clockwise)
    150158{
    151     notImplemented();
     159    if (m_path)
     160        m_path->AddArc(point.x(), point.y(), radius, startAngle, endAngle, clockwise);
    152161}
    153162
    154 void Path::addRect(const FloatRect&)
     163void Path::addRect(const FloatRect& rect)
    155164{
    156     notImplemented();
     165    if (m_path)
     166        m_path->AddRectangle(rect.x(), rect.y(), rect.width(), rect.height());
    157167}
    158168
    159 void Path::addEllipse(const FloatRect&)
     169void Path::addEllipse(const FloatRect& rect)
    160170{
    161     notImplemented();
     171    if (m_path)
     172        m_path->AddEllipse(rect.x(), rect.y(), rect.width(), rect.height());
    162173}
    163174
    164 void Path::transform(const AffineTransform&)
     175void Path::transform(const AffineTransform& transform)
    165176{
    166     notImplemented();
     177    if (m_path)
     178        m_path->Transform(transform);
    167179}
    168180
     
    174186bool Path::isEmpty() const
    175187{
    176     notImplemented();
    177     return false;
     188    if (m_path) {
     189        wxDouble width, height;
     190        m_path->GetBox(NULL, NULL, &width, &height);
     191        return (width == 0 && height == 0);
     192    }
     193    return true;
    178194}
    179195
Note: See TracChangeset for help on using the changeset viewer.