Changeset 87864 in webkit
- Timestamp:
- Jun 1, 2011 4:15:58 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87863 r87864 1 2011-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 1 21 2011-06-01 Abhishek Arya <inferno@chromium.org> 2 22 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r87753 r87864 2269 2269 // sit above the background/border. 2270 2270 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); 2272 2272 } 2273 2273 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r87845 r87864 2267 2267 } 2268 2268 2269 void RenderLayer::paintOverflowControls(GraphicsContext* context, int tx, int ty, const IntRect& damageRect, bool paintingOverlayControls)2269 void RenderLayer::paintOverflowControls(GraphicsContext* context, const IntPoint& paintOffset, const IntRect& damageRect, bool paintingOverlayControls) 2270 2270 { 2271 2271 // Don't do anything if we have no overflow. … … 2282 2282 RenderView* renderView = renderer()->view(); 2283 2283 renderView->layer()->setContainsDirtyOverlayScrollbars(true); 2284 m_cachedOverlayScrollbarOffset = IntPoint(tx, ty);2284 m_cachedOverlayScrollbarOffset = paintOffset; 2285 2285 renderView->frameView()->setContainsScrollableAreaWithOverlayScrollbars(true); 2286 2286 return; … … 2291 2291 return; 2292 2292 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; 2299 2296 2300 2297 // Move the scrollbar widgets if necessary. We normally move and resize widgets during layout, but sometimes 2301 2298 // widgets can move without layout occurring (most notably when you scroll a document that 2302 2299 // contains fixed positioned elements). 2303 positionOverflowControls( IntSize(offsetX, offsetY));2300 positionOverflowControls(toSize(adjustedPaintOffset)); 2304 2301 2305 2302 // Now that we're sure the scrollbars are in the right place, paint them. … … 2324 2321 // We fill our scroll corner with white if we have a scrollbar that doesn't run all the way up to the 2325 2322 // edge of the box. 2326 paintScrollCorner(context, IntPoint(offsetX, offsetY), damageRect);2323 paintScrollCorner(context, adjustedPaintOffset, damageRect); 2327 2324 2328 2325 // 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); 2330 2327 } 2331 2328 … … 2709 2706 if (paintingOverlayScrollbars) { 2710 2707 setClip(p, paintDirtyRect, damageRect); 2711 paintOverflowControls(p, tx, ty, damageRect, true);2708 paintOverflowControls(p, IntPoint(tx, ty), damageRect, true); 2712 2709 restoreClip(p, paintDirtyRect, damageRect); 2713 2710 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r87845 r87864 262 262 IntSize offsetFromResizeCorner(const IntPoint& absolutePoint) const; 263 263 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); 265 265 void paintScrollCorner(GraphicsContext*, const IntPoint&, const IntRect& damageRect); 266 266 void paintResizer(GraphicsContext*, const IntPoint&, const IntRect& damageRect); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r87845 r87864 1101 1101 IntRect layerBounds, damageRect, clipRectToApply, outlineRect; 1102 1102 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(); 1108 1106 1109 1107 // If this layer's renderer is a child of the paintingRoot, we render unconditionally, which … … 1128 1126 // z-index. We paint after we painted the background/border, so that the scrollbars will 1129 1127 // sit above the background/border. 1130 m_owningLayer->paintOverflowControls(context, x, y, damageRect);1128 m_owningLayer->paintOverflowControls(context, layerBounds.location(), damageRect); 1131 1129 1132 1130 // Restore the clip.
Note: See TracChangeset
for help on using the changeset viewer.