Changeset 73184 in webkit
- Timestamp:
- Dec 2, 2010 12:41:30 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73183 r73184 1 2010-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 1 19 2010-12-02 Patrick Gansterer <paroga@webkit.org> 2 20 -
trunk/WebCore/platform/graphics/GraphicsContext.h
r73183 r73184 302 302 void setCompositeOperation(CompositeOperator); 303 303 304 #if PLATFORM(SKIA) || PLATFORM(OPENVG)304 #if PLATFORM(SKIA) 305 305 void beginPath(); 306 306 void addPath(const Path&); -
trunk/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
r72926 r73184 145 145 return; 146 146 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); 152 148 } 153 149 … … 157 153 return; 158 154 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); 164 156 } 165 157 … … 198 190 } 199 191 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 216 192 void GraphicsContext::clip(const FloatRect& rect) 217 193 { … … 227 203 return; 228 204 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); 234 206 } 235 207 -
trunk/WebCore/platform/graphics/openvg/PainterOpenVG.cpp
r59673 r73184 400 400 : m_state(0) 401 401 , m_surface(0) 402 , m_currentPath(0)403 402 { 404 403 } … … 407 406 : m_state(0) 408 407 , m_surface(0) 409 , m_currentPath(0)410 408 { 411 409 ASSERT(surface); … … 416 414 { 417 415 end(); 418 delete m_currentPath;419 416 } 420 417 … … 718 715 } 719 716 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) 717 void PainterOpenVG::drawPath(const Path& path, VGbitfield specifiedPaintModes, WindRule fillRule) 740 718 { 741 719 ASSERT(m_state); … … 755 733 756 734 vgSeti(VG_FILL_RULE, toVGFillRule(fillRule)); 757 vgDrawPath( m_currentPath->platformPath()->vgPath(), paintModes);735 vgDrawPath(path.platformPath()->vgPath(), paintModes); 758 736 ASSERT_VG_NO_ERROR(); 759 737 } -
trunk/WebCore/platform/graphics/openvg/PainterOpenVG.h
r59619 r73184 112 112 void translate(float dx, float dy); 113 113 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); 118 115 119 116 void intersectClipRect(const FloatRect&); … … 138 135 PlatformPainterState* m_state; 139 136 SurfaceOpenVG* m_surface; 140 Path* m_currentPath;141 137 }; 142 138
Note: See TracChangeset
for help on using the changeset viewer.