Changeset 73184 in webkit


Ignore:
Timestamp:
Dec 2, 2010 12:41:30 PM (13 years ago)
Author:
Patrick Gansterer
Message:

2010-12-02 Patrick Gansterer <Patrick Gansterer>

Reviewed by Andreas Kling.

[OpenVG] Remove "current path" of GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=50294

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/openvg/GraphicsContextOpenVG.cpp: (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::clipPath):
  • platform/graphics/openvg/PainterOpenVG.cpp: (WebCore::PainterOpenVG::PainterOpenVG): (WebCore::PainterOpenVG::~PainterOpenVG): (WebCore::PainterOpenVG::drawPath):
  • platform/graphics/openvg/PainterOpenVG.h:
Location:
trunk/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73183 r73184  
     12010-12-02  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [OpenVG] Remove "current path" of GraphicsContext
     6        https://bugs.webkit.org/show_bug.cgi?id=50294
     7
     8        * platform/graphics/GraphicsContext.h:
     9        * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
     10        (WebCore::GraphicsContext::fillPath):
     11        (WebCore::GraphicsContext::strokePath):
     12        (WebCore::GraphicsContext::clipPath):
     13        * platform/graphics/openvg/PainterOpenVG.cpp:
     14        (WebCore::PainterOpenVG::PainterOpenVG):
     15        (WebCore::PainterOpenVG::~PainterOpenVG):
     16        (WebCore::PainterOpenVG::drawPath):
     17        * platform/graphics/openvg/PainterOpenVG.h:
     18
    1192010-12-02  Patrick Gansterer  <paroga@webkit.org>
    220
  • trunk/WebCore/platform/graphics/GraphicsContext.h

    r73183 r73184  
    302302        void setCompositeOperation(CompositeOperator);
    303303
    304 #if PLATFORM(SKIA) || PLATFORM(OPENVG)
     304#if PLATFORM(SKIA)
    305305        void beginPath();
    306306        void addPath(const Path&);
  • trunk/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp

    r72926 r73184  
    145145        return;
    146146
    147     // FIXME: Be smarter about this.
    148     beginPath();
    149     addPath(path);
    150 
    151     m_data->drawPath(VG_FILL_PATH, m_common->state.fillRule);
     147    m_data->drawPath(path, VG_FILL_PATH, m_common->state.fillRule);
    152148}
    153149
     
    157153        return;
    158154
    159     // FIXME: Be smarter about this.
    160     beginPath();
    161     addPath(path);
    162 
    163     m_data->drawPath(VG_STROKE_PATH, m_common->state.fillRule);
     155    m_data->drawPath(path, VG_STROKE_PATH, m_common->state.fillRule);
    164156}
    165157
     
    198190}
    199191
    200 void GraphicsContext::beginPath()
    201 {
    202     if (paintingDisabled())
    203         return;
    204 
    205     m_data->beginPath();
    206 }
    207 
    208 void GraphicsContext::addPath(const Path& path)
    209 {
    210     if (paintingDisabled())
    211         return;
    212 
    213     m_data->addPath(path);
    214 }
    215 
    216192void GraphicsContext::clip(const FloatRect& rect)
    217193{
     
    227203        return;
    228204
    229     // FIXME: Be smarter about this.
    230     beginPath();
    231     addPath(path);
    232 
    233     m_data->clipPath(*(m_data->currentPath()), PainterOpenVG::IntersectClip, clipRule);
     205    m_data->clipPath(path, PainterOpenVG::IntersectClip, clipRule);
    234206}
    235207
  • trunk/WebCore/platform/graphics/openvg/PainterOpenVG.cpp

    r59673 r73184  
    400400    : m_state(0)
    401401    , m_surface(0)
    402     , m_currentPath(0)
    403402{
    404403}
     
    407406    : m_state(0)
    408407    , m_surface(0)
    409     , m_currentPath(0)
    410408{
    411409    ASSERT(surface);
     
    416414{
    417415    end();
    418     delete m_currentPath;
    419416}
    420417
     
    718715}
    719716
    720 void PainterOpenVG::beginPath()
    721 {
    722     delete m_currentPath;
    723     m_currentPath = new Path();
    724 }
    725 
    726 void PainterOpenVG::addPath(const Path& path)
    727 {
    728     m_currentPath->platformPath()->makeCompatibleContextCurrent();
    729 
    730     vgAppendPath(m_currentPath->platformPath()->vgPath(), path.platformPath()->vgPath());
    731     ASSERT_VG_NO_ERROR();
    732 }
    733 
    734 Path* PainterOpenVG::currentPath() const
    735 {
    736     return m_currentPath;
    737 }
    738 
    739 void PainterOpenVG::drawPath(VGbitfield specifiedPaintModes, WindRule fillRule)
     717void PainterOpenVG::drawPath(const Path& path, VGbitfield specifiedPaintModes, WindRule fillRule)
    740718{
    741719    ASSERT(m_state);
     
    755733
    756734    vgSeti(VG_FILL_RULE, toVGFillRule(fillRule));
    757     vgDrawPath(m_currentPath->platformPath()->vgPath(), paintModes);
     735    vgDrawPath(path.platformPath()->vgPath(), paintModes);
    758736    ASSERT_VG_NO_ERROR();
    759737}
  • trunk/WebCore/platform/graphics/openvg/PainterOpenVG.h

    r59619 r73184  
    112112    void translate(float dx, float dy);
    113113
    114     void beginPath();
    115     void addPath(const Path&);
    116     Path* currentPath() const;
    117     void drawPath(VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH), WindRule fillRule = RULE_NONZERO);
     114    void drawPath(const Path&, VGbitfield paintModes = (VG_STROKE_PATH | VG_FILL_PATH), WindRule fillRule = RULE_NONZERO);
    118115
    119116    void intersectClipRect(const FloatRect&);
     
    138135    PlatformPainterState* m_state;
    139136    SurfaceOpenVG* m_surface;
    140     Path* m_currentPath;
    141137};
    142138
Note: See TracChangeset for help on using the changeset viewer.