Changeset 112475 in webkit


Ignore:
Timestamp:
Mar 28, 2012 4:57:16 PM (12 years ago)
Author:
eae@chromium.org
Message:

Change FilterOperations::getOutsets to use integers
https://bugs.webkit.org/show_bug.cgi?id=82535

Reviewed by Eric Seidel.

FilterOperations::getOutsets calculates the outsets using integers and
the values are guranteed to be set to full-pixel values. By changing the
function signature we communicate this fact better and avoid unnecessary
type conversions in some cases.

No new tests.

  • platform/graphics/filters/FilterOperations.cpp:

(WebCore::FilterOperations::getOutsets):

  • platform/graphics/filters/FilterOperations.h:

(FilterOperations):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::computeRectForRepaint):
(WebCore::RenderBox::addVisualEffectOverflow):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::computeRectForRepaint):

  • rendering/style/RenderStyle.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112474 r112475  
     12012-03-28  Emil A Eklund  <eae@chromium.org>
     2
     3        Change FilterOperations::getOutsets to use integers
     4        https://bugs.webkit.org/show_bug.cgi?id=82535
     5
     6        Reviewed by Eric Seidel.
     7
     8        FilterOperations::getOutsets calculates the outsets using integers and
     9        the values are guranteed to be set to full-pixel values. By changing the
     10        function signature we communicate this fact better and avoid unnecessary
     11        type conversions in some cases.
     12
     13        No new tests.
     14
     15        * platform/graphics/filters/FilterOperations.cpp:
     16        (WebCore::FilterOperations::getOutsets):
     17        * platform/graphics/filters/FilterOperations.h:
     18        (FilterOperations):
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::computeRectForRepaint):
     21        (WebCore::RenderBox::addVisualEffectOverflow):
     22        * rendering/RenderInline.cpp:
     23        (WebCore::RenderInline::computeRectForRepaint):
     24        * rendering/style/RenderStyle.h:
     25
    1262012-03-28  Nate Chapin  <japhet@chromium.org>
    227
  • trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp

    r111126 r112475  
    9898}
    9999
    100 void FilterOperations::getOutsets(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const
     100void FilterOperations::getOutsets(int& top, int& right, int& bottom, int& left) const
    101101{
    102102    top = 0;
  • trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h

    r108013 r112475  
    6565
    6666    bool hasOutsets() const;
    67     void getOutsets(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
     67    void getOutsets(int& top, int& right, int& bottom, int& left) const;
    6868
    6969    bool hasFilterThatAffectsOpacity() const;
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r112425 r112475  
    16461646#if ENABLE(CSS_FILTERS)
    16471647    if (styleToUse->hasFilterOutsets()) {
    1648         LayoutUnit topOutset;
    1649         LayoutUnit rightOutset;
    1650         LayoutUnit bottomOutset;
    1651         LayoutUnit leftOutset;
     1648        int topOutset;
     1649        int rightOutset;
     1650        int bottomOutset;
     1651        int leftOutset;
    16521652        styleToUse->filter().getOutsets(topOutset, rightOutset, bottomOutset, leftOutset);
    16531653        rect.move(-leftOutset, -topOutset);
     
    36843684    // Compute any filter outset overflow.
    36853685    if (style()->hasFilterOutsets()) {
    3686         LayoutUnit filterOutsetLeft;
    3687         LayoutUnit filterOutsetRight;
    3688         LayoutUnit filterOutsetTop;
    3689         LayoutUnit filterOutsetBottom;
     3686        int filterOutsetLeft;
     3687        int filterOutsetRight;
     3688        int filterOutsetTop;
     3689        int filterOutsetBottom;
    36903690        style()->getFilterOutsets(filterOutsetTop, filterOutsetRight, filterOutsetBottom, filterOutsetLeft);
    36913691       
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r112301 r112475  
    11151115#if ENABLE(CSS_FILTERS)
    11161116    if (style()->hasFilterOutsets()) {
    1117         LayoutUnit topOutset;
    1118         LayoutUnit rightOutset;
    1119         LayoutUnit bottomOutset;
    1120         LayoutUnit leftOutset;
     1117        int topOutset;
     1118        int rightOutset;
     1119        int bottomOutset;
     1120        int leftOutset;
    11211121        style()->filter().getOutsets(topOutset, rightOutset, bottomOutset, leftOutset);
    11221122        rect.move(-leftOutset, -topOutset);
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r112301 r112475  
    466466
    467467#if ENABLE(CSS_FILTERS)
    468     void getFilterOutsets(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const
     468    void getFilterOutsets(int& top, int& right, int& bottom, int& left) const
    469469    {
    470470        if (hasFilter())
Note: See TracChangeset for help on using the changeset viewer.