Changeset 224110 in webkit


Ignore:
Timestamp:
Oct 27, 2017 7:38:41 AM (6 years ago)
Author:
fred.wang@free.fr
Message:

Use auto for some variables in RenderLayerCompositor/Backing
https://bugs.webkit.org/show_bug.cgi?id=178570

Patch by Frederic Wang <fwang@igalia.com> on 2017-10-27
Reviewed by Darin Adler.

No new tests, behavior unchanged.

  • rendering/RenderLayerBacking.cpp:

(WebCore::canvasCompositingStrategy):
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computePageTiledBackingCoverage):
(WebCore::RenderLayerBacking::layerWillBeDestroyed):
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const):
(WebCore::RenderLayerBacking::compositingOpacity const):
(WebCore::isRestartedPlugin):
(WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::getCurrentTransform const):
(WebCore::RenderLayerBacking::logFilledVisibleFreshTile):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::compositedBoundsIncludingMargin const):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlushIncludingSubframes):
(WebCore::updateScrollingLayerWithClient):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer):
(WebCore::RenderLayerCompositor::didPaintBacking):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::checkIfDescendantClippingContextNeedsUpdate):
(WebCore::styleChangeRequiresLayerRebuild):
(WebCore::RenderLayerCompositor::canCompositeClipPath):
(WebCore::rendererForCompositingTests):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::repaintOnCompositingChange):
(WebCore::RenderLayerCompositor::repaintInCompositedAncestor):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::hasCoordinatedScrolling const):
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::positionForClipLayer const):
(WebCore::RenderLayerCompositor::frameViewDidLayout):
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged):
(WebCore::RenderLayerCompositor::scrollingLayerDidChange):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::requiresScrollLayer const):
(WebCore::RenderLayerCompositor::supportsFixedRootBackgroundCompositing const):
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayer const):
(WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
(WebCore::RenderLayerCompositor::documentUsesTiledBacking const):
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange):
(WebCore::RenderLayerCompositor::deviceOrPageScaleFactorChanged):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints const):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
(WebCore::enclosingScrollingNodeID):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r224107 r224110  
     12017-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
    11082017-10-27  Alicia Boya García  <aboya@igalia.com>
    2109
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r222575 r224110  
    8080   
    8181    const HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer.node());
    82     CanvasRenderingContext* context = canvas->renderingContext();
     82    auto* context = canvas->renderingContext();
    8383    if (!context || !context->isAccelerated())
    8484        return UnacceleratedCanvas;
     
    216216    createPrimaryGraphicsLayer();
    217217
    218     if (TiledBacking* tiledBacking = this->tiledBacking()) {
     218    if (auto* tiledBacking = this->tiledBacking()) {
    219219        tiledBacking->setIsInWindow(renderer().page().isInWindow());
    220220
     
    301301{
    302302    // 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();
    304304
    305305    // If the page is non-visible, don't incur the cost of keeping extra tiles for scrolling.
     
    427427void RenderLayerBacking::layerWillBeDestroyed()
    428428{
    429     RenderObject& renderer = this->renderer();
     429    auto& renderer = this->renderer();
    430430    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());
    432432        if (pluginViewBase && m_graphicsLayer->contentsLayerForMedia())
    433433            pluginViewBase->detachPluginLayer();
     
    509509        return;
    510510
    511     RenderBox& renderer = downcast<RenderBox>(this->renderer());
     511    auto& renderer = downcast<RenderBox>(this->renderer());
    512512    LayoutRect boxRect = renderer.borderBoxRect();
    513513    if (renderer.hasClip())
     
    550550static bool layerOrAncestorIsTransformedOrUsingCompositedScrolling(RenderLayer& layer)
    551551{
    552     for (RenderLayer* curr = &layer; curr; curr = curr->parent()) {
     552    for (auto* curr = &layer; curr; curr = curr->parent()) {
    553553        if (curr->hasTransform() || curr->usesAcceleratedScrolling())
    554554            return true;
     
    589589    // We'd need RenderObject::convertContainerToLocalQuad(), which doesn't yet exist.
    590590    if (shouldClipCompositedBounds()) {
    591         RenderView& view = renderer().view();
    592         RenderLayer* rootLayer = view.layer();
     591        auto& view = renderer().view();
     592        auto* rootLayer = view.layer();
    593593
    594594        LayoutRect clippingBounds;
     
    624624    if (!is<RenderWidget>(renderer()))
    625625        return;
    626     if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::frameContentsCompositor(&downcast<RenderWidget>(renderer()))) {
     626    if (auto* innerCompositor = RenderLayerCompositor::frameContentsCompositor(&downcast<RenderWidget>(renderer()))) {
    627627        innerCompositor->frameViewDidChangeSize();
    628628        innerCompositor->frameViewDidChangeLocation(flooredIntPoint(contentsBox().location()));
     
    648648            updateGeometry();
    649649            compositor().updateRootLayerPosition();
    650             RenderLayer* stackingContainer = m_owningLayer.enclosingStackingContainer();
     650            auto* stackingContainer = m_owningLayer.enclosingStackingContainer();
    651651            if (!compositor().compositingLayersNeedRebuild() && stackingContainer && (stackingContainer != &m_owningLayer))
    652652                compositor().updateCompositingDescendantGeometry(*stackingContainer, *stackingContainer, flags & CompositingChildrenOnly);
     
    698698        updateInternalHierarchy();
    699699
    700     if (GraphicsLayer* flatteningLayer = tileCacheFlatteningLayer()) {
     700    if (auto* flatteningLayer = tileCacheFlatteningLayer()) {
    701701        if (layerConfigChanged || flatteningLayer->parent() != m_graphicsLayer.get())
    702702            m_graphicsLayer->addChild(flatteningLayer);
     
    709709    if (m_owningLayer.hasReflection()) {
    710710        if (m_owningLayer.reflectionLayer()->backing()) {
    711             GraphicsLayer* reflectionLayer = m_owningLayer.reflectionLayer()->backing()->graphicsLayer();
     711            auto* reflectionLayer = m_owningLayer.reflectionLayer()->backing()->graphicsLayer();
    712712            m_graphicsLayer->setReplicatedByLayer(reflectionLayer);
    713713        }
     
    727727
    728728    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());
    730730#if PLATFORM(IOS)
    731731        if (pluginViewBase && !m_graphicsLayer->contentsLayerForMedia()) {
     
    740740#if ENABLE(VIDEO)
    741741    else if (is<RenderVideo>(renderer()) && downcast<RenderVideo>(renderer()).shouldDisplayVideo()) {
    742         HTMLMediaElement* mediaElement = downcast<HTMLMediaElement>(renderer().element());
     742        auto* mediaElement = downcast<HTMLMediaElement>(renderer().element());
    743743        m_graphicsLayer->setContentsToPlatformLayer(mediaElement->platformLayer(), GraphicsLayer::ContentsLayerForMedia);
    744744    }
     
    747747    else if (renderer().isCanvas() && canvasCompositingStrategy(renderer()) == CanvasAsLayerContents) {
    748748        const HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer().element());
    749         if (CanvasRenderingContext* context = canvas->renderingContext())
     749        if (auto* context = canvas->renderingContext())
    750750            m_graphicsLayer->setContentsToPlatformLayer(context->platformLayer(), GraphicsLayer::ContentsLayerForCanvas);
    751751        layerConfigChanged = true;
     
    857857    {
    858858        if (!m_fromAncestorGraphicsLayer) {
    859             RenderLayer* compositedAncestor = m_renderLayer.ancestorCompositingLayer();
     859            auto* compositedAncestor = m_renderLayer.ancestorCompositingLayer();
    860860            LayoutPoint localPointInAncestorRenderLayerCoords = m_renderLayer.convertToLayerCoords(compositedAncestor, m_location, RenderLayer::AdjustForColumns);
    861861            m_fromAncestorGraphicsLayer = computeOffsetFromAncestorGraphicsLayer(compositedAncestor, localPointInAncestorRenderLayerCoords, m_deviceScaleFactor);
     
    973973    m_graphicsLayer->setBackfaceVisibility(style.backfaceVisibility() == BackfaceVisibilityVisible);
    974974
    975     RenderLayer* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
     975    auto* compositedAncestor = m_owningLayer.ancestorCompositingLayer();
    976976    LayoutSize ancestorClippingLayerOffset;
    977977    LayoutRect parentGraphicsLayerRect = computeParentGraphicsLayerRect(compositedAncestor, ancestorClippingLayerOffset);
     
    10291029    // If we have a layer that clips children, position it.
    10301030    LayoutRect clippingBox;
    1031     if (GraphicsLayer* clipLayer = clippingLayer()) {
     1031    if (auto* clipLayer = clippingLayer()) {
    10321032        clippingBox = clipBox(downcast<RenderBox>(renderer()));
    10331033        // Clipping layer is parented in the primary graphics layer.
     
    10631063            m_graphicsLayer->setAnchorPoint(anchor);
    10641064
    1065         GraphicsLayer* clipLayer = clippingLayer();
     1065        auto* clipLayer = clippingLayer();
    10661066        if (style.hasPerspective()) {
    10671067            TransformationMatrix t = owningLayer().perspectiveTransform();
     
    11151115
    11161116    if (m_owningLayer.reflectionLayer() && m_owningLayer.reflectionLayer()->isComposited()) {
    1117         RenderLayerBacking* reflectionBacking = m_owningLayer.reflectionLayer()->backing();
     1117        auto* reflectionBacking = m_owningLayer.reflectionLayer()->backing();
    11181118        reflectionBacking->updateGeometry();
    11191119       
     
    12981298
    12991299    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();
    13011301        m_scrollingLayer->removeFromParent();
    13021302        superlayer->addChild(m_scrollingLayer.get());
     
    15041504
    15051505    FloatSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer();
    1506     if (GraphicsLayer* layer = layerForHorizontalScrollbar()) {
     1506    if (auto* layer = layerForHorizontalScrollbar()) {
    15071507        IntRect hBarRect = m_owningLayer.rectForHorizontalScrollbar(borderBox);
    15081508        layer->setPosition(hBarRect.location() - offsetFromRenderer);
     
    15161516    }
    15171517   
    1518     if (GraphicsLayer* layer = layerForVerticalScrollbar()) {
     1518    if (auto* layer = layerForVerticalScrollbar()) {
    15191519        IntRect vBarRect = m_owningLayer.rectForVerticalScrollbar(borderBox);
    15201520        layer->setPosition(vBarRect.location() - offsetFromRenderer);
     
    15281528    }
    15291529
    1530     if (GraphicsLayer* layer = layerForScrollCorner()) {
     1530    if (auto* layer = layerForScrollCorner()) {
    15311531        const LayoutRect& scrollCornerAndResizer = m_owningLayer.scrollCornerAndResizerRect();
    15321532        layer->setPosition(scrollCornerAndResizer.location() - offsetFromRenderer);
     
    15381538bool RenderLayerBacking::hasUnpositionedOverflowControlsLayers() const
    15391539{
    1540     if (GraphicsLayer* layer = layerForHorizontalScrollbar())
     1540    if (auto* layer = layerForHorizontalScrollbar()) {
    15411541        if (!layer->drawsContent())
    15421542            return true;
    1543 
    1544     if (GraphicsLayer* layer = layerForVerticalScrollbar())
     1543    }
     1544
     1545    if (auto* layer = layerForVerticalScrollbar()) {
    15451546        if (!layer->drawsContent())
    15461547            return true;
    1547 
    1548     if (GraphicsLayer* layer = layerForScrollCorner())
     1548    }
     1549
     1550    if (auto* layer = layerForScrollCorner()) {
    15491551        if (!layer->drawsContent())
    15501552            return true;
     1553    }
    15511554
    15521555    return false;
     
    17821785    float finalOpacity = rendererOpacity;
    17831786   
    1784     for (RenderLayer* curr = m_owningLayer.parent(); curr; curr = curr->parent()) {
     1787    for (auto* curr = m_owningLayer.parent(); curr; curr = curr->parent()) {
    17851788        // We only care about parents that are stacking contexts.
    17861789        // Recall that opacity creates stacking context.
     
    19961999        return false;
    19972000
    1998     HTMLFrameOwnerElement& element = downcast<RenderEmbeddedObject>(renderer).frameOwnerElement();
     2001    auto& element = downcast<RenderEmbeddedObject>(renderer).frameOwnerElement();
    19992002    if (!is<HTMLPlugInElement>(element))
    20002003        return false;
     
    21712174
    21722175    auto& imageRenderer = downcast<RenderImage>(renderer());
    2173     if (CachedImage* cachedImage = imageRenderer.cachedImage()) {
     2176    if (auto* cachedImage = imageRenderer.cachedImage()) {
    21742177        if (!cachedImage->hasImage())
    21752178            return false;
    21762179
    2177         Image* image = cachedImage->imageForRenderer(&imageRenderer);
     2180        auto* image = cachedImage->imageForRenderer(&imageRenderer);
    21782181        if (!image->isBitmapImage())
    21792182            return false;
     
    22252228    auto& imageRenderer = downcast<RenderImage>(renderer());
    22262229
    2227     CachedImage* cachedImage = imageRenderer.cachedImage();
     2230    auto* cachedImage = imageRenderer.cachedImage();
    22282231    if (!cachedImage)
    22292232        return;
    22302233
    2231     Image* image = cachedImage->imageForRenderer(&imageRenderer);
     2234    auto* image = cachedImage->imageForRenderer(&imageRenderer);
    22322235    if (!image)
    22332236        return;
     
    23822385    ASSERT(!paintsIntoCompositedAncestor());
    23832386
    2384     FrameView& frameView = renderer().view().frameView();
     2387    auto& frameView = renderer().view().frameView();
    23852388    if (m_isMainFrameRenderViewLayer && frameView.isTrackingRepaints())
    23862389        frameView.addTrackedRepaintRect(owningLayer().absoluteBoundingBoxForPainting());
     
    23902393        // So if the TiledBacking has a margin that needs to be invalidated, we need to send in a rect to setNeedsDisplayInRect
    23912394        // that is large enough to include the margin. TiledBacking::bounds() includes the margin.
    2392         TiledBacking* tiledBacking = this->tiledBacking();
     2395        auto* tiledBacking = this->tiledBacking();
    23932396        FloatRect rectToRepaint = tiledBacking ? tiledBacking->bounds() : FloatRect(FloatPoint(0, 0), m_graphicsLayer->size());
    23942397        m_graphicsLayer->setNeedsDisplayInRect(rectToRepaint, shouldClip);
     
    24172420
    24182421    FloatRect pixelSnappedRectForPainting = snapRectToDevicePixels(r, deviceScaleFactor());
    2419     FrameView& frameView = renderer().view().frameView();
     2422    auto& frameView = renderer().view().frameView();
    24202423    if (m_isMainFrameRenderViewLayer && frameView.isTrackingRepaints())
    24212424        frameView.addTrackedRepaintRect(pixelSnappedRectForPainting);
     
    26102613bool RenderLayerBacking::getCurrentTransform(const GraphicsLayer* graphicsLayer, TransformationMatrix& transform) const
    26112614{
    2612     GraphicsLayer* transformedLayer = m_contentsContainmentLayer.get() ? m_contentsContainmentLayer.get() : m_graphicsLayer.get();
     2615    auto* transformedLayer = m_contentsContainmentLayer.get() ? m_contentsContainmentLayer.get() : m_graphicsLayer.get();
    26132616    if (graphicsLayer != transformedLayer)
    26142617        return false;
     
    26782681void RenderLayerBacking::logFilledVisibleFreshTile(unsigned blankPixelCount)
    26792682{
    2680     if (PerformanceLoggingClient* loggingClient = renderer().page().performanceLoggingClient())
     2683    if (auto* loggingClient = renderer().page().performanceLoggingClient())
    26812684        loggingClient->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::FilledTile, MonotonicTime::now(), blankPixelCount);
    26822685}
     
    27192722            continue;
    27202723           
    2721         TimingFunction* tf = currentKeyframe.timingFunction(keyframes.animationName());
     2724        auto* tf = currentKeyframe.timingFunction(keyframes.animationName());
    27222725       
    27232726        bool isFirstOrLastKeyframe = key == 0 || key == 1;
     
    28912894LayoutRect RenderLayerBacking::compositedBoundsIncludingMargin() const
    28922895{
    2893     TiledBacking* tiledBacking = this->tiledBacking();
     2896    auto* tiledBacking = this->tiledBacking();
    28942897    if (!tiledBacking || !tiledBacking->hasMargins())
    28952898        return compositedBounds();
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r224078 r224110  
    431431    }
    432432
    433     FrameView& frameView = m_renderView.frameView();
     433    auto& frameView = m_renderView.frameView();
    434434    AnimationUpdateBlock animationUpdateBlock(&frameView.frame().animation());
    435435
     
    437437    m_flushingLayers = true;
    438438
    439     if (GraphicsLayer* rootLayer = rootGraphicsLayer()) {
     439    if (auto* rootLayer = rootGraphicsLayer()) {
    440440#if PLATFORM(IOS)
    441441        FloatRect exposedRect = frameView.exposedContentRect();
     
    475475    updateScrollCoordinatedLayersAfterFlush();
    476476
    477     Frame& frame = m_renderView.frameView().frame();
     477    auto& frame = m_renderView.frameView().frame();
    478478    for (Frame* subframe = frame.tree().firstChild(); subframe; subframe = subframe->tree().traverseNext(&frame)) {
    479         RenderView* view = subframe->contentRenderer();
     479        auto* view = subframe->contentRenderer();
    480480        if (!view)
    481481            continue;
     
    510510static void updateScrollingLayerWithClient(RenderLayer& layer, ChromeClient& client)
    511511{
    512     RenderLayerBacking* backing = layer.backing();
     512    auto* backing = layer.backing();
    513513    ASSERT(backing);
    514514
     
    542542#endif
    543543
    544     RenderLayerBacking* backing = layer.backing();
     544    auto* backing = layer.backing();
    545545    if (backing->backgroundLayerPaintsFixedRootBackground() && graphicsLayer == backing->backgroundLayer())
    546546        fixedRootBackgroundLayerChanged();
     
    549549void RenderLayerCompositor::didPaintBacking(RenderLayerBacking*)
    550550{
    551     FrameView& frameView = m_renderView.frameView();
     551    auto& frameView = m_renderView.frameView();
    552552    frameView.setLastPaintTime(monotonicallyIncreasingTime());
    553553    if (frameView.milestonesPendingPaint())
     
    557557void RenderLayerCompositor::didChangeVisibleRect()
    558558{
    559     GraphicsLayer* rootLayer = rootGraphicsLayer();
     559    auto* rootLayer = rootGraphicsLayer();
    560560    if (!rootLayer)
    561561        return;
     
    601601RenderLayerCompositor* RenderLayerCompositor::enclosingCompositorFlushingLayers() const
    602602{
    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;
    605605        if (compositor->isFlushingLayers())
    606606            return compositor;
     
    723723        m_secondaryBackingStoreBytes = 0;
    724724
    725         Frame& frame = m_renderView.frameView().frame();
     725        auto& frame = m_renderView.frameView().frame();
    726726        bool isMainFrame = isMainFrameCompositor();
    727727        LOG(Compositing, "\nUpdate %d of %s.\n", m_rootLayerUpdateCount, isMainFrame ? "main frame" : frame.tree().uniqueName().string().utf8().data());
     
    779779        return;
    780780
    781     Frame& frame = m_renderView.frameView().frame();
     781    auto& frame = m_renderView.frameView().frame();
    782782    childList.append(&frame.mainFrame().pageOverlayController().layerWithDocumentOverlays());
    783783}
     
    798798        return;
    799799
    800     RenderLayerBacking* backing = layer.backing();
     800    auto* backing = layer.backing();
    801801    if (requiresCompositingLayer(layer) || layer.isRenderViewLayer()) {
    802802        ++m_obligateCompositedLayerCount;
     
    869869static bool checkIfDescendantClippingContextNeedsUpdate(const RenderLayer& layer, bool isClipping)
    870870{
    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();
    873873        if (backing && (isClipping || backing->hasAncestorClippingLayer()))
    874874            return true;
     
    901901    // FIXME: need to check everything that we consult to avoid backing store here: webkit.org/b/138383
    902902    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) {
    905905            if (static_cast<bool>(newStyle.opacity()) != ancestorBacking->graphicsLayer()->drawsContent())
    906906                return true;
     
    982982        return false;
    983983
    984     ClipPathOperation& clipPath = *layer.renderer().style().clipPath();
     984    auto& clipPath = *layer.renderer().style().clipPath();
    985985    return (clipPath.type() != ClipPathOperation::Shape || clipPath.type() == ClipPathOperation::Shape) && GraphicsLayer::supportsLayerType(GraphicsLayer::Type::Shape);
    986986}
     
    988988static RenderLayerModelObject& rendererForCompositingTests(const RenderLayer& layer)
    989989{
    990     RenderLayerModelObject* renderer = &layer.renderer();
     990    auto* renderer = &layer.renderer();
    991991
    992992    // The compositing state of a reflection should match that of its reflected layer.
     
    10261026            if (layer.isRenderViewLayer() && useCoordinatedScrollingForLayer(layer)) {
    10271027                updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry });
    1028                 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     1028                if (auto* scrollingCoordinator = this->scrollingCoordinator())
    10291029                    scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
    10301030#if ENABLE(RUBBER_BANDING)
     
    10341034                updateRootContentLayerClipping();
    10351035
    1036                 if (TiledBacking* tiledBacking = layer.backing()->tiledBacking())
     1036                if (auto* tiledBacking = layer.backing()->tiledBacking())
    10371037                    tiledBacking->setTopContentInset(m_renderView.frameView().topContentInset());
    10381038            }
     
    10511051            // are both either composited, or not composited.
    10521052            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()) {
    10551055                    ASSERT(backing->graphicsLayer()->replicaLayer() == layer.backing()->graphicsLayer());
    10561056                    backing->graphicsLayer()->setReplicatedByLayer(nullptr);
     
    10811081
    10821082    if (layerChanged && is<RenderWidget>(layer.renderer())) {
    1083         RenderLayerCompositor* innerCompositor = frameContentsCompositor(&downcast<RenderWidget>(layer.renderer()));
     1083        auto* innerCompositor = frameContentsCompositor(&downcast<RenderWidget>(layer.renderer()));
    10841084        if (innerCompositor && innerCompositor->inCompositingMode())
    10851085            innerCompositor->updateRootLayerAttachment();
     
    10971097        }
    10981098        if (layerChanged) {
    1099             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     1099            if (auto* scrollingCoordinator = this->scrollingCoordinator())
    11001100                scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.frameView());
    11011101        }
     
    11271127        return;
    11281128
    1129     RenderLayerModelObject* repaintContainer = layer.renderer().containerForRepaint();
     1129    auto* repaintContainer = layer.renderer().containerForRepaint();
    11301130    if (!repaintContainer)
    11311131        repaintContainer = &m_renderView;
     
    11431143void RenderLayerCompositor::repaintInCompositedAncestor(RenderLayer& layer, const LayoutRect& rect)
    11441144{
    1145     RenderLayer* compositedAncestor = layer.enclosingCompositingLayerForRepaint(ExcludeSelf);
     1145    auto* compositedAncestor = layer.enclosingCompositingLayerForRepaint(ExcludeSelf);
    11461146    if (!compositedAncestor)
    11471147        return;
     
    11771177RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const RenderLayer& layer) const
    11781178{
    1179     for (RenderLayer* parent = layer.parent(); parent; parent = parent->parent()) {
     1179    for (auto* parent = layer.parent(); parent; parent = parent->parent()) {
    11801180        if (parent->isStackingContainer())
    11811181            return nullptr;
     
    14931493
    14941494    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();
    14971497       
    14981498        hostingLayer->addChild(hostedLayer);
     
    15241524    // have been processed. computeCompositingRequirements() will already have done the repaint if necessary.
    15251525
    1526     RenderLayerBacking* layerBacking = layer.backing();
     1526    auto* layerBacking = layer.backing();
    15271527    if (layerBacking) {
    15281528        // The compositing state of all our children has been updated already, so now
     
    15301530        layerBacking->updateCompositedBounds();
    15311531
    1532         if (RenderLayer* reflection = layer.reflectionLayer()) {
     1532        if (auto* reflection = layer.reflectionLayer()) {
    15331533            if (reflection->backing())
    15341534                reflection->backing()->updateCompositedBounds();
     
    15911591        // Otherwise, the overflow control layers are normal children.
    15921592        if (!layerBacking->hasClippingLayer() && !layerBacking->hasScrollingLayer()) {
    1593             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForHorizontalScrollbar()) {
     1593            if (auto* overflowControlLayer = layerBacking->layerForHorizontalScrollbar()) {
    15941594                overflowControlLayer->removeFromParent();
    15951595                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
    15961596            }
    15971597
    1598             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForVerticalScrollbar()) {
     1598            if (auto* overflowControlLayer = layerBacking->layerForVerticalScrollbar()) {
    15991599                overflowControlLayer->removeFromParent();
    16001600                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
    16011601            }
    16021602
    1603             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForScrollCorner()) {
     1603            if (auto* overflowControlLayer = layerBacking->layerForScrollCorner()) {
    16041604                overflowControlLayer->removeFromParent();
    16051605                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
     
    16101610    }
    16111611   
    1612     if (RenderLayerBacking* layerBacking = layer.backing())
     1612    if (auto* layerBacking = layer.backing())
    16131613        layerBacking->updateAfterDescendants();
    16141614}
     
    16411641bool RenderLayerCompositor::hasCoordinatedScrolling() const
    16421642{
    1643     ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
     1643    auto* scrollingCoordinator = this->scrollingCoordinator();
    16441644    return scrollingCoordinator && scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView());
    16451645}
     
    16491649    ASSERT(m_scrollLayer);
    16501650
    1651     FrameView& frameView = m_renderView.frameView();
     1651    auto& frameView = m_renderView.frameView();
    16521652    IntPoint scrollPosition = frameView.scrollPosition();
    16531653
    16541654    m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y()));
    16551655
    1656     if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer())
     1656    if (auto* fixedBackgroundLayer = fixedRootBackgroundLayer())
    16571657        fixedBackgroundLayer->setPosition(frameView.scrollPositionForFixedPosition());
    16581658}
     
    16601660FloatPoint RenderLayerCompositor::positionForClipLayer() const
    16611661{
    1662     FrameView& frameView = m_renderView.frameView();
     1662    auto& frameView = m_renderView.frameView();
    16631663
    16641664    return FloatPoint(
     
    16901690void RenderLayerCompositor::frameViewDidLayout()
    16911691{
    1692     RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
    1693     if (renderViewBacking)
     1692    if (auto* renderViewBacking = m_renderView.layer()->backing())
    16941693        renderViewBacking->adjustTiledBackingCoverage();
    16951694}
     
    16971696void RenderLayerCompositor::rootFixedBackgroundsChanged()
    16981697{
    1699     RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
     1698    auto* renderViewBacking = m_renderView.layer()->backing();
    17001699    if (renderViewBacking && renderViewBacking->isFrameLayerWithTiledBacking())
    17011700        setCompositingLayersNeedRebuild();
     
    17041703void RenderLayerCompositor::scrollingLayerDidChange(RenderLayer& layer)
    17051704{
    1706     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     1705    if (auto* scrollingCoordinator = this->scrollingCoordinator())
    17071706        scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
    17081707}
     
    17631762RenderLayerCompositor* RenderLayerCompositor::frameContentsCompositor(RenderWidget* renderer)
    17641763{
    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())
    17671766            return &view->compositor();
    17681767    }
     
    17721771bool RenderLayerCompositor::parentFrameContentLayers(RenderWidget* renderer)
    17731772{
    1774     RenderLayerCompositor* innerCompositor = frameContentsCompositor(renderer);
     1773    auto* innerCompositor = frameContentsCompositor(renderer);
    17751774    if (!innerCompositor || !innerCompositor->inCompositingMode() || innerCompositor->rootLayerAttachment() != RootLayerAttachedViaEnclosingFrame)
    17761775        return false;
    17771776   
    1778     RenderLayer* layer = renderer->layer();
     1777    auto* layer = renderer->layer();
    17791778    if (!layer->isComposited())
    17801779        return false;
    17811780
    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();
    17851784    if (hostingLayer->children().size() != 1 || hostingLayer->children()[0] != rootLayer) {
    17861785        hostingLayer->removeAllChildren();
     
    17931792void RenderLayerCompositor::updateLayerTreeGeometry(RenderLayer& layer, int depth)
    17941793{
    1795     if (RenderLayerBacking* layerBacking = layer.backing()) {
     1794    if (auto* layerBacking = layer.backing()) {
    17961795        // The compositing state of all our children has been updated already, so now
    17971796        // we can compute and cache the composited bounds for this layer.
    17981797        layerBacking->updateCompositedBounds();
    17991798
    1800         if (RenderLayer* reflection = layer.reflectionLayer()) {
     1799        if (auto* reflection = layer.reflectionLayer()) {
    18011800            if (reflection->backing())
    18021801                reflection->backing()->updateCompositedBounds();
     
    18351834    }
    18361835
    1837     if (RenderLayerBacking* layerBacking = layer.backing())
     1836    if (auto* layerBacking = layer.backing())
    18381837        layerBacking->updateAfterDescendants();
    18391838}
     
    18431842{
    18441843    if (&layer != &compositingAncestor) {
    1845         if (RenderLayerBacking* layerBacking = layer.backing()) {
     1844        if (auto* layerBacking = layer.backing()) {
    18461845            layerBacking->updateCompositedBounds();
    18471846
    1848             if (RenderLayer* reflection = layer.reflectionLayer()) {
     1847            if (auto* reflection = layer.reflectionLayer()) {
    18491848                if (reflection->backing())
    18501849                    reflection->backing()->updateCompositedBounds();
     
    18851884   
    18861885    if (&layer != &compositingAncestor) {
    1887         if (RenderLayerBacking* layerBacking = layer.backing())
     1886        if (auto* layerBacking = layer.backing())
    18881887            layerBacking->updateAfterDescendants();
    18891888    }
     
    19411940        return;
    19421941
    1943     if (GraphicsLayer* rootLayer = rootGraphicsLayer()) {
     1942    if (auto* rootLayer = rootGraphicsLayer()) {
    19441943        GraphicsLayer::traverse(*rootLayer, [isInWindow](GraphicsLayer& layer) {
    19451944            layer.setIsInWindow(isInWindow);
     
    19761975    }
    19771976
    1978     for (RenderLayer* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling())
     1977    for (auto* childLayer = layer.firstChild(); childLayer; childLayer = childLayer->nextSibling())
    19791978        clearBackingForLayerIncludingDescendants(*childLayer);
    19801979}
     
    23042303        return false;
    23052304
    2306     RenderLayer* compositingAncestor = layer.ancestorCompositingLayer();
     2305    auto* compositingAncestor = layer.ancestorCompositingLayer();
    23072306    if (!compositingAncestor)
    23082307        return false;
     
    23132312    // in this case it is not allowed to clipsCompositingDescendants() and each of its children
    23142313    // will be clippedByAncestor()s, including the compositingAncestor.
    2315     RenderLayer* computeClipRoot = compositingAncestor;
     2314    auto* computeClipRoot = compositingAncestor;
    23162315    if (!compositingAncestor->isolatesCompositedBlending()) {
    23172316        computeClipRoot = nullptr;
    2318         RenderLayer* parent = &layer;
     2317        auto* parent = &layer;
    23192318        while (parent) {
    2320             RenderLayer* next = parent->parent();
     2319            auto* next = parent->parent();
    23212320            if (next == compositingAncestor) {
    23222321                computeClipRoot = parent;
     
    23812380   
    23822381    // FIXME: workaround for webkit.org/b/132801
    2383     RenderLayer* stackingContext = renderer.layer()->stackingContainer();
     2382    auto* stackingContext = renderer.layer()->stackingContainer();
    23842383    if (stackingContext && stackingContext->renderer().style().transformStyle3D() == TransformStyle3DPreserve3D)
    23852384        return true;
     
    24122411        bool isCanvasLargeEnoughToForceCompositing = true;
    24132412#else
    2414         HTMLCanvasElement* canvas = downcast<HTMLCanvasElement>(renderer.element());
     2413        auto* canvas = downcast<HTMLCanvasElement>(renderer.element());
    24152414        auto canvasArea = canvas->size().area<RecordOverflow>();
    24162415        bool isCanvasLargeEnoughToForceCompositing = !canvasArea.hasOverflowed() && canvasArea.unsafeGet() >= canvasAreaThresholdRequiringCompositing;
     
    24342433    m_reevaluateCompositingAfterLayout = true;
    24352434   
    2436     RenderWidget& pluginRenderer = downcast<RenderWidget>(renderer);
     2435    auto& pluginRenderer = downcast<RenderWidget>(renderer);
    24372436    if (pluginRenderer.style().visibility() != VISIBLE)
    24382437        return false;
     
    24752474
    24762475    const AnimationBase::RunningState activeAnimationState = AnimationBase::Running | AnimationBase::Paused;
    2477     CSSAnimationController& animController = renderer.animation();
     2476    auto& animController = renderer.animation();
    24782477    return (animController.isRunningAnimationOnRenderer(renderer, CSSPropertyOpacity, activeAnimationState)
    24792478            && (inCompositingMode() || (m_compositingTriggers & ChromeClient::AnimatedOpacityTrigger)))
     
    24872486bool RenderLayerCompositor::requiresCompositingForIndirectReason(RenderLayerModelObject& renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants, RenderLayer::IndirectCompositingReason& reason) const
    24882487{
    2489     RenderLayer& layer = *downcast<RenderBoxModelObject>(renderer).layer();
     2488    auto& layer = *downcast<RenderBoxModelObject>(renderer).layer();
    24902489
    24912490    // When a layer has composited descendants, some effects, like 2d transforms, filters, masks etc must be implemented
     
    25612560    ASSERT(layer.renderer().isStickyPositioned());
    25622561
    2563     RenderLayer* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf);
     2562    auto* enclosingOverflowLayer = layer.enclosingOverflowClipLayer(ExcludeSelf);
    25642563
    25652564#if PLATFORM(IOS)
     
    25972596
    25982597    // 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()) {
    26002599        if (stackingContainer->isComposited() && stackingContainer->renderer().style().position() == FixedPosition)
    26012600            return false;
     
    27252724bool RenderLayerCompositor::requiresScrollLayer(RootLayerAttachment attachment) const
    27262725{
    2727     FrameView& frameView = m_renderView.frameView();
     2726    auto& frameView = m_renderView.frameView();
    27282727
    27292728    // This applies when the application UI handles scrolling, in which case RenderLayerCompositor doesn't need to manage it.
     
    27702769bool RenderLayerCompositor::supportsFixedRootBackgroundCompositing() const
    27712770{
    2772     RenderLayerBacking* renderViewBacking = m_renderView.layer()->backing();
     2771    auto* renderViewBacking = m_renderView.layer()->backing();
    27732772    return renderViewBacking && renderViewBacking->isFrameLayerWithTiledBacking();
    27742773}
     
    27902789{
    27912790    // Get the fixed root background from the RenderView layer's backing.
    2792     RenderLayer* viewLayer = m_renderView.layer();
     2791    auto* viewLayer = m_renderView.layer();
    27932792    if (!viewLayer)
    27942793        return nullptr;
     
    28022801void RenderLayerCompositor::resetTrackedRepaintRects()
    28032802{
    2804     if (GraphicsLayer* rootLayer = rootGraphicsLayer()) {
     2803    if (auto* rootLayer = rootGraphicsLayer()) {
    28052804        GraphicsLayer::traverse(*rootLayer, [](GraphicsLayer& layer) {
    28062805            layer.resetTrackedRepaints();
     
    28282827#if PLATFORM(IOS)
    28292828    LegacyTileCache* tileCache = nullptr;
    2830     if (FrameView* frameView = page().mainFrame().view())
     2829    if (auto* frameView = page().mainFrame().view())
    28312830        tileCache = frameView->legacyTileCache();
    28322831
     
    28472846bool RenderLayerCompositor::documentUsesTiledBacking() const
    28482847{
    2849     RenderLayer* layer = m_renderView.layer();
     2848    auto* layer = m_renderView.layer();
    28502849    if (!layer)
    28512850        return false;
    28522851
    2853     RenderLayerBacking* backing = layer->backing();
     2852    auto* backing = layer->backing();
    28542853    if (!backing)
    28552854        return false;
     
    28652864bool RenderLayerCompositor::shouldCompositeOverflowControls() const
    28662865{
    2867     FrameView& frameView = m_renderView.frameView();
     2866    auto& frameView = m_renderView.frameView();
    28682867
    28692868    if (frameView.platformWidget())
     
    29912990            // The ScrollingTree knows about the header layer, and the position of the root layer is affected
    29922991            // 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())
    29942993                scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
    29952994        }
     
    30093008    m_layerForHeader->setSize(FloatSize(m_renderView.frameView().visibleWidth(), m_renderView.frameView().headerHeight()));
    30103009
    3011     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3010    if (auto* scrollingCoordinator = this->scrollingCoordinator())
    30123011        scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
    30133012
     
    30293028            // The ScrollingTree knows about the footer layer, and the total scrollable size is affected
    30303029            // 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())
    30323031                scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
    30333032        }
     
    30473046    m_layerForFooter->setSize(FloatSize(m_renderView.frameView().visibleWidth(), m_renderView.frameView().footerHeight()));
    30483047
    3049     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3048    if (auto* scrollingCoordinator = this->scrollingCoordinator())
    30503049        scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.frameView());
    30513050
     
    31923191            m_overflowControlsHostLayer->addChild(m_layerForHorizontalScrollbar.get());
    31933192
    3194             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3193            if (auto* scrollingCoordinator = this->scrollingCoordinator())
    31953194                scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar);
    31963195        }
     
    31993198        m_layerForHorizontalScrollbar = nullptr;
    32003199
    3201         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3200        if (auto* scrollingCoordinator = this->scrollingCoordinator())
    32023201            scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar);
    32033202    }
     
    32143213            m_overflowControlsHostLayer->addChild(m_layerForVerticalScrollbar.get());
    32153214
    3216             if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3215            if (auto* scrollingCoordinator = this->scrollingCoordinator())
    32173216                scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar);
    32183217        }
     
    32213220        m_layerForVerticalScrollbar = nullptr;
    32223221
    3223         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3222        if (auto* scrollingCoordinator = this->scrollingCoordinator())
    32243223            scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar);
    32253224    }
     
    32593258#if PLATFORM(IOS)
    32603259        // 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();
    32623261        if (frame.isMainFrame())
    32633262            m_rootContentLayer->setAppliesPageScale();
     
    33333332        m_layerForHorizontalScrollbar->removeFromParent();
    33343333        m_layerForHorizontalScrollbar = nullptr;
    3335         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3334        if (auto* scrollingCoordinator = this->scrollingCoordinator())
    33363335            scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), HorizontalScrollbar);
    3337         if (Scrollbar* horizontalScrollbar = m_renderView.frameView().verticalScrollbar())
     3336        if (auto* horizontalScrollbar = m_renderView.frameView().verticalScrollbar())
    33383337            m_renderView.frameView().invalidateScrollbar(*horizontalScrollbar, IntRect(IntPoint(0, 0), horizontalScrollbar->frameRect().size()));
    33393338    }
     
    33423341        m_layerForVerticalScrollbar->removeFromParent();
    33433342        m_layerForVerticalScrollbar = nullptr;
    3344         if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     3343        if (auto* scrollingCoordinator = this->scrollingCoordinator())
    33453344            scrollingCoordinator->scrollableAreaScrollbarLayerDidChange(m_renderView.frameView(), VerticalScrollbar);
    3346         if (Scrollbar* verticalScrollbar = m_renderView.frameView().verticalScrollbar())
     3345        if (auto* verticalScrollbar = m_renderView.frameView().verticalScrollbar())
    33473346            m_renderView.frameView().invalidateScrollbar(*verticalScrollbar, IntRect(IntPoint(0, 0), verticalScrollbar->frameRect().size()));
    33483347    }
     
    33763375            break;
    33773376        case RootLayerAttachedViaChromeClient: {
    3378             Frame& frame = m_renderView.frameView().frame();
     3377            auto& frame = m_renderView.frameView().frame();
    33793378            page().chrome().client().attachRootGraphicsLayer(frame, rootGraphicsLayer());
    33803379            if (frame.isMainFrame())
     
    34143413            m_rootContentLayer->removeFromParent();
    34153414
    3416         if (HTMLFrameOwnerElement* ownerElement = m_renderView.document().ownerElement())
     3415        if (auto* ownerElement = m_renderView.document().ownerElement())
    34173416            ownerElement->scheduleInvalidateStyleAndLayerComposition();
    34183417        break;
    34193418    }
    34203419    case RootLayerAttachedViaChromeClient: {
    3421         Frame& frame = m_renderView.frameView().frame();
     3420        auto& frame = m_renderView.frameView().frame();
    34223421        page().chrome().client().attachRootGraphicsLayer(frame, nullptr);
    34233422        if (frame.isMainFrame()) {
     
    34483447        return;
    34493448
    3450     Frame& frame = m_renderView.frameView().frame();
     3449    auto& frame = m_renderView.frameView().frame();
    34513450
    34523451    // The attachment can affect whether the RenderView layer's paintsIntoWindow() behavior,
    34533452    // 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)
    34563455        backing->updateDrawsContent();
    34573456
     
    34663465    // Compositing affects the answer to RenderIFrame::requiresAcceleratedCompositing(), so
    34673466    // 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())
    34693468        ownerElement->scheduleInvalidateStyleAndLayerComposition();
    34703469}
     
    35113510    // Page scale will only be applied at to the RenderView and sublayers, but the device scale factor
    35123511    // needs to be applied at the level of rootGraphicsLayer().
    3513     GraphicsLayer* rootLayer = rootGraphicsLayer();
    3514     if (rootLayer)
     3512    if (auto* rootLayer = rootGraphicsLayer())
    35153513        rootLayer->noteDeviceOrPageScaleFactorChangedIncludingDescendants();
    35163514}
     
    35513549    ASSERT(layer.isComposited());
    35523550
    3553     GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();
     3551    auto* graphicsLayer = layer.backing()->graphicsLayer();
    35543552
    35553553    FixedPositionViewportConstraints constraints;
     
    35913589#endif
    35923590
    3593     RenderBoxModelObject& renderer = downcast<RenderBoxModelObject>(layer.renderer());
     3591    auto& renderer = downcast<RenderBoxModelObject>(layer.renderer());
    35943592
    35953593    StickyPositionViewportConstraints constraints;
    35963594    renderer.computeStickyPositionConstraints(constraints, renderer.constrainingRectForStickyPosition());
    35973595
    3598     GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();
     3596    auto* graphicsLayer = layer.backing()->graphicsLayer();
    35993597    constraints.setLayerPositionAtLastLayout(graphicsLayer->position());
    36003598    constraints.setStickyOffsetAtLastLayout(renderer.stickyPositionOffset());
     
    36063604static ScrollingNodeID enclosingScrollingNodeID(RenderLayer& layer, IncludeSelfOrNot includeSelf)
    36073605{
    3608     RenderLayer* currLayer = includeSelf == IncludeSelf ? &layer : layer.parent();
     3606    auto* currLayer = includeSelf == IncludeSelf ? &layer : layer.parent();
    36093607    while (currLayer) {
    3610         if (RenderLayerBacking* backing = currLayer->backing()) {
     3608        if (auto* backing = currLayer->backing()) {
    36113609            if (ScrollingNodeID nodeID = backing->scrollingNodeIDForChildren())
    36123610                return nodeID;
     
    36243622
    36253623    // 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;
    36283626    if (!frameRenderer)
    36293627        return 0;
    36303628
    3631     RenderLayer* layerInParentDocument = frameRenderer->enclosingLayer();
     3629    auto* layerInParentDocument = frameRenderer->enclosingLayer();
    36323630    if (!layerInParentDocument)
    36333631        return 0;
     
    36433641    m_subframeScrollLayersNeedReattach = false;
    36443642
    3645     ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
     3643    auto* scrollingCoordinator = this->scrollingCoordinator();
    36463644
    36473645    for (Frame* child = m_renderView.frameView().frame().tree().firstChild(); child; child = child->tree().nextSibling()) {
     
    36503648
    36513649        // Ignore frames that are not scroll-coordinated.
    3652         FrameView* childFrameView = child->view();
     3650        auto* childFrameView = child->view();
    36533651        ScrollingNodeID frameScrollingNodeID = childFrameView->scrollLayerID();
    36543652        if (!frameScrollingNodeID)
     
    36793677ScrollingNodeID RenderLayerCompositor::attachScrollingNode(RenderLayer& layer, ScrollingNodeType nodeType, ScrollingNodeID parentNodeID)
    36803678{
    3681     ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
    3682     RenderLayerBacking* backing = layer.backing();
     3679    auto* scrollingCoordinator = this->scrollingCoordinator();
     3680    auto* backing = layer.backing();
    36833681    // Crash logs suggest that backing can be null here, but we don't know how: rdar://problem/18545452.
    36843682    ASSERT(backing);
     
    37033701void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer, LayerScrollCoordinationRoles roles)
    37043702{
    3705     RenderLayerBacking* backing = layer.backing();
     3703    auto* backing = layer.backing();
    37063704    if (!backing)
    37073705        return;
     
    37223720void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID)
    37233721{
    3724     ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
     3722    auto* scrollingCoordinator = this->scrollingCoordinator();
    37253723    ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()));
    37263724
     
    37313729void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, LayerScrollCoordinationRoles reasons, OptionSet<ScrollingNodeChangeFlags> changes)
    37323730{
    3733     ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator();
     3731    auto* scrollingCoordinator = this->scrollingCoordinator();
    37343732    if (!scrollingCoordinator || !scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView()))
    37353733        return;
     
    37433741    ASSERT(layer.isComposited());
    37443742
    3745     RenderLayerBacking* backing = layer.backing();
     3743    auto* backing = layer.backing();
    37463744    if (!backing)
    37473745        return;
     
    39043902{
    39053903    for (auto* layer : m_scrollingLayers) {
    3906         RenderLayerBacking* backing = layer->backing();
     3904        auto* backing = layer->backing();
    39073905        ASSERT(backing);
    39083906        page().chrome().client().removeScrollingLayer(layer->renderer().element(), backing->scrollingLayer()->platformLayer(), backing->scrollingContentsLayer()->platformLayer());
     
    39133911void RenderLayerCompositor::willRemoveScrollingLayerWithBacking(RenderLayer& layer, RenderLayerBacking& backing)
    39143912{
    3915     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {
     3913    if (auto* scrollingCoordinator = this->scrollingCoordinator()) {
    39163914        backing.detachFromScrollingCoordinator(Scrolling);
    39173915
     
    39283926        return;
    39293927
    3930     PlatformLayer* scrollingLayer = backing.scrollingLayer()->platformLayer();
    3931     PlatformLayer* contentsLayer = backing.scrollingContentsLayer()->platformLayer();
     3928    auto* scrollingLayer = backing.scrollingLayer()->platformLayer();
     3929    auto* contentsLayer = backing.scrollingContentsLayer()->platformLayer();
    39323930    page().chrome().client().removeScrollingLayer(layer.renderer().element(), scrollingLayer, contentsLayer);
    39333931#endif
     
    39383936    updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry });
    39393937
    3940     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) {
     3938    if (auto* scrollingCoordinator = this->scrollingCoordinator()) {
    39413939        // For Coordinated Graphics.
    39423940        scrollingCoordinator->scrollableAreaScrollLayerDidChange(layer);
     
    40334031void RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView(const FrameView& frameView)
    40344032{
    4035     if (ScrollingCoordinator* coordinator = scrollingCoordinator())
     4033    if (auto* coordinator = scrollingCoordinator())
    40364034        coordinator->updateScrollSnapPropertiesWithFrameView(frameView);
    40374035}
Note: See TracChangeset for help on using the changeset viewer.