Changeset 139138 in webkit
- Timestamp:
- Jan 8, 2013 5:36:28 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139137 r139138 1 2013-01-08 Florin Malita <fmalita@chromium.org> 2 3 Remove unused GraphicsContext::addInnerRoundedRectClip() 4 https://bugs.webkit.org/show_bug.cgi?id=106376 5 6 Reviewed by Andreas Kling. 7 8 Since there don't seem to be any users left for it, remove addInnerRoundedRectClip(). 9 10 No new tests: no functional changes. 11 12 * platform/graphics/GraphicsContext.h: 13 (GraphicsContext): 14 * platform/graphics/cairo/GraphicsContextCairo.cpp: 15 * platform/graphics/cg/GraphicsContextCG.cpp: 16 * platform/graphics/openvg/GraphicsContextOpenVG.cpp: 17 * platform/graphics/qt/GraphicsContextQt.cpp: 18 * platform/graphics/skia/GraphicsContextSkia.cpp: 19 (WebCore): 20 * platform/graphics/wince/GraphicsContextWinCE.cpp: 21 * platform/graphics/wx/GraphicsContextWx.cpp: 22 1 23 2013-01-08 Justin Novosad <junov@google.com> 2 24 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r137048 r139138 345 345 void clip(const FloatRect&); 346 346 void addRoundedRectClip(const RoundedRect&); 347 void addInnerRoundedRectClip(const IntRect&, int thickness);348 347 void clipOut(const IntRect&); 349 348 void clipOutRoundedRect(const RoundedRect&); -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r137011 r139138 845 845 } 846 846 847 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)848 {849 if (paintingDisabled())850 return;851 852 cairo_t* cr = platformContext()->cr();853 clip(rect);854 855 Path p;856 FloatRect r(rect);857 // Add outer ellipse858 p.addEllipse(r);859 // Add inner ellipse860 r.inflate(-thickness);861 p.addEllipse(r);862 appendWebCorePathToCairoContext(cr, p);863 864 cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);865 cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);866 cairo_clip(cr);867 cairo_set_fill_rule(cr, savedFillRule);868 }869 870 847 void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace) 871 848 { -
trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
r138334 r139138 1098 1098 } 1099 1099 1100 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)1101 {1102 if (paintingDisabled())1103 return;1104 1105 clip(rect);1106 CGContextRef context = platformContext();1107 1108 // Add outer ellipse1109 CGContextAddEllipseInRect(context, CGRectMake(rect.x(), rect.y(), rect.width(), rect.height()));1110 // Add inner ellipse.1111 CGContextAddEllipseInRect(context, CGRectMake(rect.x() + thickness, rect.y() + thickness,1112 rect.width() - (thickness * 2), rect.height() - (thickness * 2)));1113 1114 CGContextEOClip(context);1115 }1116 1117 1100 void GraphicsContext::beginPlatformTransparencyLayer(float opacity) 1118 1101 { -
trunk/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
r123912 r139138 445 445 } 446 446 447 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)448 {449 if (paintingDisabled())450 return;451 452 Path path;453 path.addEllipse(rect);454 path.addEllipse(FloatRect(rect.x() + thickness, rect.y() + thickness,455 rect.width() - (thickness * 2), rect.height() - (thickness * 2)));456 457 m_data->clipPath(path, PainterOpenVG::IntersectClip, m_state.fillRule);458 }459 460 447 void GraphicsContext::concatCTM(const AffineTransform& transformation) 461 448 { -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r137011 r139138 1335 1335 } 1336 1336 1337 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect,1338 int thickness)1339 {1340 if (paintingDisabled())1341 return;1342 1343 clip(rect);1344 QPainterPath path;1345 1346 // Add outer ellipse1347 path.addEllipse(QRectF(rect.x(), rect.y(), rect.width(), rect.height()));1348 1349 // Add inner ellipse.1350 path.addEllipse(QRectF(rect.x() + thickness, rect.y() + thickness,1351 rect.width() - (thickness * 2), rect.height() - (thickness * 2)));1352 1353 path.setFillRule(Qt::OddEvenFill);1354 1355 QPainter* p = m_data->p();1356 1357 const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);1358 p->setRenderHint(QPainter::Antialiasing, true);1359 p->setClipPath(path, Qt::IntersectClip);1360 p->setRenderHint(QPainter::Antialiasing, antiAlias);1361 }1362 1363 1337 void GraphicsContext::concatCTM(const AffineTransform& transform) 1364 1338 { -
trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
r137011 r139138 276 276 // Graphics primitives --------------------------------------------------------- 277 277 278 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)279 {280 if (paintingDisabled())281 return;282 283 SkRect r(rect);284 SkPath path;285 path.addOval(r, SkPath::kCW_Direction);286 // only perform the inset if we won't invert r287 if (2 * thickness < rect.width() && 2 * thickness < rect.height()) {288 // Adding one to the thickness doesn't make the border too thick as289 // it's painted over afterwards. But without this adjustment the290 // border appears a little anemic after anti-aliasing.291 r.inset(SkIntToScalar(thickness + 1), SkIntToScalar(thickness + 1));292 path.addOval(r, SkPath::kCCW_Direction);293 }294 platformContext()->clipPath(path, PlatformContextSkia::AntiAliased);295 }296 297 278 void GraphicsContext::clearPlatformShadow() 298 279 { -
trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
r137048 r139138 1060 1060 { 1061 1061 notImplemented(); 1062 }1063 1064 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)1065 {1066 // We can only clip rectangles on WINCE1067 clip(rect);1068 1062 } 1069 1063 -
trunk/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
r132076 r139138 744 744 } 745 745 746 void GraphicsContext::addInnerRoundedRectClip(const IntRect& r, int thickness)747 {748 if (paintingDisabled())749 return;750 751 FloatRect rect(r);752 clip(rect);753 Path path;754 path.addEllipse(rect);755 rect.inflate(-thickness);756 path.addEllipse(rect);757 clipPath(path, RULE_EVENODD);758 }759 760 746 #if OS(WINDOWS) 761 747 HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
Note: See TracChangeset
for help on using the changeset viewer.