Changeset 240899 in webkit
- Timestamp:
- Feb 2, 2019, 12:05:22 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
rendering/RenderLayerBacking.cpp (modified) (13 diffs)
-
rendering/RenderLayerBacking.h (modified) (2 diffs)
-
rendering/RenderLayerCompositor.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240898 r240899 1 2019-02-02 Simon Fraser <simon.fraser@apple.com> 2 3 Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity 4 https://bugs.webkit.org/show_bug.cgi?id=194194 5 6 Rubber-stampted by Antti Koivisto. 7 8 Our desired terminology is "scrollContainerLayer" for the outer, clipping layer 9 for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll. 10 11 * rendering/RenderLayerBacking.cpp: 12 (WebCore::RenderLayerBacking::updateDebugIndicators): 13 (WebCore::RenderLayerBacking::destroyGraphicsLayers): 14 (WebCore::RenderLayerBacking::updateGeometry): 15 (WebCore::RenderLayerBacking::setLocationOfScrolledContents): 16 (WebCore::RenderLayerBacking::updateAfterDescendants): 17 (WebCore::RenderLayerBacking::updateInternalHierarchy): 18 (WebCore::RenderLayerBacking::updateDrawsContent): 19 (WebCore::RenderLayerBacking::updateScrollingLayers): 20 * rendering/RenderLayerBacking.h: 21 * rendering/RenderLayerCompositor.cpp: 22 (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): 23 (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole): 24 (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers): 25 (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer): 26 (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers): 27 (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer): 28 1 29 2019-02-02 Justin Fan <justin_fan@apple.com> 2 30 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r240897 r240899 392 392 m_layerForScrollCorner->setShowDebugBorder(showBorder); 393 393 394 if (m_scroll ingLayer)395 m_scroll ingLayer->setShowDebugBorder(showBorder);394 if (m_scrollContainerLayer) 395 m_scrollContainerLayer->setShowDebugBorder(showBorder); 396 396 397 397 if (m_scrolledContentsLayer) { … … 483 483 GraphicsLayer::unparentAndClear(m_childContainmentLayer); 484 484 GraphicsLayer::unparentAndClear(m_childClippingMaskLayer); 485 GraphicsLayer::unparentAndClear(m_scroll ingLayer);485 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 486 486 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); 487 487 GraphicsLayer::unparentAndClear(m_graphicsLayer); … … 1091 1091 clipLayer->setOffsetFromRenderer(toLayoutSize(clippingBox.location() - snappedClippingGraphicsLayer.m_snapDelta)); 1092 1092 1093 if (m_childClippingMaskLayer && !m_scroll ingLayer) {1093 if (m_childClippingMaskLayer && !m_scrollContainerLayer) { 1094 1094 m_childClippingMaskLayer->setSize(clipLayer->size()); 1095 1095 m_childClippingMaskLayer->setPosition(FloatPoint()); … … 1182 1182 } 1183 1183 1184 if (m_scroll ingLayer) {1184 if (m_scrollContainerLayer) { 1185 1185 ASSERT(m_scrolledContentsLayer); 1186 1186 auto& renderBox = downcast<RenderBox>(renderer()); … … 1189 1189 1190 1190 // FIXME: need to do some pixel snapping here. 1191 m_scroll ingLayer->setPosition(FloatPoint(paddingBoxIncludingScrollbar.location() - compositedBounds().location()));1192 m_scroll ingLayer->setSize(roundedIntSize(LayoutSize(renderBox.clientWidth(), renderBox.clientHeight())));1191 m_scrollContainerLayer->setPosition(FloatPoint(paddingBoxIncludingScrollbar.location() - compositedBounds().location())); 1192 m_scrollContainerLayer->setSize(roundedIntSize(LayoutSize(renderBox.clientWidth(), renderBox.clientHeight()))); 1193 1193 1194 1194 updateScrollOffset(scrollOffset); … … 1197 1197 #endif 1198 1198 1199 FloatSize oldScrollingLayerOffset = m_scroll ingLayer->offsetFromRenderer();1200 m_scroll ingLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location()));1199 FloatSize oldScrollingLayerOffset = m_scrollContainerLayer->offsetFromRenderer(); 1200 m_scrollContainerLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location())); 1201 1201 1202 1202 if (m_childClippingMaskLayer) { 1203 m_childClippingMaskLayer->setPosition(m_scroll ingLayer->position());1204 m_childClippingMaskLayer->setSize(m_scroll ingLayer->size());1203 m_childClippingMaskLayer->setPosition(m_scrollContainerLayer->position()); 1204 m_childClippingMaskLayer->setSize(m_scrollContainerLayer->size()); 1205 1205 m_childClippingMaskLayer->setOffsetFromRenderer(-toFloatSize(paddingBoxIncludingScrollbar.location())); 1206 1206 } 1207 1207 1208 bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scroll ingLayer->offsetFromRenderer();1208 bool paddingBoxOffsetChanged = oldScrollingLayerOffset != m_scrollContainerLayer->offsetFromRenderer(); 1209 1209 1210 1210 IntSize scrollSize(m_owningLayer.scrollWidth(), m_owningLayer.scrollHeight()); … … 1239 1239 #if PLATFORM(IOS_FAMILY) 1240 1240 if (setOrSync == ScrollingLayerPositionAction::Sync) 1241 m_scroll ingLayer->syncBoundsOrigin(scrollOffset);1241 m_scrollContainerLayer->syncBoundsOrigin(scrollOffset); 1242 1242 else 1243 m_scroll ingLayer->setBoundsOrigin(scrollOffset);1243 m_scrollContainerLayer->setBoundsOrigin(scrollOffset); 1244 1244 #else 1245 1245 if (setOrSync == ScrollingLayerPositionAction::Sync) … … 1279 1279 1280 1280 m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || hasVisibleNonCompositedDescendants()); 1281 if (m_scroll ingLayer) {1282 m_scroll ingLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible);1283 m_scroll ingLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None);1281 if (m_scrollContainerLayer) { 1282 m_scrollContainerLayer->setContentsVisible(renderer().style().visibility() == Visibility::Visible); 1283 m_scrollContainerLayer->setUserInteractionEnabled(renderer().style().pointerEvents() != PointerEvents::None); 1284 1284 } 1285 1285 } … … 1348 1348 m_graphicsLayer->addChild(*m_childContainmentLayer); 1349 1349 1350 if (m_scroll ingLayer) {1350 if (m_scrollContainerLayer) { 1351 1351 auto* superlayer = m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsLayer.get(); 1352 superlayer->addChild(*m_scroll ingLayer);1352 superlayer->addChild(*m_scrollContainerLayer); 1353 1353 } 1354 1354 … … 1391 1391 void RenderLayerBacking::updateDrawsContent(PaintedContentsInfo& contentsInfo) 1392 1392 { 1393 if (m_scroll ingLayer) {1393 if (m_scrollContainerLayer) { 1394 1394 // We don't have to consider overflow controls, because we know that the scrollbars are drawn elsewhere. 1395 1395 // m_graphicsLayer only needs backing store if the non-scrolling parts (background, outlines, borders, shadows etc) need to paint. 1396 // m_scroll ingLayer never has backing store.1396 // m_scrollContainerLayer never has backing store. 1397 1397 // m_scrolledContentsLayer only needs backing store if the scrolled contents need to paint. 1398 1398 bool hasNonScrollingPaintedContent = m_owningLayer.hasVisibleContent() && m_owningLayer.hasVisibleBoxDecorationsOrBackground(); … … 1739 1739 bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers) 1740 1740 { 1741 if (needsScrollingLayers == !!m_scroll ingLayer)1742 return false; 1743 1744 if (!m_scroll ingLayer) {1741 if (needsScrollingLayers == !!m_scrollContainerLayer) 1742 return false; 1743 1744 if (!m_scrollContainerLayer) { 1745 1745 // Outer layer which corresponds with the scroll view. 1746 m_scroll ingLayer = createGraphicsLayer("scrolling container", GraphicsLayer::Type::Scrolling);1747 m_scroll ingLayer->setDrawsContent(false);1748 m_scroll ingLayer->setMasksToBounds(true);1746 m_scrollContainerLayer = createGraphicsLayer("scrolling container", GraphicsLayer::Type::Scrolling); 1747 m_scrollContainerLayer->setDrawsContent(false); 1748 m_scrollContainerLayer->setMasksToBounds(true); 1749 1749 1750 1750 // Inner layer which renders the content that scrolls. … … 1757 1757 paintPhase |= GraphicsLayerPaintForeground; 1758 1758 m_scrolledContentsLayer->setPaintingPhase(paintPhase); 1759 m_scroll ingLayer->addChild(*m_scrolledContentsLayer);1759 m_scrollContainerLayer->addChild(*m_scrolledContentsLayer); 1760 1760 } else { 1761 1761 compositor().willRemoveScrollingLayerWithBacking(m_owningLayer, *this); 1762 1762 1763 willDestroyLayer(m_scroll ingLayer.get());1763 willDestroyLayer(m_scrollContainerLayer.get()); 1764 1764 willDestroyLayer(m_scrolledContentsLayer.get()); 1765 1765 1766 GraphicsLayer::unparentAndClear(m_scroll ingLayer);1766 GraphicsLayer::unparentAndClear(m_scrollContainerLayer); 1767 1767 GraphicsLayer::unparentAndClear(m_scrolledContentsLayer); 1768 1768 } … … 1771 1771 m_graphicsLayer->setNeedsDisplay(); // Because painting phases changed. 1772 1772 1773 if (m_scroll ingLayer)1773 if (m_scrollContainerLayer) 1774 1774 compositor().didAddScrollingLayer(m_owningLayer); 1775 1775 -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r240897 r240899 105 105 void setRequiresBackgroundLayer(bool); 106 106 107 bool hasScrollingLayer() const { return m_scroll ingLayer != nullptr; }108 GraphicsLayer* scroll ingLayer() const { return m_scrollingLayer.get(); }109 GraphicsLayer* scroll ingContentsLayer() const { return m_scrolledContentsLayer.get(); }107 bool hasScrollingLayer() const { return m_scrollContainerLayer != nullptr; } 108 GraphicsLayer* scrollContainerLayer() const { return m_scrollContainerLayer.get(); } 109 GraphicsLayer* scrolledContentsLayer() const { return m_scrolledContentsLayer.get(); } 110 110 111 111 OptionSet<ScrollCoordinationRole> coordinatedScrollingRoles() const; … … 386 386 RefPtr<GraphicsLayer> m_layerForScrollCorner; 387 387 388 RefPtr<GraphicsLayer> m_scroll ingLayer; // Only used if the layer is using composited scrolling.388 RefPtr<GraphicsLayer> m_scrollContainerLayer; // Only used if the layer is using composited scrolling. 389 389 RefPtr<GraphicsLayer> m_scrolledContentsLayer; // Only used if the layer is using composited scrolling. 390 390 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r240861 r240899 554 554 nodeLayers = { nullptr, nullptr, m_scrollLayer.get(), fixedRootBackgroundLayer(), clipLayer(), m_rootContentsLayer.get() }; 555 555 } else 556 nodeLayers = { layer.backing()->graphicsLayer(), backing->scroll ingLayer(), backing->scrollingContentsLayer() };556 nodeLayers = { layer.backing()->graphicsLayer(), backing->scrollContainerLayer(), backing->scrolledContentsLayer() }; 557 557 558 558 scrollingCoordinator->setNodeLayers(nodeID, nodeLayers); … … 4028 4028 4029 4029 if (changes & ScrollingNodeChangeFlags::Layer) 4030 scrollingCoordinator->setNodeLayers(newNodeID, { layer.backing()->graphicsLayer(), layer.backing()->scroll ingLayer(), layer.backing()->scrollingContentsLayer() });4030 scrollingCoordinator->setNodeLayers(newNodeID, { layer.backing()->graphicsLayer(), layer.backing()->scrollContainerLayer(), layer.backing()->scrolledContentsLayer() }); 4031 4031 4032 4032 if (changes & ScrollingNodeChangeFlags::LayerGeometry && treeState.parentNodeID) { … … 4236 4236 if (compositor.isAsyncScrollableStickyLayer(*layer, &enclosingTouchScrollableLayer) && enclosingTouchScrollableLayer) { 4237 4237 ASSERT(enclosingTouchScrollableLayer->isComposited()); 4238 stickyContainerMap.add(layer->backing()->graphicsLayer()->platformLayer(), enclosingTouchScrollableLayer->backing()->scrollingLayer()->platformLayer()); 4238 // what 4239 stickyContainerMap.add(layer->backing()->graphicsLayer()->platformLayer(), enclosingTouchScrollableLayer->backing()->scrollContainerLayer()->platformLayer()); 4239 4240 } 4240 4241 } else if (layer->renderer().isFixedPositioned()) … … 4274 4275 bool allowHorizontalScrollbar = !scrollbarHasDisplayNone(layer.horizontalScrollbar()); 4275 4276 bool allowVerticalScrollbar = !scrollbarHasDisplayNone(layer.verticalScrollbar()); 4276 m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scroll ingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer(),4277 m_chromeClient.addOrUpdateScrollingLayer(layer.renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer(), 4277 4278 layer.scrollableContentsSize(), allowHorizontalScrollbar, allowVerticalScrollbar); 4278 4279 } … … 4297 4298 auto* backing = layer->backing(); 4298 4299 ASSERT(backing); 4299 m_chromeClient.removeScrollingLayer(layer->renderer().element(), backing->scroll ingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer());4300 m_chromeClient.removeScrollingLayer(layer->renderer().element(), backing->scrollContainerLayer()->platformLayer(), backing->scrolledContentsLayer()->platformLayer()); 4300 4301 } 4301 4302 } … … 4311 4312 m_scrollingLayersNeedingUpdate.remove(&layer); 4312 4313 if (m_scrollingLayers.remove(&layer)) { 4313 auto* scroll ingLayer = backing.scrollingLayer()->platformLayer();4314 auto* contentsLayer = backing.scrollingContentsLayer()->platformLayer();4315 m_chromeClient.removeScrollingLayer(layer.renderer().element(), scroll ingLayer, contentsLayer);4314 auto* scrollContainerLayer = backing.scrollContainerLayer()->platformLayer(); 4315 auto* scrolledContentsLayer = backing.scrolledContentsLayer()->platformLayer(); 4316 m_chromeClient.removeScrollingLayer(layer.renderer().element(), scrollContainerLayer, scrolledContentsLayer); 4316 4317 } 4317 4318 }
Note:
See TracChangeset
for help on using the changeset viewer.