Changeset 167316 in webkit
- Timestamp:
- Apr 15, 2014, 10:53:23 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r167313 r167316 1 2014-04-15 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Pages often blank on first load if page loaded by typing the URL 4 https://bugs.webkit.org/show_bug.cgi?id=131665 5 6 Reviewed by Tim Horton. 7 8 The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer() 9 was triggering a compositing layer flush when called with a null rootLayer, which happens 10 for pages going into the page cache. This would trigger a layer flush that would clobber 11 the root layer for the visible page, resulting in missing content. 12 13 Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer 14 was being added to (and then removed from) every single compositing layers. 15 16 Fix both these by changing to a pull model, where RenderLayerCompositor requests 17 the overlay layer via ChromeClient, and gets it at the end of every flush, 18 adding to the children of the root layer. 19 20 * WebCore.exp.in: 21 * page/ChromeClient.h: 22 (WebCore::ChromeClient::documentOverlayLayerForFrame): 23 * rendering/RenderLayerCompositor.cpp: 24 (WebCore::RenderLayerCompositor::RenderLayerCompositor): 25 (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect 26 into a variable for ease of debugging. 27 (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser 28 that we're not in the page cache (this would have caught the bug). 29 (WebCore::RenderLayerCompositor::appendOverlayLayers): 30 (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): 31 (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted. 32 * rendering/RenderLayerCompositor.h: 33 1 34 2014-04-15 Commit Queue <commit-queue@webkit.org> 2 35 -
trunk/Source/WebCore/WebCore.exp.in
r167303 r167316 872 872 __ZN7WebCore21PlatformKeyboardEvent24disambiguateKeyDownEventENS_13PlatformEvent4TypeEb 873 873 __ZN7WebCore21RemoteCommandListener6createERNS_27RemoteCommandListenerClientE 874 __ZN7WebCore21RenderLayerCompositor27setDocumentOverlayRootLayerEPNS_13GraphicsLayerE875 874 __ZN7WebCore21ResourceLoadScheduler20servePendingRequestsENS_20ResourceLoadPriorityE 876 875 __ZN7WebCore21ResourceLoadScheduler20servePendingRequestsEPNS0_15HostInformationENS_20ResourceLoadPriorityE -
trunk/Source/WebCore/page/ChromeClient.h
r167303 r167316 291 291 // regardless of the settings. 292 292 virtual bool allowsAcceleratedCompositing() const { return true; } 293 // Supply a layer that will added as an overlay over other document layers (scrolling with the document). 294 virtual GraphicsLayer* documentOverlayLayerForFrame(Frame&) { return nullptr; } 293 295 294 296 enum CompositingTrigger { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r167303 r167316 256 256 , m_layersWithTiledBackingCount(0) 257 257 , m_rootLayerAttachment(RootLayerUnattached) 258 , m_documentOverlayRootLayer(nullptr)259 258 , m_layerFlushTimer(this, &RenderLayerCompositor::layerFlushTimerFired) 260 259 , m_layerFlushThrottlingEnabled(page() && page()->progress().isMainLoadProgressing()) … … 431 430 double horizontalMargin = defaultTileWidth / pageScaleFactor(); 432 431 double verticalMargin = defaultTileHeight / pageScaleFactor(); 433 rootLayer->flushCompositingState(frameView.computeCoverageRect(horizontalMargin, verticalMargin)); 432 FloatRect visibleRect = frameView.computeCoverageRect(horizontalMargin, verticalMargin); 433 rootLayer->flushCompositingState(visibleRect); 434 434 #else 435 435 // Having a m_clipLayer indicates that we're doing scrolling via GraphicsLayers. … … 598 598 { 599 599 m_updateCompositingLayersTimer.stop(); 600 601 ASSERT(!m_renderView.document().inPageCache()); 600 602 601 603 // Compositing layers will be updated in Document::implicitClose() if suppressed here. … … 690 692 // Host the document layer in the RenderView's root layer. 691 693 if (isFullUpdate) { 694 appendOverlayLayers(childList); 692 695 // Even when childList is empty, don't drop out of compositing mode if there are 693 696 // composited layers that we didn't hit in our traversal (e.g. because of visibility:hidden). 694 697 if (childList.isEmpty() && !hasAnyAdditionalCompositedLayers(*updateRoot)) 695 698 destroyRootLayer(); 696 else 699 else if (m_rootContentLayer) 697 700 m_rootContentLayer->setChildren(childList); 698 701 } … … 720 723 // Inform the inspector that the layer tree has changed. 721 724 InspectorInstrumentation::layerTreeDidChange(page()); 725 } 726 727 void RenderLayerCompositor::appendOverlayLayers(Vector<GraphicsLayer*>& childList) 728 { 729 Frame& frame = m_renderView.frameView().frame(); 730 Page* page = frame.page(); 731 if (!page) 732 return; 733 734 if (GraphicsLayer* overlayLayer = page->chrome().client().documentOverlayLayerForFrame(frame)) 735 childList.append(overlayLayer); 722 736 } 723 737 … … 1462 1476 childLayersOfEnclosingLayer.append(layerBacking->childForSuperlayers()); 1463 1477 } 1464 1465 if (m_documentOverlayRootLayer)1466 childLayersOfEnclosingLayer.append(m_documentOverlayRootLayer);1467 1478 } 1468 1479 … … 3820 3831 } 3821 3832 3822 void RenderLayerCompositor::setDocumentOverlayRootLayer(GraphicsLayer* documentOverlayRootLayer)3823 {3824 if (m_documentOverlayRootLayer)3825 m_documentOverlayRootLayer->removeFromParent();3826 m_documentOverlayRootLayer = documentOverlayRootLayer;3827 setCompositingLayersNeedRebuild(true);3828 scheduleCompositingLayerUpdate();3829 }3830 3831 3833 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r167303 r167316 305 305 Color rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; } 306 306 307 void setDocumentOverlayRootLayer(GraphicsLayer*);308 309 307 private: 310 308 class OverlapMap; … … 367 365 bool isRunningAcceleratedTransformAnimation(RenderLayerModelObject&) const; 368 366 367 void appendOverlayLayers(Vector<GraphicsLayer*>&); 369 368 bool hasAnyAdditionalCompositedLayers(const RenderLayer& rootLayer) const; 370 369 … … 509 508 #endif 510 509 511 GraphicsLayer* m_documentOverlayRootLayer;512 513 510 std::unique_ptr<GraphicsLayerUpdater> m_layerUpdater; // Updates tiled layer visible area periodically while animations are running. 514 511 -
trunk/Source/WebKit2/ChangeLog
r167305 r167316 1 2014-04-15 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Pages often blank on first load if page loaded by typing the URL 4 https://bugs.webkit.org/show_bug.cgi?id=131665 5 6 Reviewed by Tim Horton. 7 8 The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer() 9 was triggering a compositing layer flush when called with a null rootLayer, which happens 10 for pages going into the page cache. This would trigger a layer flush that would clobber 11 the root layer for the visible page, resulting in missing content. 12 13 Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer 14 was being added to (and then removed from) every single compositing layers. 15 16 Fix both these by changing to a pull model, where RenderLayerCompositor requests 17 the overlay layer via ChromeClient, and gets it at the end of every flush, 18 adding to the children of the root layer. 19 20 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 21 (WebKit::WebChromeClient::documentOverlayLayerForFrame): 22 * WebProcess/WebCoreSupport/WebChromeClient.h: 23 * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm: 24 (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer): 25 1 26 2014-04-15 Jinwoo Song <jinwoo7.song@samsung.com> 2 27 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r167303 r167316 772 772 } 773 773 774 GraphicsLayer* WebChromeClient::documentOverlayLayerForFrame(Frame& frame) 775 { 776 if (&frame == &m_page->corePage()->mainFrame()) 777 return m_page->pageOverlayController().documentOverlayRootLayer(); 778 779 return nullptr; 780 } 781 774 782 void WebChromeClient::setNeedsOneShotDrawingSynchronization() 775 783 { -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
r167303 r167316 203 203 virtual void setNeedsOneShotDrawingSynchronization() override; 204 204 virtual void scheduleCompositingLayerFlush() override; 205 virtual WebCore::GraphicsLayer* documentOverlayLayerForFrame(WebCore::Frame&) override; 205 206 206 207 virtual CompositingTriggerFlags allowedCompositingTriggers() const -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
r167303 r167316 95 95 } 96 96 m_rootLayer->setChildren(children); 97 98 m_webPage->mainFrameView()->renderView()->compositor().setDocumentOverlayRootLayer(m_webPage->pageOverlayController().documentOverlayRootLayer());99 97 } 100 98 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
r167303 r167316 450 450 [m_hostingLayer setSublayers:layer ? @[ layer, m_webPage->pageOverlayController().viewOverlayRootLayer()->platformLayer() ] : @[ ]]; 451 451 452 m_webPage->mainFrameView()->renderView()->compositor().setDocumentOverlayRootLayer(m_webPage->pageOverlayController().documentOverlayRootLayer());453 454 452 bool hadRootLayer = !!m_rootLayer; 455 453 m_rootLayer = layer;
Note:
See TracChangeset
for help on using the changeset viewer.