Changeset 221958 in webkit
- Timestamp:
- Sep 12, 2017 11:44:45 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r221952 r221958 1 2017-09-12 Frederic Wang <fwang@igalia.com> 2 3 Rename isRootLayer to isRenderViewLayer 4 https://bugs.webkit.org/show_bug.cgi?id=176684 5 6 Reviewed by Darin Adler. 7 8 This patch was generated with the help of do-webcore-rename with some coding style adjustment. 9 10 No new tests, behavior unchanged. 11 12 * rendering/RenderLayer.cpp: 13 (WebCore::RenderLayer::RenderLayer): 14 (WebCore::RenderLayer::enclosingTransformedAncestor const): 15 (WebCore::RenderLayer::enclosingFilterRepaintLayer const): 16 (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect): 17 (WebCore::RenderLayer::clippingRootForPainting const): 18 (WebCore::RenderLayer::beginTransparencyLayers): 19 (WebCore::shouldSuppressPaintingLayer): 20 (WebCore::RenderLayer::paintFixedLayersInNamedFlows): 21 (WebCore::RenderLayer::hitTest): 22 (WebCore::RenderLayer::hitTestFixedLayersInNamedFlows): 23 (WebCore::RenderLayer::calculateClipRects const): 24 * rendering/RenderLayer.h: 25 * rendering/RenderLayerBacking.cpp: 26 (WebCore::RenderLayerBacking::RenderLayerBacking): 27 (WebCore::RenderLayerBacking::updateConfiguration): 28 (WebCore::RenderLayerBacking::updateAfterDescendants): 29 (WebCore::RenderLayerBacking::paintsIntoWindow const): 30 (WebCore::RenderLayerBacking::paintIntoLayer): 31 * rendering/RenderLayerCompositor.cpp: 32 (WebCore::RenderLayerCompositor::logLayerInfo): 33 (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const): 34 (WebCore::RenderLayerCompositor::updateBacking): 35 (WebCore::RenderLayerCompositor::repaintInCompositedAncestor): 36 (WebCore::RenderLayerCompositor::addToOverlapMap): 37 (WebCore::RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed): 38 (WebCore::RenderLayerCompositor::computeCompositingRequirements): 39 (WebCore::RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed): 40 (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): 41 (WebCore::RenderLayerCompositor::needsToBeComposited const): 42 (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): Also move the IOS condition 43 up to avoid that check-webkit-style complains. 44 (WebCore::RenderLayerCompositor::reasonsForCompositing const): 45 (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): 46 (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const): 47 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 48 1 49 2017-09-12 Wenson Hsieh <wenson_hsieh@apple.com> 2 50 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r220806 r221958 268 268 269 269 RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject) 270 : m_isR ootLayer(rendererLayerModelObject.isRenderView())270 : m_isRenderViewLayer(rendererLayerModelObject.isRenderView()) 271 271 , m_forcedStackingContext(rendererLayerModelObject.isMedia()) 272 272 , m_inResizeMode(false) … … 1527 1527 { 1528 1528 RenderLayer* curr = parent(); 1529 while (curr && !curr->isR ootLayer() && !curr->transform())1529 while (curr && !curr->isRenderViewLayer() && !curr->transform()) 1530 1530 curr = curr->parent(); 1531 1531 … … 1594 1594 { 1595 1595 for (const RenderLayer* curr = this; curr; curr = curr->parent()) { 1596 if ((curr != this && curr->requiresFullLayerImageForFilters()) || compositedWithOwnBackingStore(*curr) || curr->isR ootLayer())1596 if ((curr != this && curr->requiresFullLayerImageForFilters()) || compositedWithOwnBackingStore(*curr) || curr->isRenderViewLayer()) 1597 1597 return const_cast<RenderLayer*>(curr); 1598 1598 } … … 1631 1631 } 1632 1632 1633 if (parentLayer->isR ootLayer()) {1633 if (parentLayer->isRenderViewLayer()) { 1634 1634 downcast<RenderView>(parentLayer->renderer()).repaintViewRectangle(parentLayerRect); 1635 1635 return; … … 1655 1655 const RenderLayer* current = this; 1656 1656 while (current) { 1657 if (current->isR ootLayer())1657 if (current->isRenderViewLayer()) 1658 1658 return const_cast<RenderLayer*>(current); 1659 1659 … … 1824 1824 1825 1825 #if ENABLE(CSS_COMPOSITING) 1826 bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isR ootLayer());1826 bool usesCompositeOperation = hasBlendMode() && !(renderer().isSVGRoot() && parent() && parent()->isRenderViewLayer()); 1827 1827 if (usesCompositeOperation) 1828 1828 context.setCompositeOperation(context.compositeOperation(), blendMode()); … … 3941 3941 static inline bool shouldSuppressPaintingLayer(RenderLayer* layer) 3942 3942 { 3943 if (layer->renderer().style().isNotFinal() && !layer->isR ootLayer() && !layer->renderer().isDocumentElementRenderer())3943 if (layer->renderer().style().isNotFinal() && !layer->isRenderViewLayer() && !layer->renderer().isDocumentElementRenderer()) 3944 3944 return true; 3945 3945 … … 4272 4272 void RenderLayer::paintFixedLayersInNamedFlows(GraphicsContext& context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) 4273 4273 { 4274 if (!isR ootLayer())4274 if (!isRenderViewLayer()) 4275 4275 return; 4276 4276 … … 4946 4946 // return ourselves. We do this so mouse events continue getting delivered after a drag has 4947 4947 // exited the WebView, and so hit testing over a scrollbar hits the content document. 4948 if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isR ootLayer()) {4948 if (!request.isChildFrameHitTest() && (request.active() || request.release()) && isRenderViewLayer()) { 4949 4949 renderer().updateHitTestResult(result, downcast<RenderView>(renderer()).flipForWritingMode(hitTestLocation.point())); 4950 4950 insideLayer = this; … … 5074 5074 bool depthSortDescendants) 5075 5075 { 5076 if (!isR ootLayer())5076 if (!isRenderViewLayer()) 5077 5077 return nullptr; 5078 5078 … … 5883 5883 // FIXME: Could eliminate the isDocumentElementRenderer() check if we fix background painting so that the RenderView 5884 5884 // paints the root's background. 5885 if (isR ootLayer() || renderer().isDocumentElementRenderer())5885 if (isRenderViewLayer() || renderer().isDocumentElementRenderer()) 5886 5886 return true; 5887 5887 … … 6036 6036 return LayoutRect(); 6037 6037 6038 if (isR ootLayer()) {6038 if (isRenderViewLayer()) { 6039 6039 // The root layer is always just the size of the document. 6040 6040 return renderer().view().unscaledDocumentRect(); … … 6586 6586 || renderer().isEmbeddedObject() 6587 6587 || renderer().isRenderIFrame() 6588 || (renderer().style().specifiesColumns() && !isR ootLayer())6588 || (renderer().style().specifiesColumns() && !isRenderViewLayer()) 6589 6589 || renderer().isInFlowRenderFlowThread(); 6590 6590 } -
trunk/Source/WebCore/rendering/RenderLayer.h
r220806 r221958 294 294 void setInResizeMode(bool b) { m_inResizeMode = b; } 295 295 296 bool isR ootLayer() const { return m_isRootLayer; }296 bool isRenderViewLayer() const { return m_isRenderViewLayer; } 297 297 298 298 RenderLayerCompositor& compositor() const; … … 761 761 // Non-auto z-index always implies stacking context here, because StyleResolver::adjustRenderStyle already adjusts z-index 762 762 // based on positioning and other criteria. 763 bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isR ootLayer() || m_forcedStackingContext; }763 bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRenderViewLayer() || m_forcedStackingContext; } 764 764 765 765 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStackingContainer(); } … … 1047 1047 // The bitfields are up here so they will fall into the padding from ScrollableArea on 64-bit. 1048 1048 1049 const bool m_isR ootLayer : 1;1049 const bool m_isRenderViewLayer : 1; 1050 1050 const bool m_forcedStackingContext : 1; 1051 1051 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r221813 r221958 210 210 : m_owningLayer(layer) 211 211 { 212 if (layer.isR ootLayer()) {212 if (layer.isRenderViewLayer()) { 213 213 m_isMainFrameRenderViewLayer = renderer().frame().isMainFrame(); 214 214 m_isFrameLayerWithTiledBacking = renderer().page().chrome().client().shouldUseTiledBackingForFrameView(renderer().view().frameView()); … … 721 721 PaintedContentsInfo contentsInfo(*this); 722 722 723 if (!m_owningLayer.isR ootLayer()) {723 if (!m_owningLayer.isRenderViewLayer()) { 724 724 bool didUpdateContentsRect = false; 725 725 updateDirectlyCompositedBoxDecorations(contentsInfo, didUpdateContentsRect); … … 1221 1221 contentsInfo.setWantsSubpixelAntialiasedTextState(GraphicsLayer::supportsSubpixelAntialiasedLayerText()); 1222 1222 1223 if (!m_owningLayer.isR ootLayer()) {1223 if (!m_owningLayer.isRenderViewLayer()) { 1224 1224 bool didUpdateContentsRect = false; 1225 1225 updateDirectlyCompositedBoxDecorations(contentsInfo, didUpdateContentsRect); … … 2403 2403 return false; 2404 2404 2405 if (m_owningLayer.isR ootLayer()) {2405 if (m_owningLayer.isRenderViewLayer()) { 2406 2406 #if PLATFORM(IOS) || USE(COORDINATED_GRAPHICS) 2407 2407 if (compositor().inForcedCompositingMode()) … … 2556 2556 2557 2557 FrameView::PaintingState paintingState; 2558 if (m_owningLayer.isR ootLayer())2558 if (m_owningLayer.isRenderViewLayer()) 2559 2559 renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState); 2560 2560 … … 2566 2566 m_owningLayer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars); 2567 2567 2568 if (m_owningLayer.isR ootLayer())2568 if (m_owningLayer.isRenderViewLayer()) 2569 2569 renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState); 2570 2570 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r221845 r221958 799 799 800 800 RenderLayerBacking* backing = layer.backing(); 801 if (requiresCompositingLayer(layer) || layer.isR ootLayer()) {801 if (requiresCompositingLayer(layer) || layer.isRenderViewLayer()) { 802 802 ++m_obligateCompositedLayerCount; 803 803 m_obligatoryBackingStoreBytes += backing->backingStoreMemoryEstimate(); … … 956 956 { 957 957 // Needed for scroll bars. 958 if (layer.isR ootLayer())958 if (layer.isRenderViewLayer()) 959 959 return true; 960 960 … … 1024 1024 layer.ensureBacking(); 1025 1025 1026 if (layer.isR ootLayer() && useCoordinatedScrollingForLayer(layer)) {1026 if (layer.isRenderViewLayer() && useCoordinatedScrollingForLayer(layer)) { 1027 1027 updateScrollCoordinatedStatus(layer, { ScrollingNodeChangeFlags::Layer, ScrollingNodeChangeFlags::LayerGeometry }); 1028 1028 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator()) … … 1154 1154 // The contents of this layer may be moving from a GraphicsLayer to the window, 1155 1155 // so we need to make sure the window system synchronizes those changes on the screen. 1156 if (compositedAncestor->isR ootLayer())1156 if (compositedAncestor->isRenderViewLayer()) 1157 1157 m_renderView.frameView().setNeedsOneShotDrawingSynchronization(); 1158 1158 } … … 1219 1219 void RenderLayerCompositor::addToOverlapMap(OverlapMap& overlapMap, const RenderLayer& layer, OverlapExtent& extent) 1220 1220 { 1221 if (layer.isR ootLayer())1221 if (layer.isRenderViewLayer()) 1222 1222 return; 1223 1223 … … 1274 1274 void RenderLayerCompositor::computeCompositingRequirementsForNamedFlowFixed(RenderLayer& layer, OverlapMap& overlapMap, CompositingState& childState, bool& layersChanged, bool& anyDescendantHas3DTransform) 1275 1275 { 1276 if (!layer.isR ootLayer())1276 if (!layer.isRenderViewLayer()) 1277 1277 return; 1278 1278 … … 1322 1322 // Use the fact that we're composited as a hint to check for an animating transform. 1323 1323 // FIXME: Maybe needsToBeComposited() should return a bitmask of reasons, to avoid the need to recompute things. 1324 if (willBeComposited && !layer.isR ootLayer())1324 if (willBeComposited && !layer.isRenderViewLayer()) 1325 1325 layerExtent.hasTransformAnimation = isRunningTransformAnimation(layer.renderer()); 1326 1326 … … 1427 1427 } 1428 1428 1429 if (layer.isR ootLayer())1429 if (layer.isRenderViewLayer()) 1430 1430 computeCompositingRequirementsForNamedFlowFixed(layer, overlapMap, childState, layersChanged, anyDescendantHas3DTransform); 1431 1431 1432 1432 // If we just entered compositing mode, the root will have become composited (as long as accelerated compositing is enabled). 1433 if (layer.isR ootLayer()) {1433 if (layer.isRenderViewLayer()) { 1434 1434 if (inCompositingMode() && m_hasAcceleratedCompositing) 1435 1435 willBeComposited = true; … … 1443 1443 // FIXME: When layerExtent has taken animation bounds into account, we also know that the bounds 1444 1444 // include descendants, so we don't need to add them all to the overlap map. 1445 if (childState.compositingAncestor && !childState.compositingAncestor->isR ootLayer())1445 if (childState.compositingAncestor && !childState.compositingAncestor->isRenderViewLayer()) 1446 1446 addToOverlapMap(overlapMap, layer, layerExtent); 1447 1447 … … 1498 1498 #endif 1499 1499 1500 if (childState.compositingAncestor == &layer && !layer.isR ootLayer())1500 if (childState.compositingAncestor == &layer && !layer.isRenderViewLayer()) 1501 1501 overlapMap.popCompositingContainer(); 1502 1502 … … 1504 1504 // to be composited, then we can drop out of compositing mode altogether. However, don't drop out of compositing mode 1505 1505 // if there are composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden). 1506 if (layer.isR ootLayer() && !childState.subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) {1506 if (layer.isRenderViewLayer() && !childState.subtreeIsCompositing && !requiresCompositingLayer(layer) && !m_forceCompositingMode && !hasAnyAdditionalCompositedLayers(layer)) { 1507 1507 // Don't drop out of compositing on iOS, because we may flash. See <rdar://problem/8348337>. 1508 1508 #if !PLATFORM(IOS) … … 1584 1584 void RenderLayerCompositor::rebuildCompositingLayerTreeForNamedFlowFixed(RenderLayer& layer, Vector<GraphicsLayer*>& childGraphicsLayersOfEnclosingLayer, int depth) 1585 1585 { 1586 if (!layer.isR ootLayer())1586 if (!layer.isRenderViewLayer()) 1587 1587 return; 1588 1588 … … 1670 1670 } 1671 1671 1672 if (layer.isR ootLayer())1672 if (layer.isRenderViewLayer()) 1673 1673 rebuildCompositingLayerTreeForNamedFlowFixed(layer, childList, depth + 1); 1674 1674 … … 2163 2163 return false; 2164 2164 2165 return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer.mustCompositeForIndirectReasons() || (inCompositingMode() && layer.isR ootLayer());2165 return requiresCompositingLayer(layer, viewportConstrainedNotCompositedReason) || layer.mustCompositeForIndirectReasons() || (inCompositingMode() && layer.isRenderViewLayer()); 2166 2166 } 2167 2167 … … 2217 2217 return true; 2218 2218 2219 if (layer.isR ootLayer()2219 if (layer.isRenderViewLayer() 2220 2220 || layer.transform() // note: excludes perspective and transformStyle3D. 2221 2221 || requiresCompositingForAnimation(renderer) … … 2229 2229 || requiresCompositingForPlugin(renderer) 2230 2230 || requiresCompositingForOverflowScrolling(layer) 2231 #if PLATFORM(IOS) 2232 || requiresCompositingForScrolling(layer) 2233 #endif 2231 2234 || renderer.isTransparent() 2232 2235 || renderer.hasMask() 2233 2236 || renderer.hasReflection() 2234 2237 || renderer.hasFilter() 2235 || renderer.hasBackdropFilter() 2236 #if PLATFORM(IOS) 2237 || requiresCompositingForScrolling(layer) 2238 #endif 2239 ) 2238 || renderer.hasBackdropFilter()) 2240 2239 return true; 2241 2240 … … 2346 2345 } 2347 2346 2348 if (inCompositingMode() && renderer.layer()->isR ootLayer())2347 if (inCompositingMode() && renderer.layer()->isRenderViewLayer()) 2349 2348 reasons |= CompositingReason::Root; 2350 2349 … … 2754 2753 bool RenderLayerCompositor::useCoordinatedScrollingForLayer(const RenderLayer& layer) const 2755 2754 { 2756 if (layer.isR ootLayer() && hasCoordinatedScrolling())2755 if (layer.isRenderViewLayer() && hasCoordinatedScrolling()) 2757 2756 return true; 2758 2757 … … 2923 2922 bool RenderLayerCompositor::needsFixedRootBackgroundLayer(const RenderLayer& layer) const 2924 2923 { 2925 if (!layer.isR ootLayer())2924 if (!layer.isRenderViewLayer()) 2926 2925 return false; 2927 2926 … … 3894 3893 return; 3895 3894 3896 bool isR ootLayer = layer.isRootLayer();3897 3898 if (!layer.parent() && !isR ootLayer)3895 bool isRenderViewLayer = layer.isRenderViewLayer(); 3896 3897 if (!layer.parent() && !isRenderViewLayer) 3899 3898 return; 3900 3899 … … 3912 3911 3913 3912 updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID); 3914 if (!(reasons & ViewportConstrained) && isR ootLayer)3913 if (!(reasons & ViewportConstrained) && isRenderViewLayer) 3915 3914 return; 3916 3915 } 3917 3916 3918 3917 ScrollingNodeID parentNodeID = enclosingScrollingNodeID(layer, ExcludeSelf); 3919 if (!parentNodeID && !isR ootLayer)3918 if (!parentNodeID && !isRenderViewLayer) 3920 3919 return; 3921 3920 … … 3959 3958 3960 3959 if (reasons & Scrolling) { 3961 if (isR ootLayer)3960 if (isRenderViewLayer) 3962 3961 updateScrollCoordinationForThisFrame(parentNodeID); 3963 3962 else {
Note: See TracChangeset
for help on using the changeset viewer.