Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| index 960e797a567a0e278c8e0bfb066efd0e17373b59..aa5ef52254f60256d7d8963d211e8db862c0cab8 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp |
| @@ -83,7 +83,8 @@ PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView) |
| m_isTrackingRasterInvalidations( |
| layoutView.frameView()->isTrackingPaintInvalidations()), |
| m_inOverlayFullscreenVideo(false), |
| - m_rootLayerAttachment(RootLayerUnattached) { |
| + m_rootLayerAttachment(RootLayerUnattached), |
| + m_pendingChromeClientAttachment(false) { |
| updateAcceleratedCompositingSettings(); |
| } |
| @@ -461,6 +462,14 @@ void PaintLayerCompositor::updateIfNeeded() { |
| layersNeedingPaintInvalidation[i]->layoutObject()); |
| } |
| + if (m_pendingChromeClientAttachment) { |
| + if (Page* page = m_layoutView.frame()->page()) { |
| + page->chromeClient().attachRootGraphicsLayer(rootGraphicsLayer(), |
| + m_layoutView.frame()); |
| + m_pendingChromeClientAttachment = false; |
| + } |
| + } |
| + |
| // Inform the inspector that the layer tree has changed. |
| if (isMainFrame()) |
| probe::layerTreeDidChange(m_layoutView.frame()); |
| @@ -1228,14 +1237,9 @@ void PaintLayerCompositor::attachRootLayer(RootLayerAttachment attachment) { |
| case RootLayerUnattached: |
| ASSERT_NOT_REACHED(); |
| break; |
| - case RootLayerAttachedViaChromeClient: { |
| - LocalFrame& frame = m_layoutView.frameView()->frame(); |
| - Page* page = frame.page(); |
| - if (!page) |
| - return; |
| - page->chromeClient().attachRootGraphicsLayer(rootGraphicsLayer(), &frame); |
| + case RootLayerAttachedViaChromeClient: |
| + m_pendingChromeClientAttachment = true; |
|
szager1
2017/03/06 22:23:34
Is this new variable necessary? Can't you just ca
skobes
2017/03/06 22:44:23
Not easily - attachRootLayer updates m_rootLayerAt
szager1
2017/03/06 22:57:58
Could you add a RootLayerPendingAttachment value t
skobes
2017/03/07 23:05:46
Done, PTAL.
|
| break; |
| - } |
| case RootLayerAttachedViaEnclosingFrame: { |
| HTMLFrameOwnerElement* ownerElement = |
| m_layoutView.document().localOwner(); |
| @@ -1283,6 +1287,7 @@ void PaintLayerCompositor::detachRootLayer() { |
| } |
| m_rootLayerAttachment = RootLayerUnattached; |
| + m_pendingChromeClientAttachment = false; |
| } |
| void PaintLayerCompositor::updateRootLayerAttachment() { |