Changeset 238727 in webkit
- Timestamp:
- Nov 29, 2018 10:35:36 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r238725 r238727 1 2018-11-29 Frederic Wang <fwang@igalia.com> 2 3 Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer 4 https://bugs.webkit.org/show_bug.cgi?id=183040 5 6 Reviewed by Simon Fraser. 7 8 Update expectations containing layer trees of RenderLayerBacking::m_scrollingContentsLayer, to separate offsetFromRenderer and 9 scrollOffset. We have OLD offsetFromRenderer = NEW offsetFromRenderer - scrollOffset. 10 11 * compositing/ios/overflow-scroll-touch-tiles-expected.txt: 12 * fast/scrolling/ios/overflow-scroll-touch-expected.txt: 13 * fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt: 14 * platform/ios/compositing/overflow/scrolling-without-painting-expected.txt: 15 * platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt: 16 * platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt: 17 * platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt: 18 * platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt: 19 * platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt: 20 1 21 2018-11-29 Simon Fraser <simon.fraser@apple.com> 2 22 -
trunk/LayoutTests/compositing/ios/overflow-scroll-touch-tiles-expected.txt
r225897 r238727 63 63 (children 1 64 64 (GraphicsLayer 65 (offsetFromRenderer width=2 height=-238) 65 (offsetFromRenderer width=2 height=2) 66 (scrollOffset (0,240)) 66 67 (bounds 400.00 2002.00) 67 68 (usingTiledLayer 1) -
trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-touch-expected.txt
r225897 r238727 22 22 (children 1 23 23 (GraphicsLayer 24 (offsetFromRenderer width=1 height=-49) 24 (offsetFromRenderer width=1 height=1) 25 (scrollOffset (0,50)) 25 26 (bounds 200.00 400.00) 26 27 (drawsContent 1) … … 42 43 (children 1 43 44 (GraphicsLayer 44 (offsetFromRenderer width=1 height=-49) 45 (offsetFromRenderer width=1 height=1) 46 (scrollOffset (0,50)) 45 47 (bounds 200.00 400.00) 46 48 (drawsContent 1) -
trunk/LayoutTests/fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt
r225897 r238727 16 16 (children 1 17 17 (GraphicsLayer 18 ( offsetFromRenderer width=0 height=-30)18 (scrollOffset (0,30)) 19 19 (bounds 300.00 900.00) 20 20 (drawsContent 1) -
trunk/LayoutTests/platform/ios/compositing/overflow/scrolling-without-painting-expected.txt
r236428 r238727 19 19 (children 1 20 20 (GraphicsLayer 21 (offsetFromRenderer width=1 height=-24) 21 (offsetFromRenderer width=1 height=1) 22 (scrollOffset (0,25)) 22 23 (bounds 200.00 1025.00) 23 24 ) -
trunk/LayoutTests/platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt
r236428 r238727 20 20 (children 1 21 21 (GraphicsLayer 22 (offsetFromRenderer width=1 height=-49) 22 (offsetFromRenderer width=1 height=1) 23 (scrollOffset (0,50)) 23 24 (bounds 204.00 270.00) 24 25 (drawsContent 1) … … 41 42 (children 1 42 43 (GraphicsLayer 43 (offsetFromRenderer width=1 height=-49) 44 (offsetFromRenderer width=1 height=1) 45 (scrollOffset (0,50)) 44 46 (bounds 204.00 270.00) 45 47 (drawsContent 1) -
trunk/LayoutTests/platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt
r225897 r238727 20 20 (children 1 21 21 (GraphicsLayer 22 (offsetFromRenderer width=-364 height=2) 22 (offsetFromRenderer width=2 height=2) 23 (scrollOffset (366,0)) 23 24 (bounds 766.00 205.00) 24 25 (drawsContent 1) -
trunk/LayoutTests/platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt
r225897 r238727 19 19 (children 1 20 20 (GraphicsLayer 21 (offsetFromRenderer width=1 height=-29) 21 (offsetFromRenderer width=1 height=1) 22 (scrollOffset (0,30)) 22 23 (bounds 300.00 900.00) 23 24 (drawsContent 1) -
trunk/LayoutTests/platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt
r225897 r238727 19 19 (children 1 20 20 (GraphicsLayer 21 (offsetFromRenderer width=11 height=-19) 21 (offsetFromRenderer width=11 height=11) 22 (scrollOffset (0,30)) 22 23 (bounds 300.00 900.00) 23 24 (drawsContent 1) -
trunk/LayoutTests/platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt
r225897 r238727 20 20 (children 1 21 21 (GraphicsLayer 22 (offsetFromRenderer width=1 height=-49) 22 (offsetFromRenderer width=1 height=1) 23 (scrollOffset (0,50)) 23 24 (bounds 204.00 270.00) 24 25 (drawsContent 1) … … 41 42 (children 1 42 43 (GraphicsLayer 43 (offsetFromRenderer width=1 height=-49) 44 (offsetFromRenderer width=1 height=1) 45 (scrollOffset (0,50)) 44 46 (bounds 204.00 270.00) 45 47 (drawsContent 1) -
trunk/Source/WebCore/ChangeLog
r238725 r238727 1 2018-11-29 Frederic Wang <fwang@igalia.com> 2 3 Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer 4 https://bugs.webkit.org/show_bug.cgi?id=183040 5 6 Currently, scroll offset of RenderLayerBacking::m_scrollingContentsLayer is stored in the 7 GraphicsLayer::m_offsetFromRenderer member used for paint offset. This patch separates these 8 two concept by introducing a new GraphicsLayer::m_scrollOffset for the scroll offset. This 9 makes the API a little bit cleaner, the code easier to understand and might avoid unnecessary 10 repaints in composited scroll. 11 12 Reviewed by Simon Fraser. 13 14 No new tests, already covered by existing tests. 15 16 * platform/graphics/GraphicsLayer.cpp: 17 (WebCore::GraphicsLayer::setScrollOffset): Setter function to update the scroll offset 18 of the content layer inside its scrolling parent layer. Ask a repaint if it has changed and 19 is requested by the caller. 20 (WebCore::GraphicsLayer::paintGraphicsLayerContents): Take into account the scroll offset 21 when painting. 22 (WebCore::GraphicsLayer::dumpProperties const): Dump the scroll offset property. 23 * platform/graphics/GraphicsLayer.h: Include ScrollableArea for the ScrollOffset typedef. 24 Add member for the scroll offset of the content layer inside its scrolling parent layer. 25 (WebCore::GraphicsLayer::scrollOffset const): Getter function. 26 * rendering/RenderLayerBacking.cpp: 27 (WebCore::RenderLayerBacking::updateGeometry): Do not include the scroll offset in the 28 paint offset of m_scrollingContentsLayer since it is now taken into account in 29 paintGraphicsLayerContents. Update the scroll offset of m_scrollingContentsLayer separately. 30 Leave the paint offset of m_foregroundLayer unchanged. 31 (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Take into account the scroll 32 offset of m_scrollingContentsLayer when calculating the dirty rect. 33 1 34 2018-11-29 Simon Fraser <simon.fraser@apple.com> 2 35 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r238108 r238727 457 457 } 458 458 459 void GraphicsLayer::setScrollOffset(const ScrollOffset& offset, ShouldSetNeedsDisplay shouldSetNeedsDisplay) 460 { 461 if (offset == m_scrollOffset) 462 return; 463 464 m_scrollOffset = offset; 465 466 // If the compositing layer offset changes, we need to repaint. 467 if (shouldSetNeedsDisplay == SetNeedsDisplay) 468 setNeedsDisplay(); 469 } 470 459 471 void GraphicsLayer::setSize(const FloatSize& size) 460 472 { … … 475 487 void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior) 476 488 { 477 FloatSize offset = offsetFromRenderer() ;489 FloatSize offset = offsetFromRenderer() - toFloatSize(scrollOffset()); 478 490 context.translate(-offset); 479 491 … … 781 793 ts << indent << "(offsetFromRenderer " << m_offsetFromRenderer << ")\n"; 782 794 795 if (!m_scrollOffset.isZero()) 796 ts << indent << "(scrollOffset " << m_scrollOffset << ")\n"; 797 783 798 if (m_position != FloatPoint()) 784 799 ts << indent << "(position " << m_position.x() << " " << m_position.y() << ")\n"; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r238108 r238727 36 36 #include "Path.h" 37 37 #include "PlatformLayer.h" 38 #include "ScrollableArea.h" 38 39 #include "TransformOperations.h" 39 40 #include "WindRule.h" … … 314 315 void setOffsetFromRenderer(const FloatSize&, ShouldSetNeedsDisplay = SetNeedsDisplay); 315 316 317 // Scroll offset of the content layer inside its scrolling parent layer. 318 ScrollOffset scrollOffset() const { return m_scrollOffset; } 319 void setScrollOffset(const ScrollOffset&, ShouldSetNeedsDisplay = SetNeedsDisplay); 320 316 321 // The position of the layer (the location of its top-left corner in its parent) 317 322 const FloatPoint& position() const { return m_position; } … … 652 657 FloatSize m_offsetFromRenderer; 653 658 659 // Scroll offset of the content layer inside its scrolling parent layer. 660 ScrollOffset m_scrollOffset; 661 654 662 // Position is relative to the parent GraphicsLayer 655 663 FloatPoint m_position; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r238715 r238727 1207 1207 m_scrollingContentsLayer->setSize(scrollSize); 1208 1208 // Scrolling the content layer does not need to trigger a repaint. The offset will be compensated away during painting. 1209 // FIXME: The paint offset and the scroll offset should really be separate concepts. 1210 LayoutSize scrollingContentsOffset = toLayoutSize(paddingBox.location() - toLayoutSize(scrollOffset)); 1211 m_scrollingContentsLayer->setOffsetFromRenderer(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay); 1209 m_scrollingContentsLayer->setScrollOffset(scrollOffset, GraphicsLayer::DontSetNeedsDisplay); 1210 m_scrollingContentsLayer->setOffsetFromRenderer(toLayoutSize(paddingBox.location()), GraphicsLayer::DontSetNeedsDisplay); 1212 1211 #else 1213 1212 m_scrollingContentsLayer->setPosition(-scrollOffset); … … 1228 1227 m_scrollingContentsLayer->setNeedsDisplay(); 1229 1228 1230 LayoutSize scrollingContentsOffset = toLayoutSize(paddingBox.location() - toLayoutSize(scrollOffset)); 1231 if (scrollingContentsOffset != m_scrollingContentsLayer->offsetFromRenderer() || scrollSize != m_scrollingContentsLayer->size()) 1229 if (toLayoutSize(paddingBox.location()) != m_scrollingContentsLayer->offsetFromRenderer() || scrollOffset != m_scrollingContentsLayer->scrollOffset() || scrollSize != m_scrollingContentsLayer->size()) 1232 1230 compositor().scrollingLayerDidChange(m_owningLayer); 1233 1231 1234 1232 m_scrollingContentsLayer->setSize(scrollSize); 1235 // FIXME: The paint offset and the scroll offset should really be separate concepts.1236 m_scrollingContentsLayer->setOffsetFromRenderer( scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);1233 m_scrollingContentsLayer->setScrollOffset(scrollOffset, GraphicsLayer::DontSetNeedsDisplay); 1234 m_scrollingContentsLayer->setOffsetFromRenderer(toLayoutSize(paddingBox.location()), GraphicsLayer::DontSetNeedsDisplay); 1237 1235 #endif 1238 1236 1239 1237 if (m_foregroundLayer) { 1240 1238 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 1241 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->offsetFromRenderer() );1239 m_foregroundLayer->setOffsetFromRenderer(m_scrollingContentsLayer->offsetFromRenderer() - toLayoutSize(m_scrollingContentsLayer->scrollOffset())); 1242 1240 } 1243 1241 } … … 2510 2508 if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) { 2511 2509 FloatRect layerDirtyRect = pixelSnappedRectForPainting; 2512 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer() - m_subpixelOffsetFromRenderer);2510 layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer() + toLayoutSize(m_scrollingContentsLayer->scrollOffset()) - m_subpixelOffsetFromRenderer); 2513 2511 #if PLATFORM(IOS_FAMILY) 2514 2512 // Account for the fact that RenderLayerBacking::updateGeometry() bakes scrollOffset into offsetFromRenderer on iOS,
Note: See TracChangeset
for help on using the changeset viewer.