Changeset 224110 in webkit
- Timestamp:
- Oct 27, 2017 7:38:41 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r224107 r224110 1 2017-10-27 Frederic Wang <fwang@igalia.com> 2 3 Use auto for some variables in RenderLayerCompositor/Backing 4 https://bugs.webkit.org/show_bug.cgi?id=178570 5 6 Reviewed by Darin Adler. 7 8 No new tests, behavior unchanged. 9 10 * rendering/RenderLayerBacking.cpp: 11 (WebCore::canvasCompositingStrategy): 12 (WebCore::RenderLayerBacking::RenderLayerBacking): 13 (WebCore::computePageTiledBackingCoverage): 14 (WebCore::RenderLayerBacking::layerWillBeDestroyed): 15 (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry): 16 (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): 17 (WebCore::RenderLayerBacking::updateCompositedBounds): 18 (WebCore::RenderLayerBacking::updateAfterWidgetResize): 19 (WebCore::RenderLayerBacking::updateAfterLayout): 20 (WebCore::RenderLayerBacking::updateConfiguration): 21 (WebCore::ComputedOffsets::fromAncestorGraphicsLayer): 22 (WebCore::RenderLayerBacking::updateGeometry): 23 (WebCore::RenderLayerBacking::updateInternalHierarchy): 24 (WebCore::RenderLayerBacking::positionOverflowControlsLayers): 25 (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const): 26 (WebCore::RenderLayerBacking::compositingOpacity const): 27 (WebCore::isRestartedPlugin): 28 (WebCore::RenderLayerBacking::isDirectlyCompositedImage const): 29 (WebCore::RenderLayerBacking::updateImageContents): 30 (WebCore::RenderLayerBacking::setContentsNeedDisplay): 31 (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): 32 (WebCore::RenderLayerBacking::getCurrentTransform const): 33 (WebCore::RenderLayerBacking::logFilledVisibleFreshTile): 34 (WebCore::RenderLayerBacking::startAnimation): 35 (WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const): 36 * rendering/RenderLayerCompositor.cpp: 37 (WebCore::RenderLayerCompositor::flushPendingLayerChanges): 38 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes): 39 (WebCore::updateScrollingLayerWithClient): 40 (WebCore::RenderLayerCompositor::didFlushChangesForLayer): 41 (WebCore::RenderLayerCompositor::didPaintBacking): 42 (WebCore::RenderLayerCompositor::didChangeVisibleRect): 43 (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): 44 (WebCore::RenderLayerCompositor::updateCompositingLayers): 45 (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): 46 (WebCore::RenderLayerCompositor::logLayerInfo): 47 (WebCore::checkIfDescendantClippingContextNeedsUpdate): 48 (WebCore::styleChangeRequiresLayerRebuild): 49 (WebCore::RenderLayerCompositor::canCompositeClipPath): 50 (WebCore::rendererForCompositingTests): 51 (WebCore::RenderLayerCompositor::updateBacking): 52 (WebCore::RenderLayerCompositor::repaintOnCompositingChange): 53 (WebCore::RenderLayerCompositor::repaintInCompositedAncestor): 54 (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const): 55 (WebCore::RenderLayerCompositor::setCompositingParent): 56 (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): 57 (WebCore::RenderLayerCompositor::hasCoordinatedScrolling const): 58 (WebCore::RenderLayerCompositor::updateScrollLayerPosition): 59 (WebCore::RenderLayerCompositor::positionForClipLayer const): 60 (WebCore::RenderLayerCompositor::frameViewDidLayout): 61 (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): 62 (WebCore::RenderLayerCompositor::scrollingLayerDidChange): 63 (WebCore::RenderLayerCompositor::frameContentsCompositor): 64 (WebCore::RenderLayerCompositor::parentFrameContentLayers): 65 (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): 66 (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): 67 (WebCore::RenderLayerCompositor::setIsInWindow): 68 (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants): 69 (WebCore::RenderLayerCompositor::clippedByAncestor const): 70 (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const): 71 (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const): 72 (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const): 73 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): 74 (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): 75 (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const): 76 (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const): 77 (WebCore::RenderLayerCompositor::requiresScrollLayer const): 78 (WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const): 79 (WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const): 80 (WebCore::RenderLayerCompositor::resetTrackedRepaintRects): 81 (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const): 82 (WebCore::RenderLayerCompositor::documentUsesTiledBacking const): 83 (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const): 84 (WebCore::RenderLayerCompositor::updateLayerForHeader): 85 (WebCore::RenderLayerCompositor::updateLayerForFooter): 86 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 87 (WebCore::RenderLayerCompositor::ensureRootLayer): 88 (WebCore::RenderLayerCompositor::destroyRootLayer): 89 (WebCore::RenderLayerCompositor::attachRootLayer): 90 (WebCore::RenderLayerCompositor::detachRootLayer): 91 (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): 92 (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): 93 (WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged): 94 (WebCore::RenderLayerCompositor::computeFixedViewportConstraints const): 95 (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const): 96 (WebCore::enclosingScrollingNodeID): 97 (WebCore::scrollCoordinatedAncestorInParentOfFrame): 98 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): 99 (WebCore::RenderLayerCompositor::attachScrollingNode): 100 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): 101 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): 102 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 103 (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): 104 (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): 105 (WebCore::RenderLayerCompositor::didAddScrollingLayer): 106 (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): 107 1 108 2017-10-27 Alicia Boya García <aboya@igalia.com> 2 109 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r222575 r224110 80 80 81 81 const HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer.node()); 82 CanvasRenderingContext* context = canvas->renderingContext();82 auto* context = canvas->renderingContext(); 83 83 if (!context || !context->isAccelerated()) 84 84 return UnacceleratedCanvas; … … 216 216 createPrimaryGraphicsLayer(); 217 217 218 if ( TiledBacking* tiledBacking = this->tiledBacking()) {218 if (auto* tiledBacking = this->tiledBacking()) { 219 219 tiledBacking->setIsInWindow(renderer().page().isInWindow()); 220 220 … … 301 301 { 302 302 // FIXME: When we use TiledBacking for overflow, this should look at RenderView scrollability. 303 FrameView& frameView = backing->owningLayer().renderer().view().frameView();303 auto& frameView = backing->owningLayer().renderer().view().frameView(); 304 304 305 305 // If the page is non-visible, don't incur the cost of keeping extra tiles for scrolling. … … 427 427 void RenderLayerBacking::layerWillBeDestroyed() 428 428 { 429 RenderObject& renderer = this->renderer();429 auto& renderer = this->renderer(); 430 430 if (is<RenderEmbeddedObject>(renderer) && downcast<RenderEmbeddedObject>(renderer).allowsAcceleratedCompositing()) { 431 PluginViewBase* pluginViewBase = downcast<PluginViewBase>(downcast<RenderWidget>(renderer).widget());431 auto* pluginViewBase = downcast<PluginViewBase>(downcast<RenderWidget>(renderer).widget()); 432 432 if (pluginViewBase && m_graphicsLayer->contentsLayerForMedia()) 433 433 pluginViewBase->detachPluginLayer(); … … 509 509 return; 510 510 511 RenderBox& renderer = downcast<RenderBox>(this->renderer());511 auto& renderer = downcast<RenderBox>(this->renderer()); 512 512 LayoutRect boxRect = renderer.borderBoxRect(); 513 513 if (renderer.hasClip()) … … 550 550 static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer) 551 551 { 552 for ( RenderLayer* curr = &layer; curr; curr = curr->parent()) {552 for (auto* curr = &layer; curr; curr = curr->parent()) { 553 553 if (curr->hasTransform() || curr->usesAcceleratedScrolling()) 554 554 return true; … … 589 589 // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist. 590 590 if (shouldClipCompositedBounds()) { 591 RenderView& view = renderer().view();592 RenderLayer* rootLayer = view.layer();591 auto& view = renderer().view(); 592 auto* rootLayer = view.layer(); 593 593 594 594 LayoutRect clippingBounds; … … 624 624 if (!is<RenderWidget>(renderer())) 625 625 return; 626 if ( RenderLayerCompositor* innerCompositor = RenderLayerCompositor::frameContentsCompositor(&downcast<RenderWidget>(renderer()))) {626 if (auto* innerCompositor = RenderLayerCompositor::frameContentsCompositor(&downcast<RenderWidget>(renderer()))) { 627 627 innerCompositor->frameViewDidChangeSize(); 628 628 innerCompositor->frameViewDidChangeLocation(flooredIntPoint(contentsBox().location())); … … 648 648 updateGeometry(); 649 649 compositor().updateRootLayerPosition(); 650 RenderLayer* stackingContainer = m_owningLayer.enclosingStackingContainer();650 auto* stackingContainer = m_owningLayer.enclosingStackingContainer(); 651 651 if (!compositor().compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != &m_owningLayer)) 652 652 compositor().updateCompositingDescendantGeometry(*stackingContainer, *stackingContainer, flags & CompositingChildrenOnly); … … 698 698 updateInternalHierarchy(); 699 699 700 if ( GraphicsLayer* flatteningLayer = tileCacheFlatteningLayer()) {700 if (auto* flatteningLayer = tileCacheFlatteningLayer()) { 701 701 if (layerConfigChanged || flatteningLayer->parent() != m_graphicsLayer.get()) 702 702 m_graphicsLayer->addChild(flatteningLayer); … … 709 709 if (m_owningLayer.hasReflection()) { 710 710 if (m_owningLayer.reflectionLayer()->backing()) { 711 GraphicsLayer* reflectionLayer = m_owningLayer.reflectionLayer()->backing()->graphicsLayer();711 auto* reflectionLayer = m_owningLayer.reflectionLayer()->backing()->graphicsLayer(); 712 712 m_graphicsLayer->setReplicatedByLayer(reflectionLayer); 713 713 } … … 727 727 728 728 if (is<RenderEmbeddedObject>(renderer()) && downcast<RenderEmbeddedObject>(renderer()).allowsAcceleratedCompositing()) { 729 PluginViewBase* pluginViewBase = downcast<PluginViewBase>(downcast<RenderWidget>(renderer()).widget());729 auto* pluginViewBase = downcast<PluginViewBase>(downcast<RenderWidget>(renderer()).widget()); 730 730 #if PLATFORM(IOS) 731 731 if (pluginViewBase && !m_graphicsLayer->contentsLayerForMedia()) { … … 740 740 #if ENABLE(VIDEO) 741 741 else if (is<RenderVideo>(renderer()) && downcast<RenderVideo>(renderer()).shouldDisplayVideo()) { 742 HTMLMediaElement* mediaElement = downcast<HTMLMediaElement>(renderer().element());742 auto* mediaElement = downcast<HTMLMediaElement>(renderer().element()); 743 743 m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(), GraphicsLayer::ContentsLayerForMedia); 744 744 } … … 747 747 else if (renderer().isCanvas() && canvasCompositingStrategy(renderer()) == CanvasAsLayerContents) { 748 748 const HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer().element()); 749 if ( CanvasRenderingContext* context = canvas->renderingContext())749 if (auto* context = canvas->renderingContext()) 750 750 m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer(), GraphicsLayer::ContentsLayerForCanvas); 751 751 layerConfigChanged = true; … … 857 857 { 858 858 if (!m_fromAncestorGraphicsLayer) { 859 RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();859 auto* compositedAncestor = m_renderLayer.ancestorCompositingLayer(); 860 860 LayoutPoint localPointInAncestorRenderLayerCoords = m_renderLayer.convertToLayerCoords(compositedAncestor, m_location, RenderLayer::AdjustForColumns); 861 861 m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords, m_deviceScaleFactor); … … 973 973 m_graphicsLayer->setBackfaceVisibility(style.backfaceVisibility() == BackfaceVisibilityVisible); 974 974 975 RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();975 auto* compositedAncestor = m_owningLayer.ancestorCompositingLayer(); 976 976 LayoutSize ancestorClippingLayerOffset; 977 977 LayoutRect parentGraphicsLayerRect = computeParentGraphicsLayerRect(compositedAncestor, ancestorClippingLayerOffset); … … 1029 1029 // If we have a layer that clips children, position it. 1030 1030 LayoutRect clippingBox; 1031 if ( GraphicsLayer* clipLayer = clippingLayer()) {1031 if (auto* clipLayer = clippingLayer()) { 1032 1032 clippingBox = clipBox(downcast<RenderBox>(renderer())); 1033 1033 // Clipping layer is parented in the primary graphics layer. … … 1063 1063 m_graphicsLayer->setAnchorPoint(anchor); 1064 1064 1065 GraphicsLayer* clipLayer = clippingLayer();1065 auto* clipLayer = clippingLayer(); 1066 1066 if (style.hasPerspective()) { 1067 1067 TransformationMatrix t = owningLayer().perspectiveTransform(); … … 1115 1115 1116 1116 if (m_owningLayer.reflectionLayer() && m_owningLayer.reflectionLayer()->isComposited()) { 1117 RenderLayerBacking* reflectionBacking = m_owningLayer.reflectionLayer()->backing();1117 auto* reflectionBacking = m_owningLayer.reflectionLayer()->backing(); 1118 1118 reflectionBacking->updateGeometry(); 1119 1119 … … 1298 1298 1299 1299 if (m_scrollingLayer) { 1300 GraphicsLayer* superlayer = m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsLayer.get();1300 auto* superlayer = m_childContainmentLayer ? m_childContainmentLayer.get() : m_graphicsLayer.get(); 1301 1301 m_scrollingLayer->removeFromParent(); 1302 1302 superlayer->addChild(m_scrollingLayer.get()); … … 1504 1504 1505 1505 FloatSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer(); 1506 if ( GraphicsLayer* layer = layerForHorizontalScrollbar()) {1506 if (auto* layer = layerForHorizontalScrollbar()) { 1507 1507 IntRect hBarRect = m_owningLayer.rectForHorizontalScrollbar(borderBox); 1508 1508 layer->setPosition(hBarRect.location() - offsetFromRenderer); … … 1516 1516 } 1517 1517 1518 if ( GraphicsLayer* layer = layerForVerticalScrollbar()) {1518 if (auto* layer = layerForVerticalScrollbar()) { 1519 1519 IntRect vBarRect = m_owningLayer.rectForVerticalScrollbar(borderBox); 1520 1520 layer->setPosition(vBarRect.location() - offsetFromRenderer); … … 1528 1528 } 1529 1529 1530 if ( GraphicsLayer* layer = layerForScrollCorner()) {1530 if (auto* layer = layerForScrollCorner()) { 1531 1531 const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect(); 1532 1532 layer->setPosition(scrollCornerAndResizer.location() - offsetFromRenderer); … … 1538 1538 bool RenderLayerBacking::hasUnpositionedOverflowControlsLayers() const 1539 1539 { 1540 if ( GraphicsLayer* layer = layerForHorizontalScrollbar())1540 if (auto* layer = layerForHorizontalScrollbar()) { 1541 1541 if (!layer->drawsContent()) 1542 1542 return true; 1543 1544 if (GraphicsLayer* layer = layerForVerticalScrollbar()) 1543 } 1544 1545 if (auto* layer = layerForVerticalScrollbar()) { 1545 1546 if (!layer->drawsContent()) 1546 1547 return true; 1547 1548 if (GraphicsLayer* layer = layerForScrollCorner()) 1548 } 1549 1550 if (auto* layer = layerForScrollCorner()) { 1549 1551 if (!layer->drawsContent()) 1550 1552 return true; 1553 } 1551 1554 1552 1555 return false; … … 1782 1785 float finalOpacity = rendererOpacity; 1783 1786 1784 for ( RenderLayer* curr = m_owningLayer.parent(); curr; curr = curr->parent()) {1787 for (auto* curr = m_owningLayer.parent(); curr; curr = curr->parent()) { 1785 1788 // We only care about parents that are stacking contexts. 1786 1789 // Recall that opacity creates stacking context. … … 1996 1999 return false; 1997 2000 1998 HTMLFrameOwnerElement& element = downcast<RenderEmbeddedObject>(renderer).frameOwnerElement();2001 auto& element = downcast<RenderEmbeddedObject>(renderer).frameOwnerElement(); 1999 2002 if (!is<HTMLPlugInElement>(element)) 2000 2003 return false; … … 2171 2174 2172 2175 auto& imageRenderer = downcast<RenderImage>(renderer()); 2173 if ( CachedImage* cachedImage = imageRenderer.cachedImage()) {2176 if (auto* cachedImage = imageRenderer.cachedImage()) { 2174 2177 if (!cachedImage->hasImage()) 2175 2178 return false; 2176 2179 2177 Image* image = cachedImage->imageForRenderer(&imageRenderer);2180 auto* image = cachedImage->imageForRenderer(&imageRenderer); 2178 2181 if (!image->isBitmapImage()) 2179 2182 return false; … … 2225 2228 auto& imageRenderer = downcast<RenderImage>(renderer()); 2226 2229 2227 CachedImage* cachedImage = imageRenderer.cachedImage();2230 auto* cachedImage = imageRenderer.cachedImage(); 2228 2231 if (!cachedImage) 2229 2232 return; 2230 2233 2231 Image* image = cachedImage->imageForRenderer(&imageRenderer);2234 auto* image = cachedImage->imageForRenderer(&imageRenderer); 2232 2235 if (!image) 2233 2236 return; … … 2382 2385 ASSERT(!paintsIntoCompositedAncestor()); 2383 2386 2384 FrameView& frameView = renderer().view().frameView();2387 auto& frameView = renderer().view().frameView(); 2385 2388 if (m_isMainFrameRenderViewLayer && frameView.isTrackingRepaints()) 2386 2389 frameView.addTrackedRepaintRect(owningLayer().absoluteBoundingBoxForPainting()); … … 2390 2393 // So if the TiledBacking has a margin that needs to be invalidated, we need to send in a rect to setNeedsDisplayInRect 2391 2394 // that is large enough to include the margin. TiledBacking::bounds() includes the margin. 2392 TiledBacking* tiledBacking = this->tiledBacking();2395 auto* tiledBacking = this->tiledBacking(); 2393 2396 FloatRect rectToRepaint = tiledBacking ? tiledBacking->bounds() : FloatRect(FloatPoint(0, 0), m_graphicsLayer->size()); 2394 2397 m_graphicsLayer->setNeedsDisplayInRect(rectToRepaint, shouldClip); … … 2417 2420 2418 2421 FloatRect pixelSnappedRectForPainting = snapRectToDevicePixels(r, deviceScaleFactor()); 2419 FrameView& frameView = renderer().view().frameView();2422 auto& frameView = renderer().view().frameView(); 2420 2423 if (m_isMainFrameRenderViewLayer && frameView.isTrackingRepaints()) 2421 2424 frameView.addTrackedRepaintRect(pixelSnappedRectForPainting); … … 2610 2613 bool RenderLayerBacking::getCurrentTransform(const GraphicsLayer* graphicsLayer, TransformationMatrix& transform) const 2611 2614 { 2612 GraphicsLayer* transformedLayer = m_contentsContainmentLayer.get() ? m_contentsContainmentLayer.get() : m_graphicsLayer.get();2615 auto* transformedLayer = m_contentsContainmentLayer.get() ? m_contentsContainmentLayer.get() : m_graphicsLayer.get(); 2613 2616 if (graphicsLayer != transformedLayer) 2614 2617 return false; … … 2678 2681 void RenderLayerBacking::logFilledVisibleFreshTile(unsigned blankPixelCount) 2679 2682 { 2680 if ( PerformanceLoggingClient* loggingClient = renderer().page().performanceLoggingClient())2683 if (auto* loggingClient = renderer().page().performanceLoggingClient()) 2681 2684 loggingClient->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::FilledTile, MonotonicTime::now(), blankPixelCount); 2682 2685 } … … 2719 2722 continue; 2720 2723 2721 TimingFunction* tf = currentKeyframe.timingFunction(keyframes.animationName());2724 auto* tf = currentKeyframe.timingFunction(keyframes.animationName()); 2722 2725 2723 2726 bool isFirstOrLastKeyframe = key == 0 || key == 1; … … 2891 2894 LayoutRect RenderLayerBacking::compositedBoundsIncludingMargin() const 2892 2895 { 2893 TiledBacking* tiledBacking = this->tiledBacking();2896 auto* tiledBacking = this->tiledBacking(); 2894 2897 if (!tiledBacking || !tiledBacking->hasMargins()) 2895 2898 return compositedBounds(); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r224078 r224110 431 431 } 432 432 433 FrameView& frameView = m_renderView.frameView();433 auto& frameView = m_renderView.frameView(); 434 434 AnimationUpdateBlock animationUpdateBlock(&frameView.frame().animation()); 435 435 … … 437 437 m_flushingLayers = true; 438 438 439 if ( GraphicsLayer* rootLayer = rootGraphicsLayer()) {439 if (auto* rootLayer = rootGraphicsLayer()) { 440 440 #if PLATFORM(IOS) 441 441 FloatRect exposedRect = frameView.exposedContentRect(); … … 475 475 updateScrollCoordinatedLayersAfterFlush(); 476 476 477 Frame& frame = m_renderView.frameView().frame();477 auto& frame = m_renderView.frameView().frame(); 478 478 for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().traverseNext(&frame)) { 479 RenderView* view = subframe->contentRenderer();479 auto* view = subframe->contentRenderer(); 480 480 if (!view) 481 481 continue; … … 510 510 static void updateScrollingLayerWithClient(RenderLayer& layer, ChromeClient& client) 511 511 { 512 RenderLayerBacking* backing = layer.backing();512 auto* backing = layer.backing(); 513 513 ASSERT(backing); 514 514 … … 542 542 #endif 543 543 544 RenderLayerBacking* backing = layer.backing();544 auto* backing = layer.backing(); 545 545 if (backing->backgroundLayerPaintsFixedRootBackground() && graphicsLayer == backing->backgroundLayer()) 546 546 fixedRootBackgroundLayerChanged(); … … 549 549 void RenderLayerCompositor::didPaintBacking(RenderLayerBacking*) 550 550 { 551 FrameView& frameView = m_renderView.frameView();551 auto& frameView = m_renderView.frameView(); 552 552 frameView.setLastPaintTime(monotonicallyIncreasingTime()); 553 553 if (frameView.milestonesPendingPaint()) … … 557 557 void RenderLayerCompositor::didChangeVisibleRect() 558 558 { 559 GraphicsLayer* rootLayer = rootGraphicsLayer();559 auto* rootLayer = rootGraphicsLayer(); 560 560 if (!rootLayer) 561 561 return; … … 601 601 RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const 602 602 { 603 for ( Frame* frame = &m_renderView.frameView().frame(); frame; frame = frame->tree().parent()) {604 RenderLayerCompositor* compositor = frame->contentRenderer() ? &frame->contentRenderer()->compositor() : nullptr;603 for (auto* frame = &m_renderView.frameView().frame(); frame; frame = frame->tree().parent()) { 604 auto* compositor = frame->contentRenderer() ? &frame->contentRenderer()->compositor() : nullptr; 605 605 if (compositor->isFlushingLayers()) 606 606 return compositor; … … 723 723 m_secondaryBackingStoreBytes = 0; 724 724 725 Frame& frame = m_renderView.frameView().frame();725 auto& frame = m_renderView.frameView().frame(); 726 726 bool isMainFrame = isMainFrameCompositor(); 727 727 LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree().uniqueName().string().utf8().data()); … … 779 779 return; 780 780 781 Frame& frame = m_renderView.frameView().frame();781 auto& frame = m_renderView.frameView().frame(); 782 782 childList.append(&frame.mainFrame().pageOverlayController().layerWithDocumentOverlays()); 783 783 } … … 798 798 return; 799 799 800 RenderLayerBacking* backing = layer.backing();800 auto* backing = layer.backing(); 801 801 if (requiresCompositingLayer(layer) || layer.isRenderViewLayer()) { 802 802 ++m_obligateCompositedLayerCount; … … 869 869 static bool checkIfDescendantClippingContextNeedsUpdate(const RenderLayer& layer, bool isClipping) 870 870 { 871 for ( RenderLayer* child = layer.firstChild(); child; child = child->nextSibling()) {872 RenderLayerBacking* backing = child->backing();871 for (auto* child = layer.firstChild(); child; child = child->nextSibling()) { 872 auto* backing = child->backing(); 873 873 if (backing && (isClipping || backing->hasAncestorClippingLayer())) 874 874 return true; … … 901 901 // FIXME: need to check everything that we consult to avoid backing store here: webkit.org/b/138383 902 902 if (!oldStyle.opacity() != !newStyle.opacity()) { 903 RenderLayerModelObject* repaintContainer = layer.renderer().containerForRepaint();904 if ( RenderLayerBacking* ancestorBacking = repaintContainer ? repaintContainer->layer()->backing() : nullptr) {903 auto* repaintContainer = layer.renderer().containerForRepaint(); 904 if (auto* ancestorBacking = repaintContainer ? repaintContainer->layer()->backing() : nullptr) { 905 905 if (static_cast<bool>(newStyle.opacity()) != ancestorBacking->graphicsLayer()->drawsContent()) 906 906 return true; … … 982 982 return false; 983 983 984 ClipPathOperation& clipPath = *layer.renderer().style().clipPath();984 auto& clipPath = *layer.renderer().style().clipPath(); 985 985 return (clipPath.type() != ClipPathOperation::Shape || clipPath.type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape); 986 986 } … … 988 988 static RenderLayerModelObject& rendererForCompositingTests(const RenderLayer& layer) 989 989 { 990 RenderLayerModelObject* renderer = &layer.renderer();990 auto* renderer = &layer.renderer(); 991 991 992 992 // The compositing state of a reflection should match that of its reflected layer. … … 1026 1026 if (layer.isRenderViewLayer() && useCoordinatedScrollingForLayer(layer)) { 1027 1027 updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); 1028 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())1028 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 1029 1029 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 1030 1030 #if ENABLE(RUBBER_BANDING) … … 1034 1034 updateRootContentLayerClipping(); 1035 1035 1036 if ( TiledBacking* tiledBacking = layer.backing()->tiledBacking())1036 if (auto* tiledBacking = layer.backing()->tiledBacking()) 1037 1037 tiledBacking->setTopContentInset(m_renderView.frameView().topContentInset()); 1038 1038 } … … 1051 1051 // are both either composited, or not composited. 1052 1052 if (layer.isReflection()) { 1053 RenderLayer* sourceLayer = downcast<RenderLayerModelObject>(*layer.renderer().parent()).layer();1054 if ( RenderLayerBacking* backing = sourceLayer->backing()) {1053 auto* sourceLayer = downcast<RenderLayerModelObject>(*layer.renderer().parent()).layer(); 1054 if (auto* backing = sourceLayer->backing()) { 1055 1055 ASSERT(backing->graphicsLayer()->replicaLayer() == layer.backing()->graphicsLayer()); 1056 1056 backing->graphicsLayer()->setReplicatedByLayer(nullptr); … … 1081 1081 1082 1082 if (layerChanged && is<RenderWidget>(layer.renderer())) { 1083 RenderLayerCompositor* innerCompositor = frameContentsCompositor(&downcast<RenderWidget>(layer.renderer()));1083 auto* innerCompositor = frameContentsCompositor(&downcast<RenderWidget>(layer.renderer())); 1084 1084 if (innerCompositor && innerCompositor->inCompositingMode()) 1085 1085 innerCompositor->updateRootLayerAttachment(); … … 1097 1097 } 1098 1098 if (layerChanged) { 1099 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())1099 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 1100 1100 scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.frameView()); 1101 1101 } … … 1127 1127 return; 1128 1128 1129 RenderLayerModelObject* repaintContainer = layer.renderer().containerForRepaint();1129 auto* repaintContainer = layer.renderer().containerForRepaint(); 1130 1130 if (!repaintContainer) 1131 1131 repaintContainer = &m_renderView; … … 1143 1143 void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer& layer, const LayoutRect& rect) 1144 1144 { 1145 RenderLayer* compositedAncestor = layer.enclosingCompositingLayerForRepaint(ExcludeSelf);1145 auto* compositedAncestor = layer.enclosingCompositingLayerForRepaint(ExcludeSelf); 1146 1146 if (!compositedAncestor) 1147 1147 return; … … 1177 1177 RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const RenderLayer& layer) const 1178 1178 { 1179 for ( RenderLayer* parent = layer.parent(); parent; parent = parent->parent()) {1179 for (auto* parent = layer.parent(); parent; parent = parent->parent()) { 1180 1180 if (parent->isStackingContainer()) 1181 1181 return nullptr; … … 1493 1493 1494 1494 if (parentLayer) { 1495 GraphicsLayer* hostingLayer = parentLayer->backing()->parentForSublayers();1496 GraphicsLayer* hostedLayer = childLayer.backing()->childForSuperlayers();1495 auto* hostingLayer = parentLayer->backing()->parentForSublayers(); 1496 auto* hostedLayer = childLayer.backing()->childForSuperlayers(); 1497 1497 1498 1498 hostingLayer->addChild(hostedLayer); … … 1524 1524 // have been processed. computeCompositingRequirements() will already have done the repaint if necessary. 1525 1525 1526 RenderLayerBacking* layerBacking = layer.backing();1526 auto* layerBacking = layer.backing(); 1527 1527 if (layerBacking) { 1528 1528 // The compositing state of all our children has been updated already, so now … … 1530 1530 layerBacking->updateCompositedBounds(); 1531 1531 1532 if ( RenderLayer* reflection = layer.reflectionLayer()) {1532 if (auto* reflection = layer.reflectionLayer()) { 1533 1533 if (reflection->backing()) 1534 1534 reflection->backing()->updateCompositedBounds(); … … 1591 1591 // Otherwise, the overflow control layers are normal children. 1592 1592 if (!layerBacking->hasClippingLayer() && !layerBacking->hasScrollingLayer()) { 1593 if ( GraphicsLayer* overflowControlLayer = layerBacking->layerForHorizontalScrollbar()) {1593 if (auto* overflowControlLayer = layerBacking->layerForHorizontalScrollbar()) { 1594 1594 overflowControlLayer->removeFromParent(); 1595 1595 layerBacking->parentForSublayers()->addChild(overflowControlLayer); 1596 1596 } 1597 1597 1598 if ( GraphicsLayer* overflowControlLayer = layerBacking->layerForVerticalScrollbar()) {1598 if (auto* overflowControlLayer = layerBacking->layerForVerticalScrollbar()) { 1599 1599 overflowControlLayer->removeFromParent(); 1600 1600 layerBacking->parentForSublayers()->addChild(overflowControlLayer); 1601 1601 } 1602 1602 1603 if ( GraphicsLayer* overflowControlLayer = layerBacking->layerForScrollCorner()) {1603 if (auto* overflowControlLayer = layerBacking->layerForScrollCorner()) { 1604 1604 overflowControlLayer->removeFromParent(); 1605 1605 layerBacking->parentForSublayers()->addChild(overflowControlLayer); … … 1610 1610 } 1611 1611 1612 if ( RenderLayerBacking* layerBacking = layer.backing())1612 if (auto* layerBacking = layer.backing()) 1613 1613 layerBacking->updateAfterDescendants(); 1614 1614 } … … 1641 1641 bool RenderLayerCompositor::hasCoordinatedScrolling() const 1642 1642 { 1643 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();1643 auto* scrollingCoordinator = this->scrollingCoordinator(); 1644 1644 return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()); 1645 1645 } … … 1649 1649 ASSERT(m_scrollLayer); 1650 1650 1651 FrameView& frameView = m_renderView.frameView();1651 auto& frameView = m_renderView.frameView(); 1652 1652 IntPoint scrollPosition = frameView.scrollPosition(); 1653 1653 1654 1654 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y())); 1655 1655 1656 if ( GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer())1656 if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer()) 1657 1657 fixedBackgroundLayer->setPosition(frameView.scrollPositionForFixedPosition()); 1658 1658 } … … 1660 1660 FloatPoint RenderLayerCompositor::positionForClipLayer() const 1661 1661 { 1662 FrameView& frameView = m_renderView.frameView();1662 auto& frameView = m_renderView.frameView(); 1663 1663 1664 1664 return FloatPoint( … … 1690 1690 void RenderLayerCompositor::frameViewDidLayout() 1691 1691 { 1692 RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing(); 1693 if (renderViewBacking) 1692 if (auto* renderViewBacking = m_renderView.layer()->backing()) 1694 1693 renderViewBacking->adjustTiledBackingCoverage(); 1695 1694 } … … 1697 1696 void RenderLayerCompositor::rootFixedBackgroundsChanged() 1698 1697 { 1699 RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();1698 auto* renderViewBacking = m_renderView.layer()->backing(); 1700 1699 if (renderViewBacking && renderViewBacking->isFrameLayerWithTiledBacking()) 1701 1700 setCompositingLayersNeedRebuild(); … … 1704 1703 void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer& layer) 1705 1704 { 1706 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())1705 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 1707 1706 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); 1708 1707 } … … 1763 1762 RenderLayerCompositor* RenderLayerCompositor::frameContentsCompositor(RenderWidget* renderer) 1764 1763 { 1765 if ( Document* contentDocument = renderer->frameOwnerElement().contentDocument()) {1766 if ( RenderView* view = contentDocument->renderView())1764 if (auto* contentDocument = renderer->frameOwnerElement().contentDocument()) { 1765 if (auto* view = contentDocument->renderView()) 1767 1766 return &view->compositor(); 1768 1767 } … … 1772 1771 bool RenderLayerCompositor::parentFrameContentLayers(RenderWidget* renderer) 1773 1772 { 1774 RenderLayerCompositor* innerCompositor = frameContentsCompositor(renderer);1773 auto* innerCompositor = frameContentsCompositor(renderer); 1775 1774 if (!innerCompositor || !innerCompositor->inCompositingMode() || innerCompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame) 1776 1775 return false; 1777 1776 1778 RenderLayer* layer = renderer->layer();1777 auto* layer = renderer->layer(); 1779 1778 if (!layer->isComposited()) 1780 1779 return false; 1781 1780 1782 RenderLayerBacking* backing = layer->backing();1783 GraphicsLayer* hostingLayer = backing->parentForSublayers();1784 GraphicsLayer* rootLayer = innerCompositor->rootGraphicsLayer();1781 auto* backing = layer->backing(); 1782 auto* hostingLayer = backing->parentForSublayers(); 1783 auto* rootLayer = innerCompositor->rootGraphicsLayer(); 1785 1784 if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != rootLayer) { 1786 1785 hostingLayer->removeAllChildren(); … … 1793 1792 void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer& layer, int depth) 1794 1793 { 1795 if ( RenderLayerBacking* layerBacking = layer.backing()) {1794 if (auto* layerBacking = layer.backing()) { 1796 1795 // The compositing state of all our children has been updated already, so now 1797 1796 // we can compute and cache the composited bounds for this layer. 1798 1797 layerBacking->updateCompositedBounds(); 1799 1798 1800 if ( RenderLayer* reflection = layer.reflectionLayer()) {1799 if (auto* reflection = layer.reflectionLayer()) { 1801 1800 if (reflection->backing()) 1802 1801 reflection->backing()->updateCompositedBounds(); … … 1835 1834 } 1836 1835 1837 if ( RenderLayerBacking* layerBacking = layer.backing())1836 if (auto* layerBacking = layer.backing()) 1838 1837 layerBacking->updateAfterDescendants(); 1839 1838 } … … 1843 1842 { 1844 1843 if (&layer != &compositingAncestor) { 1845 if ( RenderLayerBacking* layerBacking = layer.backing()) {1844 if (auto* layerBacking = layer.backing()) { 1846 1845 layerBacking->updateCompositedBounds(); 1847 1846 1848 if ( RenderLayer* reflection = layer.reflectionLayer()) {1847 if (auto* reflection = layer.reflectionLayer()) { 1849 1848 if (reflection->backing()) 1850 1849 reflection->backing()->updateCompositedBounds(); … … 1885 1884 1886 1885 if (&layer != &compositingAncestor) { 1887 if ( RenderLayerBacking* layerBacking = layer.backing())1886 if (auto* layerBacking = layer.backing()) 1888 1887 layerBacking->updateAfterDescendants(); 1889 1888 } … … 1941 1940 return; 1942 1941 1943 if ( GraphicsLayer* rootLayer = rootGraphicsLayer()) {1942 if (auto* rootLayer = rootGraphicsLayer()) { 1944 1943 GraphicsLayer::traverse(*rootLayer, [isInWindow](GraphicsLayer& layer) { 1945 1944 layer.setIsInWindow(isInWindow); … … 1976 1975 } 1977 1976 1978 for ( RenderLayer* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling())1977 for (auto* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling()) 1979 1978 clearBackingForLayerIncludingDescendants(*childLayer); 1980 1979 } … … 2304 2303 return false; 2305 2304 2306 RenderLayer* compositingAncestor = layer.ancestorCompositingLayer();2305 auto* compositingAncestor = layer.ancestorCompositingLayer(); 2307 2306 if (!compositingAncestor) 2308 2307 return false; … … 2313 2312 // in this case it is not allowed to clipsCompositingDescendants() and each of its children 2314 2313 // will be clippedByAncestor()s, including the compositingAncestor. 2315 RenderLayer* computeClipRoot = compositingAncestor;2314 auto* computeClipRoot = compositingAncestor; 2316 2315 if (!compositingAncestor->isolatesCompositedBlending()) { 2317 2316 computeClipRoot = nullptr; 2318 RenderLayer* parent = &layer;2317 auto* parent = &layer; 2319 2318 while (parent) { 2320 RenderLayer* next = parent->parent();2319 auto* next = parent->parent(); 2321 2320 if (next == compositingAncestor) { 2322 2321 computeClipRoot = parent; … … 2381 2380 2382 2381 // FIXME: workaround for webkit.org/b/132801 2383 RenderLayer* stackingContext = renderer.layer()->stackingContainer();2382 auto* stackingContext = renderer.layer()->stackingContainer(); 2384 2383 if (stackingContext && stackingContext->renderer().style().transformStyle3D() == TransformStyle3DPreserve3D) 2385 2384 return true; … … 2412 2411 bool isCanvasLargeEnoughToForceCompositing = true; 2413 2412 #else 2414 HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer.element());2413 auto* canvas = downcast<HTMLCanvasElement>(renderer.element()); 2415 2414 auto canvasArea = canvas->size().area<RecordOverflow>(); 2416 2415 bool isCanvasLargeEnoughToForceCompositing = !canvasArea.hasOverflowed() && canvasArea.unsafeGet() >= canvasAreaThresholdRequiringCompositing; … … 2434 2433 m_reevaluateCompositingAfterLayout = true; 2435 2434 2436 RenderWidget& pluginRenderer = downcast<RenderWidget>(renderer);2435 auto& pluginRenderer = downcast<RenderWidget>(renderer); 2437 2436 if (pluginRenderer.style().visibility() != VISIBLE) 2438 2437 return false; … … 2475 2474 2476 2475 const AnimationBase::RunningState activeAnimationState = AnimationBase::Running | AnimationBase::Paused; 2477 CSSAnimationController& animController = renderer.animation();2476 auto& animController = renderer.animation(); 2478 2477 return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity, activeAnimationState) 2479 2478 && (inCompositingMode() || (m_compositingTriggers & ChromeClient::AnimatedOpacityTrigger))) … … 2487 2486 bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const 2488 2487 { 2489 RenderLayer& layer = *downcast<RenderBoxModelObject>(renderer).layer();2488 auto& layer = *downcast<RenderBoxModelObject>(renderer).layer(); 2490 2489 2491 2490 // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented … … 2561 2560 ASSERT(layer.renderer().isStickyPositioned()); 2562 2561 2563 RenderLayer* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf);2562 auto* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf); 2564 2563 2565 2564 #if PLATFORM(IOS) … … 2597 2596 2598 2597 // FIXME: Handle fixed inside of a transform, which should not behave as fixed. 2599 for ( RenderLayer* stackingContainer = layer.stackingContainer(); stackingContainer; stackingContainer = stackingContainer->stackingContainer()) {2598 for (auto* stackingContainer = layer.stackingContainer(); stackingContainer; stackingContainer = stackingContainer->stackingContainer()) { 2600 2599 if (stackingContainer->isComposited() && stackingContainer->renderer().style().position() == FixedPosition) 2601 2600 return false; … … 2725 2724 bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const 2726 2725 { 2727 FrameView& frameView = m_renderView.frameView();2726 auto& frameView = m_renderView.frameView(); 2728 2727 2729 2728 // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it. … … 2770 2769 bool RenderLayerCompositor::supportsFixedRootBackgroundCompositing() const 2771 2770 { 2772 RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();2771 auto* renderViewBacking = m_renderView.layer()->backing(); 2773 2772 return renderViewBacking && renderViewBacking->isFrameLayerWithTiledBacking(); 2774 2773 } … … 2790 2789 { 2791 2790 // Get the fixed root background from the RenderView layer's backing. 2792 RenderLayer* viewLayer = m_renderView.layer();2791 auto* viewLayer = m_renderView.layer(); 2793 2792 if (!viewLayer) 2794 2793 return nullptr; … … 2802 2801 void RenderLayerCompositor::resetTrackedRepaintRects() 2803 2802 { 2804 if ( GraphicsLayer* rootLayer = rootGraphicsLayer()) {2803 if (auto* rootLayer = rootGraphicsLayer()) { 2805 2804 GraphicsLayer::traverse(*rootLayer, [](GraphicsLayer& layer) { 2806 2805 layer.resetTrackedRepaints(); … … 2828 2827 #if PLATFORM(IOS) 2829 2828 LegacyTileCache* tileCache = nullptr; 2830 if ( FrameView* frameView = page().mainFrame().view())2829 if (auto* frameView = page().mainFrame().view()) 2831 2830 tileCache = frameView->legacyTileCache(); 2832 2831 … … 2847 2846 bool RenderLayerCompositor::documentUsesTiledBacking() const 2848 2847 { 2849 RenderLayer* layer = m_renderView.layer();2848 auto* layer = m_renderView.layer(); 2850 2849 if (!layer) 2851 2850 return false; 2852 2851 2853 RenderLayerBacking* backing = layer->backing();2852 auto* backing = layer->backing(); 2854 2853 if (!backing) 2855 2854 return false; … … 2865 2864 bool RenderLayerCompositor::shouldCompositeOverflowControls() const 2866 2865 { 2867 FrameView& frameView = m_renderView.frameView();2866 auto& frameView = m_renderView.frameView(); 2868 2867 2869 2868 if (frameView.platformWidget()) … … 2991 2990 // The ScrollingTree knows about the header layer, and the position of the root layer is affected 2992 2991 // by the header layer, so if we remove the header, we need to tell the scrolling tree. 2993 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())2992 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 2994 2993 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 2995 2994 } … … 3009 3008 m_layerForHeader->setSize(FloatSize(m_renderView.frameView().visibleWidth(), m_renderView.frameView().headerHeight())); 3010 3009 3011 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3010 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3012 3011 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3013 3012 … … 3029 3028 // The ScrollingTree knows about the footer layer, and the total scrollable size is affected 3030 3029 // by the footer layer, so if we remove the footer, we need to tell the scrolling tree. 3031 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3030 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3032 3031 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3033 3032 } … … 3047 3046 m_layerForFooter->setSize(FloatSize(m_renderView.frameView().visibleWidth(), m_renderView.frameView().footerHeight())); 3048 3047 3049 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3048 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3050 3049 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView()); 3051 3050 … … 3192 3191 m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get()); 3193 3192 3194 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3193 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3195 3194 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3196 3195 } … … 3199 3198 m_layerForHorizontalScrollbar = nullptr; 3200 3199 3201 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3200 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3202 3201 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3203 3202 } … … 3214 3213 m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get()); 3215 3214 3216 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3215 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3217 3216 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3218 3217 } … … 3221 3220 m_layerForVerticalScrollbar = nullptr; 3222 3221 3223 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3222 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3224 3223 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3225 3224 } … … 3259 3258 #if PLATFORM(IOS) 3260 3259 // Page scale is applied above this on iOS, so we'll just say that our root layer applies it. 3261 Frame& frame = m_renderView.frameView().frame();3260 auto& frame = m_renderView.frameView().frame(); 3262 3261 if (frame.isMainFrame()) 3263 3262 m_rootContentLayer->setAppliesPageScale(); … … 3333 3332 m_layerForHorizontalScrollbar->removeFromParent(); 3334 3333 m_layerForHorizontalScrollbar = nullptr; 3335 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3334 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3336 3335 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar); 3337 if ( Scrollbar* horizontalScrollbar = m_renderView.frameView().verticalScrollbar())3336 if (auto* horizontalScrollbar = m_renderView.frameView().verticalScrollbar()) 3338 3337 m_renderView.frameView().invalidateScrollbar(*horizontalScrollbar, IntRect(IntPoint(0, 0), horizontalScrollbar->frameRect().size())); 3339 3338 } … … 3342 3341 m_layerForVerticalScrollbar->removeFromParent(); 3343 3342 m_layerForVerticalScrollbar = nullptr; 3344 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())3343 if (auto* scrollingCoordinator = this->scrollingCoordinator()) 3345 3344 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar); 3346 if ( Scrollbar* verticalScrollbar = m_renderView.frameView().verticalScrollbar())3345 if (auto* verticalScrollbar = m_renderView.frameView().verticalScrollbar()) 3347 3346 m_renderView.frameView().invalidateScrollbar(*verticalScrollbar, IntRect(IntPoint(0, 0), verticalScrollbar->frameRect().size())); 3348 3347 } … … 3376 3375 break; 3377 3376 case RootLayerAttachedViaChromeClient: { 3378 Frame& frame = m_renderView.frameView().frame();3377 auto& frame = m_renderView.frameView().frame(); 3379 3378 page().chrome().client().attachRootGraphicsLayer(frame, rootGraphicsLayer()); 3380 3379 if (frame.isMainFrame()) … … 3414 3413 m_rootContentLayer->removeFromParent(); 3415 3414 3416 if ( HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement())3415 if (auto* ownerElement = m_renderView.document().ownerElement()) 3417 3416 ownerElement->scheduleInvalidateStyleAndLayerComposition(); 3418 3417 break; 3419 3418 } 3420 3419 case RootLayerAttachedViaChromeClient: { 3421 Frame& frame = m_renderView.frameView().frame();3420 auto& frame = m_renderView.frameView().frame(); 3422 3421 page().chrome().client().attachRootGraphicsLayer(frame, nullptr); 3423 3422 if (frame.isMainFrame()) { … … 3448 3447 return; 3449 3448 3450 Frame& frame = m_renderView.frameView().frame();3449 auto& frame = m_renderView.frameView().frame(); 3451 3450 3452 3451 // The attachment can affect whether the RenderView layer's paintsIntoWindow() behavior, 3453 3452 // so call updateDrawsContent() to update that. 3454 RenderLayer* layer = m_renderView.layer();3455 if ( RenderLayerBacking* backing = layer ? layer->backing() : nullptr)3453 auto* layer = m_renderView.layer(); 3454 if (auto* backing = layer ? layer->backing() : nullptr) 3456 3455 backing->updateDrawsContent(); 3457 3456 … … 3466 3465 // Compositing affects the answer to RenderIFrame::requiresAcceleratedCompositing(), so 3467 3466 // we need to schedule a style recalc in our parent document. 3468 if ( HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement())3467 if (auto* ownerElement = m_renderView.document().ownerElement()) 3469 3468 ownerElement->scheduleInvalidateStyleAndLayerComposition(); 3470 3469 } … … 3511 3510 // Page scale will only be applied at to the RenderView and sublayers, but the device scale factor 3512 3511 // needs to be applied at the level of rootGraphicsLayer(). 3513 GraphicsLayer* rootLayer = rootGraphicsLayer(); 3514 if (rootLayer) 3512 if (auto* rootLayer = rootGraphicsLayer()) 3515 3513 rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants(); 3516 3514 } … … 3551 3549 ASSERT(layer.isComposited()); 3552 3550 3553 GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();3551 auto* graphicsLayer = layer.backing()->graphicsLayer(); 3554 3552 3555 3553 FixedPositionViewportConstraints constraints; … … 3591 3589 #endif 3592 3590 3593 RenderBoxModelObject& renderer = downcast<RenderBoxModelObject>(layer.renderer());3591 auto& renderer = downcast<RenderBoxModelObject>(layer.renderer()); 3594 3592 3595 3593 StickyPositionViewportConstraints constraints; 3596 3594 renderer.computeStickyPositionConstraints(constraints, renderer.constrainingRectForStickyPosition()); 3597 3595 3598 GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();3596 auto* graphicsLayer = layer.backing()->graphicsLayer(); 3599 3597 constraints.setLayerPositionAtLastLayout(graphicsLayer->position()); 3600 3598 constraints.setStickyOffsetAtLastLayout(renderer.stickyPositionOffset()); … … 3606 3604 static ScrollingNodeID enclosingScrollingNodeID(RenderLayer& layer, IncludeSelfOrNot includeSelf) 3607 3605 { 3608 RenderLayer* currLayer = includeSelf == IncludeSelf ? &layer : layer.parent();3606 auto* currLayer = includeSelf == IncludeSelf ? &layer : layer.parent(); 3609 3607 while (currLayer) { 3610 if ( RenderLayerBacking* backing = currLayer->backing()) {3608 if (auto* backing = currLayer->backing()) { 3611 3609 if (ScrollingNodeID nodeID = backing->scrollingNodeIDForChildren()) 3612 3610 return nodeID; … … 3624 3622 3625 3623 // Find the frame's enclosing layer in our render tree. 3626 HTMLFrameOwnerElement* ownerElement = frame.document()->ownerElement();3627 RenderElement* frameRenderer = ownerElement ? ownerElement->renderer() : nullptr;3624 auto* ownerElement = frame.document()->ownerElement(); 3625 auto* frameRenderer = ownerElement ? ownerElement->renderer() : nullptr; 3628 3626 if (!frameRenderer) 3629 3627 return 0; 3630 3628 3631 RenderLayer* layerInParentDocument = frameRenderer->enclosingLayer();3629 auto* layerInParentDocument = frameRenderer->enclosingLayer(); 3632 3630 if (!layerInParentDocument) 3633 3631 return 0; … … 3643 3641 m_subframeScrollLayersNeedReattach = false; 3644 3642 3645 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();3643 auto* scrollingCoordinator = this->scrollingCoordinator(); 3646 3644 3647 3645 for (Frame* child = m_renderView.frameView().frame().tree().firstChild(); child; child = child->tree().nextSibling()) { … … 3650 3648 3651 3649 // Ignore frames that are not scroll-coordinated. 3652 FrameView* childFrameView = child->view();3650 auto* childFrameView = child->view(); 3653 3651 ScrollingNodeID frameScrollingNodeID = childFrameView->scrollLayerID(); 3654 3652 if (!frameScrollingNodeID) … … 3679 3677 ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, ScrollingNodeType nodeType, ScrollingNodeID parentNodeID) 3680 3678 { 3681 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();3682 RenderLayerBacking* backing = layer.backing();3679 auto* scrollingCoordinator = this->scrollingCoordinator(); 3680 auto* backing = layer.backing(); 3683 3681 // Crash logs suggest that backing can be null here, but we don't know how: rdar://problem/18545452. 3684 3682 ASSERT(backing); … … 3703 3701 void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer, LayerScrollCoordinationRoles roles) 3704 3702 { 3705 RenderLayerBacking* backing = layer.backing();3703 auto* backing = layer.backing(); 3706 3704 if (!backing) 3707 3705 return; … … 3722 3720 void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID) 3723 3721 { 3724 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();3722 auto* scrollingCoordinator = this->scrollingCoordinator(); 3725 3723 ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())); 3726 3724 … … 3731 3729 void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, LayerScrollCoordinationRoles reasons, OptionSet<ScrollingNodeChangeFlags> changes) 3732 3730 { 3733 ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();3731 auto* scrollingCoordinator = this->scrollingCoordinator(); 3734 3732 if (!scrollingCoordinator || !scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())) 3735 3733 return; … … 3743 3741 ASSERT(layer.isComposited()); 3744 3742 3745 RenderLayerBacking* backing = layer.backing();3743 auto* backing = layer.backing(); 3746 3744 if (!backing) 3747 3745 return; … … 3904 3902 { 3905 3903 for (auto* layer : m_scrollingLayers) { 3906 RenderLayerBacking* backing = layer->backing();3904 auto* backing = layer->backing(); 3907 3905 ASSERT(backing); 3908 3906 page().chrome().client().removeScrollingLayer(layer->renderer().element(), backing->scrollingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer()); … … 3913 3911 void RenderLayerCompositor::willRemoveScrollingLayerWithBacking(RenderLayer& layer, RenderLayerBacking& backing) 3914 3912 { 3915 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {3913 if (auto* scrollingCoordinator = this->scrollingCoordinator()) { 3916 3914 backing.detachFromScrollingCoordinator(Scrolling); 3917 3915 … … 3928 3926 return; 3929 3927 3930 PlatformLayer* scrollingLayer = backing.scrollingLayer()->platformLayer();3931 PlatformLayer* contentsLayer = backing.scrollingContentsLayer()->platformLayer();3928 auto* scrollingLayer = backing.scrollingLayer()->platformLayer(); 3929 auto* contentsLayer = backing.scrollingContentsLayer()->platformLayer(); 3932 3930 page().chrome().client().removeScrollingLayer(layer.renderer().element(), scrollingLayer, contentsLayer); 3933 3931 #endif … … 3938 3936 updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); 3939 3937 3940 if ( ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {3938 if (auto* scrollingCoordinator = this->scrollingCoordinator()) { 3941 3939 // For Coordinated Graphics. 3942 3940 scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer); … … 4033 4031 void RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView(const FrameView& frameView) 4034 4032 { 4035 if ( ScrollingCoordinator* coordinator = scrollingCoordinator())4033 if (auto* coordinator = scrollingCoordinator()) 4036 4034 coordinator->updateScrollSnapPropertiesWithFrameView(frameView); 4037 4035 }
Note: See TracChangeset
for help on using the changeset viewer.