2011-01-18 MORITA Hajime <morrita@google.com>
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 01:10:58 +0000 (01:10 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Jan 2011 01:10:58 +0000 (01:10 +0000)
commit86a133fb49d5c6fb18bbd8ee25480bb311543b39
tree40240af0a9706d0023d1a032773bc350bd718158
parent33bcd39594771e12ca86146a9176da0ff0793d11
2011-01-18  MORITA Hajime  <morrita@google.com>

        Reviewed by Simon Fraser.

        Refactoring: Extract RoundedIntRect class
        https://bugs.webkit.org/show_bug.cgi?id=51664

        RoundedIntRect is a pair of rect and four IntSize objects which represent
        corner radii of the rectangle. IntSize is grouped into RoundedIntRect::Radii.
        Now RenderStyle::getRoundedBorderFor() and RenderStyle::getRoundedInnerBorderWithBorderWidths()
        return RoundedIntRect and GraphicsContext::addRoundedRectClip(), GraphicsContext::fillRoundedRect()
        and other functions accept RoundedIntRect as an argument.

        * Android.mk:
        * CMakeLists.txt:
        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::addRoundedRectClip):
        (WebCore::GraphicsContext::clipOutRoundedRect):
        (WebCore::GraphicsContext::fillRoundedRect):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/RoundedIntRect.cpp: Added.
        (WebCore::RoundedIntRect::Radii::isZero):
        (WebCore::RoundedIntRect::Radii::scale):
        (WebCore::RoundedIntRect::Radii::expand):
        (WebCore::RoundedIntRect::Radii::includeLogicalEdges):
        (WebCore::RoundedIntRect::Radii::excludeLogicalEdges):
        (WebCore::RoundedIntRect::RoundedIntRect):
        (WebCore::RoundedIntRect::includeLogicalEdges):
        (WebCore::RoundedIntRect::excludeLogicalEdges):
        * platform/graphics/RoundedIntRect.h: Added.
        (WebCore::RoundedIntRect::Radii::Radii):
        (WebCore::RoundedIntRect::Radii::setTopLeft):
        (WebCore::RoundedIntRect::Radii::setTopRight):
        (WebCore::RoundedIntRect::Radii::setBottomLeft):
        (WebCore::RoundedIntRect::Radii::setBottomRight):
        (WebCore::RoundedIntRect::Radii::topLeft):
        (WebCore::RoundedIntRect::Radii::topRight):
        (WebCore::RoundedIntRect::Radii::bottomLeft):
        (WebCore::RoundedIntRect::Radii::bottomRight):
        (WebCore::RoundedIntRect::Radii::expand):
        (WebCore::RoundedIntRect::Radii::shrink):
        (WebCore::RoundedIntRect::rect):
        (WebCore::RoundedIntRect::radii):
        (WebCore::RoundedIntRect::isRounded):
        (WebCore::RoundedIntRect::isEmpty):
        (WebCore::RoundedIntRect::setRect):
        (WebCore::RoundedIntRect::setRadii):
        (WebCore::RoundedIntRect::move):
        (WebCore::RoundedIntRect::inflate):
        (WebCore::RoundedIntRect::inflateWithRadii):
        (WebCore::RoundedIntRect::expandRadii):
        (WebCore::RoundedIntRect::shrinkRadii):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::pushContentsClip):
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        (WebCore::RenderBoxModelObject::paintBorder):
        (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
        (WebCore::RenderBoxModelObject::paintBoxShadow):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::drawBoxSideFromPath):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):
        * rendering/RenderThemeChromiumWin.cpp:
        (WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMenuListButtonGradients):
        (WebCore::RenderThemeMac::paintSliderTrack):
        * rendering/RenderThemeSafari.cpp:
        (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
        (WebCore::RenderThemeSafari::paintSliderTrack):
        * rendering/RenderThemeWinCE.cpp:
        (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):
        * rendering/style/BorderData.h:
        * rendering/style/RenderStyle.cpp:
        (WebCore::calcRadiiFor):
        (WebCore::calcConstraintScaleFor):
        (WebCore::RenderStyle::getRoundedBorderFor):
        (WebCore::RenderStyle::getRoundedInnerBorderWithBorderWidths):
        * rendering/style/RenderStyle.h:
        (WebCore::InheritedFlags::setBorderRadius):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebCore/Android.mk
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.am
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.pro
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/graphics/GraphicsContext.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/RoundedIntRect.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/RoundedIntRect.h [new file with mode: 0644]
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderBoxModelObject.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderReplaced.cpp
Source/WebCore/rendering/RenderThemeChromiumWin.cpp
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderThemeSafari.cpp
Source/WebCore/rendering/RenderThemeWinCE.cpp
Source/WebCore/rendering/RenderWidget.cpp
Source/WebCore/rendering/style/BorderData.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h