Changeset 114520 in webkit


Ignore:
Timestamp:
Apr 18, 2012 10:05:11 AM (12 years ago)
Author:
leviw@chromium.org
Message:

Convert ShadowData and DropShadowFilterOperation to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=84098

Reviewed by Eric Seidel.

Shadows do not flow with the page, so sub-pixel layout doesn't actually offer any benefit that
couldn't have been attained before that conversion. With that in mind, this patch reverts
drop shadow offsets to integers, but also cleans up the code by switching the x/y location pair
to be an IntPoint.

No new tests. No change in behavior.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::valueForFilter):

  • css/CSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::collectMatchingRulesForList):

  • css/SVGCSSStyleSelector.cpp:

(WebCore::CSSStyleSelector::applySVGProperty):

  • page/animation/AnimationBase.cpp:

(WebCore::blendFunc):
(WebCore::shadowForBlending):

  • platform/animation/AnimationUtilities.h:

(WebCore::blend): New blend function that operates on IntPoints.
(WebCore):

  • platform/chromium/support/WebFilterOperations.cpp:

(WebKit::WebDropShadowFilterOperation):

  • platform/graphics/filters/FilterOperation.cpp:

(WebCore::DropShadowFilterOperation::blend):

  • platform/graphics/filters/FilterOperation.h:

(WebCore::DropShadowFilterOperation::clone):
(WebCore::DropShadowFilterOperation::x):
(WebCore::DropShadowFilterOperation::y):
(WebCore::DropShadowFilterOperation::location): Preserved the comment about lengths.
(WebCore::DropShadowFilterOperation::operator==):
(WebCore::DropShadowFilterOperation::DropShadowFilterOperation):
(DropShadowFilterOperation):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::areaCastingShadowInHole): Reverted to integers since this operates on the IntRect from
a RoundedRect.
(WebCore::RenderBoxModelObject::paintBoxShadow): Reduced the complexity and unnecessary conversion
between LayoutUnits and integers by using all integers after we calculate the pixel-snapped
RoundedRect that we use for painting.

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::getShadowExtent):
(WebCore::RenderStyle::getShadowHorizontalExtent):
(WebCore::RenderStyle::getShadowVerticalExtent):

  • rendering/style/ShadowData.cpp:

(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::operator==):
(WebCore::calculateShadowExtent):
(WebCore::ShadowData::adjustRectForShadow):

  • rendering/style/ShadowData.h:

(WebCore::ShadowData::ShadowData):
(WebCore::ShadowData::x):
(WebCore::ShadowData::y):
(WebCore::ShadowData::location):
(ShadowData):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r114519 r114520  
     12012-04-18  Levi Weintraub  <leviw@chromium.org>
     2
     3        Convert ShadowData and DropShadowFilterOperation to use IntPoint
     4        https://bugs.webkit.org/show_bug.cgi?id=84098
     5
     6        Reviewed by Eric Seidel.
     7
     8        Shadows do not flow with the page, so sub-pixel layout doesn't actually offer any benefit that
     9        couldn't have been attained before that conversion. With that in mind, this patch reverts
     10        drop shadow offsets to integers, but also cleans up the code by switching the x/y location pair
     11        to be an IntPoint.
     12
     13        No new tests. No change in behavior.
     14
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::CSSComputedStyleDeclaration::valueForFilter):
     17        * css/CSSStyleSelector.cpp:
     18        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
     19        * css/SVGCSSStyleSelector.cpp:
     20        (WebCore::CSSStyleSelector::applySVGProperty):
     21        * page/animation/AnimationBase.cpp:
     22        (WebCore::blendFunc):
     23        (WebCore::shadowForBlending):
     24        * platform/animation/AnimationUtilities.h:
     25        (WebCore::blend): New blend function that operates on IntPoints.
     26        (WebCore):
     27        * platform/chromium/support/WebFilterOperations.cpp:
     28        (WebKit::WebDropShadowFilterOperation):
     29        * platform/graphics/filters/FilterOperation.cpp:
     30        (WebCore::DropShadowFilterOperation::blend):
     31        * platform/graphics/filters/FilterOperation.h:
     32        (WebCore::DropShadowFilterOperation::clone):
     33        (WebCore::DropShadowFilterOperation::x):
     34        (WebCore::DropShadowFilterOperation::y):
     35        (WebCore::DropShadowFilterOperation::location): Preserved the comment about lengths.
     36        (WebCore::DropShadowFilterOperation::operator==):
     37        (WebCore::DropShadowFilterOperation::DropShadowFilterOperation):
     38        (DropShadowFilterOperation):
     39        * rendering/RenderBoxModelObject.cpp:
     40        (WebCore::areaCastingShadowInHole): Reverted to integers since this operates on the IntRect from
     41        a RoundedRect.
     42        (WebCore::RenderBoxModelObject::paintBoxShadow): Reduced the complexity and unnecessary conversion
     43        between LayoutUnits and integers by using all integers after we calculate the pixel-snapped
     44        RoundedRect that we use for painting.
     45        * rendering/style/RenderStyle.cpp:
     46        (WebCore::RenderStyle::getShadowExtent):
     47        (WebCore::RenderStyle::getShadowHorizontalExtent):
     48        (WebCore::RenderStyle::getShadowVerticalExtent):
     49        * rendering/style/ShadowData.cpp:
     50        (WebCore::ShadowData::ShadowData):
     51        (WebCore::ShadowData::operator==):
     52        (WebCore::calculateShadowExtent):
     53        (WebCore::ShadowData::adjustRectForShadow):
     54        * rendering/style/ShadowData.h:
     55        (WebCore::ShadowData::ShadowData):
     56        (WebCore::ShadowData::x):
     57        (WebCore::ShadowData::y):
     58        (WebCore::ShadowData::location):
     59        (ShadowData):
     60
    1612012-04-17  Kentaro Hara  <haraken@chromium.org>
    262
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r114470 r114520  
    826826            filterValue = WebKitCSSFilterValue::create(WebKitCSSFilterValue::DropShadowFilterOperation);
    827827            // We want our computed style to look like that of a text shadow (has neither spread nor inset style).
    828             ShadowData shadowData = ShadowData(dropShadowOperation->x(), dropShadowOperation->y(), dropShadowOperation->stdDeviation(), 0, Normal, false, dropShadowOperation->color());
     828            ShadowData shadowData = ShadowData(dropShadowOperation->location(), dropShadowOperation->stdDeviation(), 0, Normal, false, dropShadowOperation->color());
    829829            filterValue->append(valueForShadow(&shadowData, CSSPropertyTextShadow, style));
    830830            break;
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r113922 r114520  
    34513451                color = m_style->color();
    34523452
    3453             OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(x, y, blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent));
     3453            OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(IntPoint(x, y), blur, spread, shadowStyle, id == CSSPropertyWebkitBoxShadow, color.isValid() ? color : Color::transparent));
    34543454            if (id == CSSPropertyTextShadow)
    34553455                m_style->setTextShadow(shadowData.release(), i.index()); // add to the list if this is not the first entry
     
    57155715
    57165716            ShadowValue* item = static_cast<ShadowValue*>(cssValue);
    5717             int x = item->x->computeLength<int>(style, rootStyle, zoomFactor);
    5718             int y = item->y->computeLength<int>(style, rootStyle, zoomFactor);
     5717            IntPoint location(item->x->computeLength<int>(style, rootStyle, zoomFactor),
     5718                              item->y->computeLength<int>(style, rootStyle, zoomFactor));
    57195719            int blur = item->blur ? item->blur->computeLength<int>(style, rootStyle, zoomFactor) : 0;
    57205720            Color color;
     
    57225722                color = colorFromPrimitiveValue(item->color.get());
    57235723
    5724             operations.operations().append(DropShadowFilterOperation::create(x, y, blur, color.isValid() ? color : Color::transparent, operationType));
     5724            operations.operations().append(DropShadowFilterOperation::create(location, blur, color.isValid() ? color : Color::transparent, operationType));
    57255725            break;
    57265726        }
  • trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp

    r113031 r114520  
    572572                return;
    573573            ShadowValue* item = static_cast<ShadowValue*>(firstValue);
    574             int x = item->x->computeLength<int>(style(), m_rootElementStyle);
    575             int y = item->y->computeLength<int>(style(), m_rootElementStyle);
     574            IntPoint location(item->x->computeLength<int>(style(), m_rootElementStyle),
     575                              item->y->computeLength<int>(style(), m_rootElementStyle));
    576576            int blur = item->blur ? item->blur->computeLength<int>(style(), m_rootElementStyle) : 0;
    577577            Color color;
     
    583583            ASSERT(!item->style);
    584584
    585             OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(x, y, blur, 0, Normal, false, color.isValid() ? color : Color::transparent));
     585            OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(location, blur, 0, Normal, false, color.isValid() ? color : Color::transparent));
    586586            svgstyle->setShadow(shadowData.release());
    587587            return;
  • trunk/Source/WebCore/page/animation/AnimationBase.cpp

    r114437 r114520  
    136136        return adoptPtr(new ShadowData(*to));
    137137
    138     return adoptPtr(new ShadowData(blend(from->x(), to->x(), progress),
    139                                    blend(from->y(), to->y(), progress),
     138    return adoptPtr(new ShadowData(blend(from->location(), to->location(), progress),
    140139                                   blend(from->blur(), to->blur(), progress),
    141140                                   blend(from->spread(), to->spread(), progress),
     
    495494static inline const ShadowData* shadowForBlending(const ShadowData* srcShadow, const ShadowData* otherShadow)
    496495{
    497     DEFINE_STATIC_LOCAL(ShadowData, defaultShadowData, (0, 0, 0, 0, Normal, false, Color::transparent));
    498     DEFINE_STATIC_LOCAL(ShadowData, defaultInsetShadowData, (0, 0, 0, 0, Inset, false, Color::transparent));
    499 
    500     DEFINE_STATIC_LOCAL(ShadowData, defaultWebKitBoxShadowData, (0, 0, 0, 0, Normal, true, Color::transparent));
    501     DEFINE_STATIC_LOCAL(ShadowData, defaultInsetWebKitBoxShadowData, (0, 0, 0, 0, Inset, true, Color::transparent));
     496    DEFINE_STATIC_LOCAL(ShadowData, defaultShadowData, (IntPoint(), 0, 0, Normal, false, Color::transparent));
     497    DEFINE_STATIC_LOCAL(ShadowData, defaultInsetShadowData, (IntPoint(), 0, 0, Inset, false, Color::transparent));
     498
     499    DEFINE_STATIC_LOCAL(ShadowData, defaultWebKitBoxShadowData, (IntPoint(), 0, 0, Normal, true, Color::transparent));
     500    DEFINE_STATIC_LOCAL(ShadowData, defaultInsetWebKitBoxShadowData, (IntPoint(), 0, 0, Inset, true, Color::transparent));
    502501
    503502    if (srcShadow)
  • trunk/Source/WebCore/platform/animation/AnimationUtilities.h

    r111362 r114520  
    2828
    2929#include "FractionalLayoutUnit.h"
     30#include "IntPoint.h"
    3031#include <wtf/MathExtras.h>
    3132
     
    5758}
    5859
     60inline IntPoint blend(const IntPoint& from, const IntPoint& to, double progress)
     61{
     62    return IntPoint(blend(from.x(), to.x(), progress),
     63                    blend(from.y(), to.y(), progress));
     64}
     65
    5966} // namespace WebCore
    6067
  • trunk/Source/WebCore/platform/chromium/support/WebFilterOperation.cpp

    r114343 r114520  
    5151PassRefPtr<WebCore::FilterOperation> WebDropShadowFilterOperation::toFilterOperation() const
    5252{
    53     return DropShadowFilterOperation::create(x, y, stdDeviation, color, FilterOperation::DROP_SHADOW);
     53    return DropShadowFilterOperation::create(IntPoint(x, y), stdDeviation, color, FilterOperation::DROP_SHADOW);
    5454}
    5555
  • trunk/Source/WebCore/platform/graphics/filters/FilterOperation.cpp

    r103586 r114520  
    134134    if (blendToPassthrough)
    135135        return DropShadowFilterOperation::create(
    136             WebCore::blend(m_x, 0, progress),
    137             WebCore::blend(m_y, 0, progress),
     136            WebCore::blend(m_location, IntPoint(), progress),
    138137            WebCore::blend(m_stdDeviation, 0, progress),
    139138            WebCore::blend(m_color, Color(Color::transparent), progress),
     
    141140
    142141    const DropShadowFilterOperation* fromOp = static_cast<const DropShadowFilterOperation*>(from);
    143     int fromX = fromOp ? fromOp->x() : 0;
    144     int fromY = fromOp ? fromOp->y() : 0;
     142    IntPoint fromLocation = fromOp ? fromOp->location() : IntPoint();
    145143    int fromStdDeviation = fromOp ? fromOp->stdDeviation() : 0;
    146144    Color fromColor = fromOp ? fromOp->color() : Color(Color::transparent);
    147145   
    148146    return DropShadowFilterOperation::create(
    149         WebCore::blend(fromX, m_x, progress),
    150         WebCore::blend(fromY, m_y, progress),
     147        WebCore::blend(fromLocation, m_location, progress),
    151148        WebCore::blend(fromStdDeviation, m_stdDeviation, progress),
    152149        WebCore::blend(fromColor, m_color, progress), m_type);
  • trunk/Source/WebCore/platform/graphics/filters/FilterOperation.h

    r112187 r114520  
    339339class DropShadowFilterOperation : public FilterOperation {
    340340public:
    341     static PassRefPtr<DropShadowFilterOperation> create(int x, int y, int stdDeviation, Color color, OperationType type)
    342     {
    343         return adoptRef(new DropShadowFilterOperation(x, y, stdDeviation, color, type));
    344     }
    345 
    346     virtual PassRefPtr<FilterOperation> clone() const
    347     {
    348         return adoptRef(new DropShadowFilterOperation(m_x, m_y, m_stdDeviation, m_color, m_type));
    349     }
    350 
    351     int x() const { return m_x; }
    352     int y() const { return m_y; }
     341    static PassRefPtr<DropShadowFilterOperation> create(const IntPoint& location, int stdDeviation, Color color, OperationType type)
     342    {
     343        return adoptRef(new DropShadowFilterOperation(location, stdDeviation, color, type));
     344    }
     345
     346    virtual PassRefPtr<FilterOperation> clone() const
     347    {
     348        return adoptRef(new DropShadowFilterOperation(m_location, m_stdDeviation, m_color, m_type));
     349    }
     350
     351    int x() const { return m_location.x(); }
     352    int y() const { return m_location.y(); }
     353    IntPoint location() const { return m_location; }
    353354    int stdDeviation() const { return m_stdDeviation; }
    354355    Color color() const { return m_color; }
     
    366367            return false;
    367368        const DropShadowFilterOperation* other = static_cast<const DropShadowFilterOperation*>(&o);
    368         return m_x == other->m_x && m_y == other->m_y && m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
    369     }
    370 
    371     DropShadowFilterOperation(int x, int y, int stdDeviation, Color color, OperationType type)
    372         : FilterOperation(type)
    373         , m_x(x)
    374         , m_y(y)
     369        return m_location == other->m_location && m_stdDeviation == other->m_stdDeviation && m_color == other->m_color;
     370    }
     371
     372    DropShadowFilterOperation(const IntPoint& location, int stdDeviation, Color color, OperationType type)
     373        : FilterOperation(type)
     374        , m_location(location)
    375375        , m_stdDeviation(stdDeviation)
    376376        , m_color(color)
     
    378378    }
    379379
    380     int m_x; // FIXME: x and y should be Lengths?
    381     int m_y;
     380    IntPoint m_location; // FIXME: should location be in Lengths?
    382381    int m_stdDeviation;
    383382    Color m_color;
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r114470 r114520  
    28152815}
    28162816
    2817 static inline LayoutRect areaCastingShadowInHole(const LayoutRect& holeRect, int shadowBlur, int shadowSpread, const LayoutSize& shadowOffset)
    2818 {
    2819     LayoutRect bounds(holeRect);
     2817static inline IntRect areaCastingShadowInHole(const IntRect& holeRect, int shadowBlur, int shadowSpread, const IntSize& shadowOffset)
     2818{
     2819    IntRect bounds(holeRect);
    28202820   
    28212821    bounds.inflate(shadowBlur);
     
    28242824        bounds.inflate(-shadowSpread);
    28252825   
    2826     LayoutRect offsetBounds = bounds;
     2826    IntRect offsetBounds = bounds;
    28272827    offsetBounds.move(-shadowOffset);
    28282828    return unionRect(bounds, offsetBounds);
     
    28472847            continue;
    28482848
    2849         LayoutSize shadowOffset(shadow->x(), shadow->y());
    2850         LayoutUnit shadowBlur = shadow->blur();
    2851         LayoutUnit shadowSpread = shadow->spread();
     2849        IntSize shadowOffset(shadow->x(), shadow->y());
     2850        int shadowBlur = shadow->blur();
     2851        int shadowSpread = shadow->spread();
    28522852       
    28532853        if (shadowOffset.isZero() && !shadowBlur && !shadowSpread)
     
    28622862                continue;
    28632863
    2864             LayoutRect shadowRect(border.rect());
     2864            IntRect shadowRect(border.rect());
    28652865            shadowRect.inflate(shadowBlur + shadowSpread);
    28662866            shadowRect.move(shadowOffset);
     
    28712871            // Move the fill just outside the clip, adding 1 pixel separation so that the fill does not
    28722872            // bleed in (due to antialiasing) if the context is transformed.
    2873             LayoutSize extraOffset(paintRect.width() + max<LayoutUnit>(0, shadowOffset.width()) + shadowBlur + 2 * shadowSpread + 1, 0);
     2873            IntSize extraOffset(paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur + 2 * shadowSpread + 1, 0);
    28742874            shadowOffset -= extraOffset;
    28752875            fillRect.move(extraOffset);
     
    29022902                }
    29032903            } else {
    2904                 LayoutRect rectToClipOut = border.rect();
     2904                IntRect rectToClipOut = border.rect();
    29052905
    29062906                // If the box is opaque, it is unnecessary to clip it out. However, doing so saves time
     
    29172917
    29182918                if (!rectToClipOut.isEmpty())
    2919                     context->clipOut(pixelSnappedIntRect(rectToClipOut));
     2919                    context->clipOut(rectToClipOut);
    29202920                context->fillRect(fillRect.rect(), Color::black, s->colorSpace());
    29212921            }
    29222922        } else {
    29232923            // Inset shadow.
    2924             LayoutRect holeRect(border.rect());
     2924            IntRect holeRect(border.rect());
    29252925            holeRect.inflate(-shadowSpread);
    29262926
     
    29352935            if (!includeLogicalLeftEdge) {
    29362936                if (isHorizontal) {
    2937                     holeRect.move(-max<LayoutUnit>(shadowOffset.width(), 0) - shadowBlur, 0);
    2938                     holeRect.setWidth(holeRect.width() + max<LayoutUnit>(shadowOffset.width(), 0) + shadowBlur);
     2937                    holeRect.move(-max(shadowOffset.width(), 0) - shadowBlur, 0);
     2938                    holeRect.setWidth(holeRect.width() + max(shadowOffset.width(), 0) + shadowBlur);
    29392939                } else {
    2940                     holeRect.move(0, -max<LayoutUnit>(shadowOffset.height(), 0) - shadowBlur);
    2941                     holeRect.setHeight(holeRect.height() + max<LayoutUnit>(shadowOffset.height(), 0) + shadowBlur);
     2940                    holeRect.move(0, -max(shadowOffset.height(), 0) - shadowBlur);
     2941                    holeRect.setHeight(holeRect.height() + max(shadowOffset.height(), 0) + shadowBlur);
    29422942                }
    29432943            }
     
    29512951            Color fillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), 255);
    29522952
    2953             LayoutRect outerRect = areaCastingShadowInHole(border.rect(), shadowBlur, shadowSpread, shadowOffset);
    2954             RoundedRect roundedHole(pixelSnappedIntRect(holeRect), border.radii());
     2953            IntRect outerRect = areaCastingShadowInHole(border.rect(), shadowBlur, shadowSpread, shadowOffset);
     2954            RoundedRect roundedHole(holeRect, border.radii());
    29552955
    29562956            GraphicsContextStateSaver stateSaver(*context);
     
    29632963                context->clip(border.rect());
    29642964
    2965             LayoutSize extraOffset(2 * paintRect.width() + max<LayoutUnit>(0, shadowOffset.width()) + shadowBlur - 2 * shadowSpread + 1, 0);
     2965            IntSize extraOffset(2 * paintRect.pixelSnappedWidth() + max(0, shadowOffset.width()) + shadowBlur - 2 * shadowSpread + 1, 0);
    29662966            context->translate(extraOffset.width(), extraOffset.height());
    29672967            shadowOffset -= extraOffset;
     
    29722972                context->setShadow(shadowOffset, shadowBlur, shadowColor, s->colorSpace());
    29732973
    2974             context->fillRectWithRoundedHole(pixelSnappedIntRect(outerRect), roundedHole, fillColor, s->colorSpace());
     2974            context->fillRectWithRoundedHole(outerRect, roundedHole, fillColor, s->colorSpace());
    29752975        }
    29762976    }
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r114470 r114520  
    11701170        int blurAndSpread = shadow->blur() + shadow->spread();
    11711171
    1172         top = min(top, shadow->y() - blurAndSpread);
    1173         right = max(right, shadow->x() + blurAndSpread);
    1174         bottom = max(bottom, shadow->y() + blurAndSpread);
    1175         left = min(left, shadow->x() - blurAndSpread);
     1172        top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
     1173        right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
     1174        bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
     1175        left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
    11761176    }
    11771177}
     
    11871187        int blurAndSpread = shadow->blur() + shadow->spread();
    11881188
    1189         left = min(left, shadow->x() - blurAndSpread);
    1190         right = max(right, shadow->x() + blurAndSpread);
     1189        left = min<LayoutUnit>(left, shadow->x() - blurAndSpread);
     1190        right = max<LayoutUnit>(right, shadow->x() + blurAndSpread);
    11911191    }
    11921192}
     
    12021202        int blurAndSpread = shadow->blur() + shadow->spread();
    12031203
    1204         top = min(top, shadow->y() - blurAndSpread);
    1205         bottom = max(bottom, shadow->y() + blurAndSpread);
     1204        top = min<LayoutUnit>(top, shadow->y() - blurAndSpread);
     1205        bottom = max<LayoutUnit>(bottom, shadow->y() + blurAndSpread);
    12061206    }
    12071207}
  • trunk/Source/WebCore/rendering/style/ShadowData.cpp

    r113222 r114520  
    2828
    2929ShadowData::ShadowData(const ShadowData& o)
    30     : m_x(o.m_x)
    31     , m_y(o.m_y)
     30    : m_location(o.m_location)
    3231    , m_blur(o.m_blur)
    3332    , m_spread(o.m_spread)
     
    4544        return false;
    4645   
    47     return m_x == o.m_x
    48         && m_y == o.m_y
     46    return m_location == o.m_location
    4947        && m_blur == o.m_blur
    5048        && m_spread == o.m_spread
     
    5452}
    5553
    56 static inline void calculateShadowExtent(const ShadowData* shadow, int additionalOutlineSize, LayoutUnit& shadowLeft, LayoutUnit& shadowRight, LayoutUnit& shadowTop, LayoutUnit& shadowBottom)
     54static inline void calculateShadowExtent(const ShadowData* shadow, int additionalOutlineSize, int& shadowLeft, int& shadowRight, int& shadowTop, int& shadowBottom)
    5755{
    5856    do {
     
    7169void ShadowData::adjustRectForShadow(LayoutRect& rect, int additionalOutlineSize) const
    7270{
    73     LayoutUnit shadowLeft = 0;
    74     LayoutUnit shadowRight = 0;
    75     LayoutUnit shadowTop = 0;
    76     LayoutUnit shadowBottom = 0;
     71    int shadowLeft = 0;
     72    int shadowRight = 0;
     73    int shadowTop = 0;
     74    int shadowBottom = 0;
    7775    calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom);
    7876
     
    8482void ShadowData::adjustRectForShadow(FloatRect& rect, int additionalOutlineSize) const
    8583{
    86     LayoutUnit shadowLeft = 0;
    87     LayoutUnit shadowRight = 0;
    88     LayoutUnit shadowTop = 0;
    89     LayoutUnit shadowBottom = 0;
     84    int shadowLeft = 0;
     85    int shadowRight = 0;
     86    int shadowTop = 0;
     87    int shadowBottom = 0;
    9088    calculateShadowExtent(this, additionalOutlineSize, shadowLeft, shadowRight, shadowTop, shadowBottom);
    9189
  • trunk/Source/WebCore/rendering/style/ShadowData.h

    r113222 r114520  
    4141public:
    4242    ShadowData()
    43         : m_x(0)
    44         , m_y(0)
    45         , m_blur(0)
     43        : m_blur(0)
    4644        , m_spread(0)
    4745        , m_style(Normal)
     
    5048    }
    5149
    52     ShadowData(LayoutUnit x, LayoutUnit y, int blur, int spread, ShadowStyle style, bool isWebkitBoxShadow, const Color& color)
    53         : m_x(x)
    54         , m_y(y)
     50    ShadowData(const IntPoint& location, int blur, int spread, ShadowStyle style, bool isWebkitBoxShadow, const Color& color)
     51        : m_location(location)
    5552        , m_blur(blur)
    5653        , m_spread(spread)
     
    6966    }
    7067   
    71     LayoutUnit x() const { return m_x; }
    72     LayoutUnit y() const { return m_y; }
     68    int x() const { return m_location.x(); }
     69    int y() const { return m_location.y(); }
     70    IntPoint location() const { return m_location; }
    7371    int blur() const { return m_blur; }
    7472    int spread() const { return m_spread; }
     
    8482
    8583private:
    86     LayoutUnit m_x;
    87     LayoutUnit m_y;
     84    IntPoint m_location;
    8885    int m_blur;
    8986    int m_spread;
Note: See TracChangeset for help on using the changeset viewer.