Changeset 87864 in webkit


Ignore:
Timestamp:
Jun 1, 2011 4:15:58 PM (13 years ago)
Author:
leviw@chromium.org
Message:

2011-06-01 Levi Weintraub <leviw@chromium.org>

Reviewed by Eric Seidel.

Switch paintOverflowControls to use IntPoint
https://bugs.webkit.org/show_bug.cgi?id=61884

Switching paintOverflowControls to use an IntPoint instead of a pair of ints.

No new tests since this is simple refactoring.

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::paint):
  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintOverflowControls): (WebCore::RenderLayer::paintLayer):
  • rendering/RenderLayer.h:
  • rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintIntoLayer):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87863 r87864  
     12011-06-01  Levi Weintraub  <leviw@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Switch paintOverflowControls to use IntPoint
     6        https://bugs.webkit.org/show_bug.cgi?id=61884
     7
     8        Switching paintOverflowControls to use an IntPoint instead of a pair of ints.
     9
     10        No new tests since this is simple refactoring.
     11
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::paint):
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::RenderLayer::paintOverflowControls):
     16        (WebCore::RenderLayer::paintLayer):
     17        * rendering/RenderLayer.h:
     18        * rendering/RenderLayerBacking.cpp:
     19        (WebCore::RenderLayerBacking::paintIntoLayer):
     20
    1212011-06-01  Abhishek Arya  <inferno@chromium.org>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r87753 r87864  
    22692269    // sit above the background/border.
    22702270    if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this))
    2271         layer()->paintOverflowControls(paintInfo.context, tx, ty, paintInfo.rect);
     2271        layer()->paintOverflowControls(paintInfo.context, IntPoint(tx, ty), paintInfo.rect);
    22722272}
    22732273
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r87845 r87864  
    22672267}
    22682268
    2269 void RenderLayer::paintOverflowControls(GraphicsContext* context, int tx, int ty, const IntRect& damageRect, bool paintingOverlayControls)
     2269void RenderLayer::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls)
    22702270{
    22712271    // Don't do anything if we have no overflow.
     
    22822282        RenderView* renderView = renderer()->view();
    22832283        renderView->layer()->setContainsDirtyOverlayScrollbars(true);
    2284         m_cachedOverlayScrollbarOffset = IntPoint(tx, ty);
     2284        m_cachedOverlayScrollbarOffset = paintOffset;
    22852285        renderView->frameView()->setContainsScrollableAreaWithOverlayScrollbars(true);
    22862286        return;
     
    22912291        return;
    22922292
    2293     int offsetX = tx;
    2294     int offsetY = ty;
    2295     if (paintingOverlayControls) {
    2296         offsetX = m_cachedOverlayScrollbarOffset.x();
    2297         offsetY = m_cachedOverlayScrollbarOffset.y();
    2298     }
     2293    IntPoint adjustedPaintOffset = paintOffset;
     2294    if (paintingOverlayControls)
     2295        adjustedPaintOffset = m_cachedOverlayScrollbarOffset;
    22992296
    23002297    // Move the scrollbar widgets if necessary.  We normally move and resize widgets during layout, but sometimes
    23012298    // widgets can move without layout occurring (most notably when you scroll a document that
    23022299    // contains fixed positioned elements).
    2303     positionOverflowControls(IntSize(offsetX, offsetY));
     2300    positionOverflowControls(toSize(adjustedPaintOffset));
    23042301
    23052302    // Now that we're sure the scrollbars are in the right place, paint them.
     
    23242321    // We fill our scroll corner with white if we have a scrollbar that doesn't run all the way up to the
    23252322    // edge of the box.
    2326     paintScrollCorner(context, IntPoint(offsetX, offsetY), damageRect);
     2323    paintScrollCorner(context, adjustedPaintOffset, damageRect);
    23272324   
    23282325    // Paint our resizer last, since it sits on top of the scroll corner.
    2329     paintResizer(context, IntPoint(offsetX, offsetY), damageRect);
     2326    paintResizer(context, adjustedPaintOffset, damageRect);
    23302327}
    23312328
     
    27092706    if (paintingOverlayScrollbars) {
    27102707        setClip(p, paintDirtyRect, damageRect);
    2711         paintOverflowControls(p, tx, ty, damageRect, true);
     2708        paintOverflowControls(p, IntPoint(tx, ty), damageRect, true);
    27122709        restoreClip(p, paintDirtyRect, damageRect);
    27132710    }
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r87845 r87864  
    262262    IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const;
    263263
    264     void paintOverflowControls(GraphicsContext*, int tx, int ty, const IntRect& damageRect, bool paintingOverlayControls = false);
     264    void paintOverflowControls(GraphicsContext*, const IntPoint&, const IntRect& damageRect, bool paintingOverlayControls = false);
    265265    void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& damageRect);
    266266    void paintResizer(GraphicsContext*, const IntPoint&, const IntRect& damageRect);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r87845 r87864  
    11011101    IntRect layerBounds, damageRect, clipRectToApply, outlineRect;
    11021102    m_owningLayer->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);
    1103    
    1104     int x = layerBounds.x();        // layerBounds is computed relative to rootLayer
    1105     int y = layerBounds.y();
    1106     int tx = x - m_owningLayer->renderBoxX();
    1107     int ty = y - m_owningLayer->renderBoxY();
     1103
     1104    int tx = layerBounds.x() - m_owningLayer->renderBoxX();
     1105    int ty = layerBounds.y() - m_owningLayer->renderBoxY();
    11081106
    11091107    // If this layer's renderer is a child of the paintingRoot, we render unconditionally, which
     
    11281126        // z-index.  We paint after we painted the background/border, so that the scrollbars will
    11291127        // sit above the background/border.
    1130         m_owningLayer->paintOverflowControls(context, x, y, damageRect);
     1128        m_owningLayer->paintOverflowControls(context, layerBounds.location(), damageRect);
    11311129       
    11321130        // Restore the clip.
Note: See TracChangeset for help on using the changeset viewer.