Diff
Modified: trunk/Source/WebCore/ChangeLog (87863 => 87864)
--- trunk/Source/WebCore/ChangeLog 2011-06-01 23:13:53 UTC (rev 87863)
+++ trunk/Source/WebCore/ChangeLog 2011-06-01 23:15:58 UTC (rev 87864)
@@ -1,3 +1,23 @@
+2011-06-01 Levi Weintraub <[email protected]>
+
+ 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):
+
2011-06-01 Abhishek Arya <[email protected]>
Reviewed by Alexey Proskuryakov.
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (87863 => 87864)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-06-01 23:13:53 UTC (rev 87863)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-06-01 23:15:58 UTC (rev 87864)
@@ -2268,7 +2268,7 @@
// z-index. We paint after we painted the background/border, so that the scrollbars will
// sit above the background/border.
if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this))
- layer()->paintOverflowControls(paintInfo.context, tx, ty, paintInfo.rect);
+ layer()->paintOverflowControls(paintInfo.context, IntPoint(tx, ty), paintInfo.rect);
}
void RenderBlock::paintColumnRules(PaintInfo& paintInfo, int tx, int ty)
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (87863 => 87864)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-01 23:13:53 UTC (rev 87863)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2011-06-01 23:15:58 UTC (rev 87864)
@@ -2266,7 +2266,7 @@
updateOverflowStatus(horizontalOverflow, verticalOverflow);
}
-void RenderLayer::paintOverflowControls(GraphicsContext* context, int tx, int ty, const IntRect& damageRect, bool paintingOverlayControls)
+void RenderLayer::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls)
{
// Don't do anything if we have no overflow.
if (!renderer()->hasOverflowClip())
@@ -2281,7 +2281,7 @@
if (hasOverlayScrollbars() && !paintingOverlayControls) {
RenderView* renderView = renderer()->view();
renderView->layer()->setContainsDirtyOverlayScrollbars(true);
- m_cachedOverlayScrollbarOffset = IntPoint(tx, ty);
+ m_cachedOverlayScrollbarOffset = paintOffset;
renderView->frameView()->setContainsScrollableAreaWithOverlayScrollbars(true);
return;
}
@@ -2290,17 +2290,14 @@
if (paintingOverlayControls && !hasOverlayScrollbars())
return;
- int offsetX = tx;
- int offsetY = ty;
- if (paintingOverlayControls) {
- offsetX = m_cachedOverlayScrollbarOffset.x();
- offsetY = m_cachedOverlayScrollbarOffset.y();
- }
+ IntPoint adjustedPaintOffset = paintOffset;
+ if (paintingOverlayControls)
+ adjustedPaintOffset = m_cachedOverlayScrollbarOffset;
// Move the scrollbar widgets if necessary. We normally move and resize widgets during layout, but sometimes
// widgets can move without layout occurring (most notably when you scroll a document that
// contains fixed positioned elements).
- positionOverflowControls(IntSize(offsetX, offsetY));
+ positionOverflowControls(toSize(adjustedPaintOffset));
// Now that we're sure the scrollbars are in the right place, paint them.
if (m_hBar
@@ -2323,10 +2320,10 @@
// We fill our scroll corner with white if we have a scrollbar that doesn't run all the way up to the
// edge of the box.
- paintScrollCorner(context, IntPoint(offsetX, offsetY), damageRect);
+ paintScrollCorner(context, adjustedPaintOffset, damageRect);
// Paint our resizer last, since it sits on top of the scroll corner.
- paintResizer(context, IntPoint(offsetX, offsetY), damageRect);
+ paintResizer(context, adjustedPaintOffset, damageRect);
}
void RenderLayer::paintScrollCorner(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect)
@@ -2708,7 +2705,7 @@
if (paintingOverlayScrollbars) {
setClip(p, paintDirtyRect, damageRect);
- paintOverflowControls(p, tx, ty, damageRect, true);
+ paintOverflowControls(p, IntPoint(tx, ty), damageRect, true);
restoreClip(p, paintDirtyRect, damageRect);
}
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (87863 => 87864)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2011-06-01 23:13:53 UTC (rev 87863)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2011-06-01 23:15:58 UTC (rev 87864)
@@ -261,7 +261,7 @@
bool hitTestOverflowControls(HitTestResult&, const IntPoint& localPoint);
IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const;
- void paintOverflowControls(GraphicsContext*, int tx, int ty, const IntRect& damageRect, bool paintingOverlayControls = false);
+ void paintOverflowControls(GraphicsContext*, const IntPoint&, const IntRect& damageRect, bool paintingOverlayControls = false);
void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& damageRect);
void paintResizer(GraphicsContext*, const IntPoint&, const IntRect& damageRect);
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (87863 => 87864)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-06-01 23:13:53 UTC (rev 87863)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2011-06-01 23:15:58 UTC (rev 87864)
@@ -1100,12 +1100,10 @@
// Calculate the clip rects we should use.
IntRect layerBounds, damageRect, clipRectToApply, outlineRect;
m_owningLayer->calculateRects(rootLayer, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect);
-
- int x = layerBounds.x(); // layerBounds is computed relative to rootLayer
- int y = layerBounds.y();
- int tx = x - m_owningLayer->renderBoxX();
- int ty = y - m_owningLayer->renderBoxY();
+ int tx = layerBounds.x() - m_owningLayer->renderBoxX();
+ int ty = layerBounds.y() - m_owningLayer->renderBoxY();
+
// If this layer's renderer is a child of the paintingRoot, we render unconditionally, which
// is done by passing a nil paintingRoot down to our renderer (as if no paintingRoot was ever set).
// Else, our renderer tree may or may not contain the painting root, so we pass that root along
@@ -1127,7 +1125,7 @@
// Our scrollbar widgets paint exactly when we tell them to, so that they work properly with
// z-index. We paint after we painted the background/border, so that the scrollbars will
// sit above the background/border.
- m_owningLayer->paintOverflowControls(context, x, y, damageRect);
+ m_owningLayer->paintOverflowControls(context, layerBounds.location(), damageRect);
// Restore the clip.
restoreClip(context, paintDirtyRect, damageRect);