OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 // anyway. | 347 // anyway. |
348 layoutObject.clearPreviousVisualRects(); | 348 layoutObject.clearPreviousVisualRects(); |
349 | 349 |
350 for (LayoutObject* child = layoutObject.slowFirstChild(); child; | 350 for (LayoutObject* child = layoutObject.slowFirstChild(); child; |
351 child = child->nextSibling()) { | 351 child = child->nextSibling()) { |
352 if (!child->isPaintInvalidationContainer()) | 352 if (!child->isPaintInvalidationContainer()) |
353 forceRecomputeVisualRectsIncludingNonCompositingDescendants(*child); | 353 forceRecomputeVisualRectsIncludingNonCompositingDescendants(*child); |
354 } | 354 } |
355 } | 355 } |
356 | 356 |
357 GraphicsLayer* PaintLayerCompositor::parentForContentLayers() const { | |
358 if (m_rootContentLayer) | |
359 return m_rootContentLayer.get(); | |
360 // Iframe content layers will be connected by the parent frame using | |
361 // attachFrameContentLayersToIframeLayer. | |
362 return isMainFrame() ? visualViewport().scrollLayer() : nullptr; | |
bokan
2017/03/06 15:42:30
Is it true that !rootContentLayer implies rootLaye
skobes
2017/03/06 23:00:25
Done.
| |
363 } | |
364 | |
357 void PaintLayerCompositor::updateIfNeeded() { | 365 void PaintLayerCompositor::updateIfNeeded() { |
358 CompositingUpdateType updateType = m_pendingUpdateType; | 366 CompositingUpdateType updateType = m_pendingUpdateType; |
359 m_pendingUpdateType = CompositingUpdateNone; | 367 m_pendingUpdateType = CompositingUpdateNone; |
360 | 368 |
361 if (!hasAcceleratedCompositing()) { | 369 if (!hasAcceleratedCompositing()) { |
362 updateWithoutAcceleratedCompositing(updateType); | 370 updateWithoutAcceleratedCompositing(updateType); |
363 return; | 371 return; |
364 } | 372 } |
365 | 373 |
366 if (updateType == CompositingUpdateNone) | 374 if (updateType == CompositingUpdateNone) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
437 #endif | 445 #endif |
438 } | 446 } |
439 | 447 |
440 if (updateType >= CompositingUpdateRebuildTree) { | 448 if (updateType >= CompositingUpdateRebuildTree) { |
441 GraphicsLayerVector childList; | 449 GraphicsLayerVector childList; |
442 { | 450 { |
443 TRACE_EVENT0("blink", "GraphicsLayerTreeBuilder::rebuild"); | 451 TRACE_EVENT0("blink", "GraphicsLayerTreeBuilder::rebuild"); |
444 GraphicsLayerTreeBuilder().rebuild(*updateRoot, childList); | 452 GraphicsLayerTreeBuilder().rebuild(*updateRoot, childList); |
445 } | 453 } |
446 | 454 |
447 if (!childList.isEmpty()) { | 455 GraphicsLayer* contentParent = parentForContentLayers(); |
448 CHECK(m_rootContentLayer && m_compositing); | 456 if (contentParent && !childList.isEmpty()) { |
449 m_rootContentLayer->setChildren(childList); | 457 CHECK(m_compositing); |
458 contentParent->setChildren(childList); | |
450 } | 459 } |
451 | 460 |
452 applyOverlayFullscreenVideoAdjustmentIfNeeded(); | 461 applyOverlayFullscreenVideoAdjustmentIfNeeded(); |
453 } | 462 } |
454 | 463 |
455 if (m_needsUpdateFixedBackground) { | 464 if (m_needsUpdateFixedBackground) { |
456 rootFixedBackgroundsChanged(); | 465 rootFixedBackgroundsChanged(); |
457 m_needsUpdateFixedBackground = false; | 466 m_needsUpdateFixedBackground = false; |
458 } | 467 } |
459 | 468 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 AcceleratedFixedRootBackgroundHistogramMax)); | 694 AcceleratedFixedRootBackgroundHistogramMax)); |
686 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); | 695 acceleratedBackgroundHistogram.count(ScrolledMainFrameBucket); |
687 } | 696 } |
688 | 697 |
689 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { | 698 void PaintLayerCompositor::frameViewScrollbarsExistenceDidChange() { |
690 if (m_containerLayer) | 699 if (m_containerLayer) |
691 updateOverflowControlsLayers(); | 700 updateOverflowControlsLayers(); |
692 } | 701 } |
693 | 702 |
694 void PaintLayerCompositor::rootFixedBackgroundsChanged() { | 703 void PaintLayerCompositor::rootFixedBackgroundsChanged() { |
695 if (!supportsFixedRootBackgroundCompositing()) | 704 if (!supportsFixedRootBackgroundCompositing() || !m_containerLayer) |
696 return; | 705 return; |
697 | 706 |
698 // To avoid having to make the fixed root background layer fixed positioned to | 707 // To avoid having to make the fixed root background layer fixed positioned to |
699 // stay put, we position it in the layer tree as follows: | 708 // stay put, we position it in the layer tree as follows: |
700 // | 709 // |
701 // + Overflow controls host | 710 // + Overflow controls host |
702 // + LocalFrame clip | 711 // + LocalFrame clip |
703 // + (Fixed root background) <-- Here. | 712 // + (Fixed root background) <-- Here. |
704 // + LocalFrame scroll | 713 // + LocalFrame scroll |
705 // + Root content layer | 714 // + Root content layer |
(...skipping 11 matching lines...) Expand all Loading... | |
717 return scrollingCoordinator->scrollableAreaScrollLayerDidChange( | 726 return scrollingCoordinator->scrollableAreaScrollLayerDidChange( |
718 layer->getScrollableArea()); | 727 layer->getScrollableArea()); |
719 return false; | 728 return false; |
720 } | 729 } |
721 | 730 |
722 std::unique_ptr<JSONObject> PaintLayerCompositor::layerTreeAsJSON( | 731 std::unique_ptr<JSONObject> PaintLayerCompositor::layerTreeAsJSON( |
723 LayerTreeFlags flags) const { | 732 LayerTreeFlags flags) const { |
724 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || | 733 ASSERT(lifecycle().state() >= DocumentLifecycle::PaintInvalidationClean || |
725 m_layoutView.frameView()->shouldThrottleRendering()); | 734 m_layoutView.frameView()->shouldThrottleRendering()); |
726 | 735 |
727 if (!m_rootContentLayer) | |
728 return nullptr; | |
729 | |
730 // We skip dumping the scroll and clip layers to keep layerTreeAsText output | 736 // We skip dumping the scroll and clip layers to keep layerTreeAsText output |
731 // similar between platforms (unless we explicitly request dumping from the | 737 // similar between platforms (unless we explicitly request dumping from the |
732 // root. | 738 // root. |
733 GraphicsLayer* rootLayer = m_rootContentLayer.get(); | 739 GraphicsLayer* rootLayer = m_rootContentLayer.get(); |
740 if (!rootLayer) | |
741 rootLayer = rootGraphicsLayer(); | |
742 | |
743 if (!rootLayer) | |
744 return nullptr; | |
745 | |
734 if (flags & LayerTreeIncludesRootLayer) { | 746 if (flags & LayerTreeIncludesRootLayer) { |
735 if (isMainFrame()) { | 747 if (isMainFrame()) { |
736 while (rootLayer->parent()) | 748 while (rootLayer->parent()) |
737 rootLayer = rootLayer->parent(); | 749 rootLayer = rootLayer->parent(); |
738 } else { | 750 } else { |
739 rootLayer = rootGraphicsLayer(); | 751 rootLayer = rootGraphicsLayer(); |
740 } | 752 } |
741 } | 753 } |
742 | 754 |
743 return rootLayer->layerTreeAsJSON(flags); | 755 return rootLayer->layerTreeAsJSON(flags); |
(...skipping 17 matching lines...) Expand all Loading... | |
761 PaintLayerCompositor* innerCompositor = frameContentsCompositor(layoutObject); | 773 PaintLayerCompositor* innerCompositor = frameContentsCompositor(layoutObject); |
762 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || | 774 if (!innerCompositor || !innerCompositor->staleInCompositingMode() || |
763 innerCompositor->getRootLayerAttachment() != | 775 innerCompositor->getRootLayerAttachment() != |
764 RootLayerAttachedViaEnclosingFrame) | 776 RootLayerAttachedViaEnclosingFrame) |
765 return false; | 777 return false; |
766 | 778 |
767 PaintLayer* layer = layoutObject.layer(); | 779 PaintLayer* layer = layoutObject.layer(); |
768 if (!layer->hasCompositedLayerMapping()) | 780 if (!layer->hasCompositedLayerMapping()) |
769 return false; | 781 return false; |
770 | 782 |
783 DisableCompositingQueryAsserts disabler; | |
771 layer->compositedLayerMapping()->setSublayers( | 784 layer->compositedLayerMapping()->setSublayers( |
772 GraphicsLayerVector(1, innerCompositor->rootGraphicsLayer())); | 785 GraphicsLayerVector(1, innerCompositor->rootGraphicsLayer())); |
773 return true; | 786 return true; |
774 } | 787 } |
775 | 788 |
776 static void fullyInvalidatePaintRecursive(PaintLayer* layer) { | 789 static void fullyInvalidatePaintRecursive(PaintLayer* layer) { |
777 if (layer->compositingState() == PaintsIntoOwnBacking) { | 790 if (layer->compositingState() == PaintsIntoOwnBacking) { |
778 layer->compositedLayerMapping()->setContentsNeedDisplay(); | 791 layer->compositedLayerMapping()->setContentsNeedDisplay(); |
779 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay(); | 792 layer->compositedLayerMapping()->setSquashingContentsNeedDisplay(); |
780 } | 793 } |
781 | 794 |
782 for (PaintLayer* child = layer->firstChild(); child; | 795 for (PaintLayer* child = layer->firstChild(); child; |
783 child = child->nextSibling()) | 796 child = child->nextSibling()) |
784 fullyInvalidatePaintRecursive(child); | 797 fullyInvalidatePaintRecursive(child); |
785 } | 798 } |
786 | 799 |
787 void PaintLayerCompositor::fullyInvalidatePaint() { | 800 void PaintLayerCompositor::fullyInvalidatePaint() { |
788 // We're walking all compositing layers and invalidating them, so there's | 801 // We're walking all compositing layers and invalidating them, so there's |
789 // no need to have up-to-date compositing state. | 802 // no need to have up-to-date compositing state. |
790 DisableCompositingQueryAsserts disabler; | 803 DisableCompositingQueryAsserts disabler; |
791 fullyInvalidatePaintRecursive(rootLayer()); | 804 fullyInvalidatePaintRecursive(rootLayer()); |
792 } | 805 } |
793 | 806 |
794 PaintLayer* PaintLayerCompositor::rootLayer() const { | 807 PaintLayer* PaintLayerCompositor::rootLayer() const { |
795 return m_layoutView.layer(); | 808 return m_layoutView.layer(); |
796 } | 809 } |
797 | 810 |
798 GraphicsLayer* PaintLayerCompositor::rootGraphicsLayer() const { | 811 GraphicsLayer* PaintLayerCompositor::rootGraphicsLayer() const { |
799 return m_overflowControlsHostLayer.get(); | 812 if (m_overflowControlsHostLayer) |
800 } | 813 return m_overflowControlsHostLayer.get(); |
801 | 814 if (CompositedLayerMapping* clm = rootLayer()->compositedLayerMapping()) |
802 GraphicsLayer* PaintLayerCompositor::frameScrollLayer() const { | 815 return clm->childForSuperlayers(); |
803 return m_scrollLayer.get(); | 816 return nullptr; |
804 } | 817 } |
805 | 818 |
806 GraphicsLayer* PaintLayerCompositor::scrollLayer() const { | 819 GraphicsLayer* PaintLayerCompositor::scrollLayer() const { |
807 if (ScrollableArea* scrollableArea = | 820 if (ScrollableArea* scrollableArea = |
808 m_layoutView.frameView()->getScrollableArea()) | 821 m_layoutView.frameView()->getScrollableArea()) |
809 return scrollableArea->layerForScrolling(); | 822 return scrollableArea->layerForScrolling(); |
810 return nullptr; | 823 return nullptr; |
811 } | 824 } |
812 | 825 |
813 GraphicsLayer* PaintLayerCompositor::containerLayer() const { | |
814 return m_containerLayer.get(); | |
815 } | |
816 | |
817 GraphicsLayer* PaintLayerCompositor::rootContentLayer() const { | |
818 return m_rootContentLayer.get(); | |
819 } | |
820 | |
821 void PaintLayerCompositor::setIsInWindow(bool isInWindow) { | 826 void PaintLayerCompositor::setIsInWindow(bool isInWindow) { |
822 if (!staleInCompositingMode()) | 827 if (!staleInCompositingMode()) |
823 return; | 828 return; |
824 | 829 |
825 if (isInWindow) { | 830 if (isInWindow) { |
826 if (m_rootLayerAttachment != RootLayerUnattached) | 831 if (m_rootLayerAttachment != RootLayerUnattached) |
827 return; | 832 return; |
828 | 833 |
829 RootLayerAttachment attachment = m_layoutView.frame()->isLocalRoot() | 834 RootLayerAttachment attachment = m_layoutView.frame()->isLocalRoot() |
830 ? RootLayerAttachedViaChromeClient | 835 ? RootLayerAttachedViaChromeClient |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1121 void PaintLayerCompositor::ensureRootLayer() { | 1126 void PaintLayerCompositor::ensureRootLayer() { |
1122 RootLayerAttachment expectedAttachment = | 1127 RootLayerAttachment expectedAttachment = |
1123 m_layoutView.frame()->isLocalRoot() ? RootLayerAttachedViaChromeClient | 1128 m_layoutView.frame()->isLocalRoot() ? RootLayerAttachedViaChromeClient |
1124 : RootLayerAttachedViaEnclosingFrame; | 1129 : RootLayerAttachedViaEnclosingFrame; |
1125 if (expectedAttachment == m_rootLayerAttachment) | 1130 if (expectedAttachment == m_rootLayerAttachment) |
1126 return; | 1131 return; |
1127 | 1132 |
1128 if (isMainFrame()) | 1133 if (isMainFrame()) |
1129 visualViewport().createLayerTree(); | 1134 visualViewport().createLayerTree(); |
1130 | 1135 |
1131 if (!m_rootContentLayer) { | 1136 // When RLS is enabled, none of the PLC GraphicsLayers exist. |
1137 bool shouldCreateOwnLayers = | |
1138 !RuntimeEnabledFeatures::rootLayerScrollingEnabled(); | |
1139 | |
1140 if (shouldCreateOwnLayers && !m_rootContentLayer) { | |
1132 m_rootContentLayer = GraphicsLayer::create(this); | 1141 m_rootContentLayer = GraphicsLayer::create(this); |
1133 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); | 1142 IntRect overflowRect = m_layoutView.pixelSnappedLayoutOverflowRect(); |
1134 m_rootContentLayer->setSize( | 1143 m_rootContentLayer->setSize( |
1135 FloatSize(overflowRect.maxX(), overflowRect.maxY())); | 1144 FloatSize(overflowRect.maxX(), overflowRect.maxY())); |
1136 m_rootContentLayer->setPosition(FloatPoint()); | 1145 m_rootContentLayer->setPosition(FloatPoint()); |
1137 m_rootContentLayer->setOwnerNodeId( | 1146 m_rootContentLayer->setOwnerNodeId( |
1138 DOMNodeIds::idForNode(m_layoutView.node())); | 1147 DOMNodeIds::idForNode(m_layoutView.node())); |
1139 } | 1148 } |
1140 | 1149 |
1141 if (!m_overflowControlsHostLayer) { | 1150 if (shouldCreateOwnLayers && !m_overflowControlsHostLayer) { |
1142 ASSERT(!m_scrollLayer); | 1151 ASSERT(!m_scrollLayer); |
1143 ASSERT(!m_containerLayer); | 1152 ASSERT(!m_containerLayer); |
1144 | 1153 |
1145 // Create a layer to host the clipping layer and the overflow controls | 1154 // Create a layer to host the clipping layer and the overflow controls |
1146 // layers. Whether these layers mask the content below is determined | 1155 // layers. Whether these layers mask the content below is determined |
1147 // in updateClippingOnCompositorLayers. | 1156 // in updateClippingOnCompositorLayers. |
1148 m_overflowControlsHostLayer = GraphicsLayer::create(this); | 1157 m_overflowControlsHostLayer = GraphicsLayer::create(this); |
1149 m_containerLayer = GraphicsLayer::create(this); | 1158 m_containerLayer = GraphicsLayer::create(this); |
1150 | 1159 |
1151 // TODO(skobes): When root layer scrolling is enabled, we should not even | 1160 // TODO(skobes): When root layer scrolling is enabled, we should not even |
szager1
2017/03/06 22:07:47
Remove this comment.
skobes
2017/03/06 23:00:25
Done.
| |
1152 // create m_scrollLayer or most of the layers in PLC. | 1161 // create m_scrollLayer or most of the layers in PLC. |
1153 m_scrollLayer = GraphicsLayer::create(this); | 1162 m_scrollLayer = GraphicsLayer::create(this); |
1154 if (ScrollingCoordinator* scrollingCoordinator = | 1163 if (ScrollingCoordinator* scrollingCoordinator = |
1155 this->scrollingCoordinator()) | 1164 this->scrollingCoordinator()) |
1156 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers( | 1165 scrollingCoordinator->setLayerIsContainerForFixedPositionLayers( |
1157 m_scrollLayer.get(), true); | 1166 m_scrollLayer.get(), true); |
1158 | 1167 |
1159 // In RLS mode, LayoutView scrolling contents layer gets this element ID (in | 1168 // In RLS mode, LayoutView scrolling contents layer gets this element ID (in |
1160 // CompositedLayerMapping::updateElementIdAndCompositorMutableProperties). | 1169 // CompositedLayerMapping::updateElementIdAndCompositorMutableProperties). |
1161 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 1170 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
(...skipping 14 matching lines...) Expand all Loading... | |
1176 if (m_rootLayerAttachment != RootLayerUnattached) { | 1185 if (m_rootLayerAttachment != RootLayerUnattached) { |
1177 detachRootLayer(); | 1186 detachRootLayer(); |
1178 detachCompositorTimeline(); | 1187 detachCompositorTimeline(); |
1179 } | 1188 } |
1180 | 1189 |
1181 attachCompositorTimeline(); | 1190 attachCompositorTimeline(); |
1182 attachRootLayer(expectedAttachment); | 1191 attachRootLayer(expectedAttachment); |
1183 } | 1192 } |
1184 | 1193 |
1185 void PaintLayerCompositor::destroyRootLayer() { | 1194 void PaintLayerCompositor::destroyRootLayer() { |
1186 if (!m_rootContentLayer) | |
bokan
2017/03/06 15:42:30
It seems like the existence of rootContentLayer wa
skobes
2017/03/06 23:00:25
PLC still tracks its state in m_rootLayerAttachmen
| |
1187 return; | |
1188 | |
1189 detachRootLayer(); | 1195 detachRootLayer(); |
1190 | 1196 |
1191 if (m_layerForHorizontalScrollbar) { | 1197 if (m_layerForHorizontalScrollbar) { |
1192 m_layerForHorizontalScrollbar->removeFromParent(); | 1198 m_layerForHorizontalScrollbar->removeFromParent(); |
1193 m_layerForHorizontalScrollbar = nullptr; | 1199 m_layerForHorizontalScrollbar = nullptr; |
1194 if (ScrollingCoordinator* scrollingCoordinator = | 1200 if (ScrollingCoordinator* scrollingCoordinator = |
1195 this->scrollingCoordinator()) | 1201 this->scrollingCoordinator()) |
1196 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( | 1202 scrollingCoordinator->scrollableAreaScrollbarLayerDidChange( |
1197 m_layoutView.frameView(), HorizontalScrollbar); | 1203 m_layoutView.frameView(), HorizontalScrollbar); |
1198 m_layoutView.frameView()->setScrollbarNeedsPaintInvalidation( | 1204 m_layoutView.frameView()->setScrollbarNeedsPaintInvalidation( |
(...skipping 19 matching lines...) Expand all Loading... | |
1218 if (m_overflowControlsHostLayer) { | 1224 if (m_overflowControlsHostLayer) { |
1219 m_overflowControlsHostLayer = nullptr; | 1225 m_overflowControlsHostLayer = nullptr; |
1220 m_containerLayer = nullptr; | 1226 m_containerLayer = nullptr; |
1221 m_scrollLayer = nullptr; | 1227 m_scrollLayer = nullptr; |
1222 } | 1228 } |
1223 ASSERT(!m_scrollLayer); | 1229 ASSERT(!m_scrollLayer); |
1224 m_rootContentLayer = nullptr; | 1230 m_rootContentLayer = nullptr; |
1225 } | 1231 } |
1226 | 1232 |
1227 void PaintLayerCompositor::attachRootLayer(RootLayerAttachment attachment) { | 1233 void PaintLayerCompositor::attachRootLayer(RootLayerAttachment attachment) { |
1228 if (!m_rootContentLayer) | 1234 DisableCompositingQueryAsserts disabler; |
szager1
2017/03/06 22:07:47
Why is this now necessary?
skobes
2017/03/06 23:00:25
Done.
| |
1229 return; | |
1230 | 1235 |
1231 // In Slimming Paint v2, PaintArtifactCompositor is responsible for the root | 1236 // In Slimming Paint v2, PaintArtifactCompositor is responsible for the root |
1232 // layer. | 1237 // layer. |
1233 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 1238 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
1234 return; | 1239 return; |
1235 | 1240 |
1236 switch (attachment) { | 1241 switch (attachment) { |
1237 case RootLayerUnattached: | 1242 case RootLayerUnattached: |
1238 ASSERT_NOT_REACHED(); | 1243 ASSERT_NOT_REACHED(); |
1239 break; | 1244 break; |
1240 case RootLayerAttachedViaChromeClient: | 1245 case RootLayerAttachedViaChromeClient: |
1241 m_pendingChromeClientAttachment = true; | 1246 m_pendingChromeClientAttachment = true; |
1242 break; | 1247 break; |
1243 case RootLayerAttachedViaEnclosingFrame: { | 1248 case RootLayerAttachedViaEnclosingFrame: { |
1244 HTMLFrameOwnerElement* ownerElement = | 1249 HTMLFrameOwnerElement* ownerElement = |
1245 m_layoutView.document().localOwner(); | 1250 m_layoutView.document().localOwner(); |
1246 ASSERT(ownerElement); | 1251 ASSERT(ownerElement); |
1247 // The layer will get hooked up via | 1252 // The layer will get hooked up via |
1248 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the | 1253 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the |
1249 // frame's layoutObject in the parent document. | 1254 // frame's layoutObject in the parent document. |
1250 ownerElement->setNeedsCompositingUpdate(); | 1255 ownerElement->setNeedsCompositingUpdate(); |
1251 break; | 1256 break; |
1252 } | 1257 } |
1253 } | 1258 } |
1254 | 1259 |
1255 m_rootLayerAttachment = attachment; | 1260 m_rootLayerAttachment = attachment; |
1256 } | 1261 } |
1257 | 1262 |
1258 void PaintLayerCompositor::detachRootLayer() { | 1263 void PaintLayerCompositor::detachRootLayer() { |
1259 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) | 1264 if (m_rootLayerAttachment == RootLayerUnattached) |
1260 return; | 1265 return; |
1261 | 1266 |
1262 switch (m_rootLayerAttachment) { | 1267 switch (m_rootLayerAttachment) { |
1263 case RootLayerAttachedViaEnclosingFrame: { | 1268 case RootLayerAttachedViaEnclosingFrame: { |
1264 // The layer will get unhooked up via | 1269 // The layer will get unhooked up via |
1265 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the | 1270 // CompositedLayerMapping::updateGraphicsLayerConfiguration() for the |
1266 // frame's layoutObject in the parent document. | 1271 // frame's layoutObject in the parent document. |
1267 if (m_overflowControlsHostLayer) | 1272 if (m_overflowControlsHostLayer) |
1268 m_overflowControlsHostLayer->removeFromParent(); | 1273 m_overflowControlsHostLayer->removeFromParent(); |
1269 else | 1274 else if (m_rootContentLayer) |
bokan
2017/03/06 15:42:29
Just some questions for my own benefit: how does t
skobes
2017/03/06 23:00:25
Good question. It looks like this branch is a his
| |
1270 m_rootContentLayer->removeFromParent(); | 1275 m_rootContentLayer->removeFromParent(); |
1271 | 1276 |
1272 if (HTMLFrameOwnerElement* ownerElement = | 1277 if (HTMLFrameOwnerElement* ownerElement = |
1273 m_layoutView.document().localOwner()) | 1278 m_layoutView.document().localOwner()) |
1274 ownerElement->setNeedsCompositingUpdate(); | 1279 ownerElement->setNeedsCompositingUpdate(); |
1275 break; | 1280 break; |
1276 } | 1281 } |
1277 case RootLayerAttachedViaChromeClient: { | 1282 case RootLayerAttachedViaChromeClient: { |
1278 LocalFrame& frame = m_layoutView.frameView()->frame(); | 1283 LocalFrame& frame = m_layoutView.frameView()->frame(); |
1279 Page* page = frame.page(); | 1284 Page* page = frame.page(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1361 } else if (graphicsLayer == m_scrollLayer.get()) { | 1366 } else if (graphicsLayer == m_scrollLayer.get()) { |
1362 name = "Frame Scrolling Layer"; | 1367 name = "Frame Scrolling Layer"; |
1363 } else { | 1368 } else { |
1364 ASSERT_NOT_REACHED(); | 1369 ASSERT_NOT_REACHED(); |
1365 } | 1370 } |
1366 | 1371 |
1367 return name; | 1372 return name; |
1368 } | 1373 } |
1369 | 1374 |
1370 } // namespace blink | 1375 } // namespace blink |
OLD | NEW |