Changeset 139138 in webkit


Ignore:
Timestamp:
Jan 8, 2013 5:36:28 PM (11 years ago)
Author:
fmalita@chromium.org
Message:

Remove unused GraphicsContext::addInnerRoundedRectClip()
https://bugs.webkit.org/show_bug.cgi?id=106376

Reviewed by Andreas Kling.

Since there don't seem to be any users left for it, remove addInnerRoundedRectClip().

No new tests: no functional changes.

  • platform/graphics/GraphicsContext.h:

(GraphicsContext):

  • platform/graphics/cairo/GraphicsContextCairo.cpp:
  • platform/graphics/cg/GraphicsContextCG.cpp:
  • platform/graphics/openvg/GraphicsContextOpenVG.cpp:
  • platform/graphics/qt/GraphicsContextQt.cpp:
  • platform/graphics/skia/GraphicsContextSkia.cpp:

(WebCore):

  • platform/graphics/wince/GraphicsContextWinCE.cpp:
  • platform/graphics/wx/GraphicsContextWx.cpp:
Location:
trunk/Source/WebCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139137 r139138  
     12013-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
    1232013-01-08  Justin Novosad  <junov@google.com>
    224
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r137048 r139138  
    345345        void clip(const FloatRect&);
    346346        void addRoundedRectClip(const RoundedRect&);
    347         void addInnerRoundedRectClip(const IntRect&, int thickness);
    348347        void clipOut(const IntRect&);
    349348        void clipOutRoundedRect(const RoundedRect&);
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r137011 r139138  
    845845}
    846846
    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 ellipse
    858     p.addEllipse(r);
    859     // Add inner ellipse
    860     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 
    870847void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
    871848{
  • trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp

    r138334 r139138  
    10981098}
    10991099
    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 ellipse
    1109     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 
    11171100void GraphicsContext::beginPlatformTransparencyLayer(float opacity)
    11181101{
  • trunk/Source/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp

    r123912 r139138  
    445445}
    446446
    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 
    460447void GraphicsContext::concatCTM(const AffineTransform& transformation)
    461448{
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r137011 r139138  
    13351335}
    13361336
    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 ellipse
    1347     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 
    13631337void GraphicsContext::concatCTM(const AffineTransform& transform)
    13641338{
  • trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

    r137011 r139138  
    276276// Graphics primitives ---------------------------------------------------------
    277277
    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 r
    287     if (2 * thickness < rect.width() && 2 * thickness < rect.height()) {
    288         // Adding one to the thickness doesn't make the border too thick as
    289         // it's painted over afterwards. But without this adjustment the
    290         // 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 
    297278void GraphicsContext::clearPlatformShadow()
    298279{
  • trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp

    r137048 r139138  
    10601060{
    10611061    notImplemented();
    1062 }
    1063 
    1064 void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness)
    1065 {
    1066     // We can only clip rectangles on WINCE
    1067     clip(rect);
    10681062}
    10691063
  • trunk/Source/WebCore/platform/graphics/wx/GraphicsContextWx.cpp

    r132076 r139138  
    744744}
    745745
    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 
    760746#if OS(WINDOWS)
    761747HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap)
Note: See TracChangeset for help on using the changeset viewer.