<rdar://problem/9523192> REGRESSION (5.0.5-ToT, WebKit2): Flash to white when navigat...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2011 22:11:28 +0000 (22:11 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 May 2011 22:11:28 +0000 (22:11 +0000)
commit0a66851bd48f0f940336fa858b8beb8fa3e18c54
treea81bb1c1fa962099db93fec332008135a0e8f92d
parent09f5b4e59cd5b25272b46f3a649e337934237a5d
<rdar://problem/9523192> REGRESSION (5.0.5-ToT, WebKit2): Flash to white when navigating between pages on wsj.com, other sites (when navigating away from composited page)
https://bugs.webkit.org/show_bug.cgi?id=61808

Reviewed by Simon Fraser.

WebKit1 has a mechanism to prevent the stale bits from the outgoing page from being erased
until the incoming page has layout. Adapt this in WebKit2 to prevent the composited layer tree
of the outgoing page from being torn down or updated until the incoming page has layout.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFirstLayout): Unfreeze the layer tree state.
(WebKit::WebFrameLoaderClient::frameLoadCompleted): Ditto.
(WebKit::WebFrameLoaderClient::provisionalLoadStarted): Freeze the layer tree state.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setLayerTreeStateIsFrozen): Added.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl): Initialize new member variables.
(WebKit::DrawingAreaImpl::setLayerTreeStateIsFrozen): Added. When freezing, sets the flag and
disables layer flush scheduling and exiting accelerated compositing mode. When unfreezing,
clears the flag and exits compositing mode if needed.
(WebKit::DrawingAreaImpl::setRootCompositingLayer): Reset m_wantsToExitAcceleratedCompositingMode.
(WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Ditto.
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Ditto.
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingModeSoon): If the layer tree state is frozen,
bail out but set m_wantsToExitAcceleratedCompositingMode.

* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/LayerTreeHost.h:

* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::LayerTreeHostCA): Initialize m_layerFlushSchedulingEnabled.

* WebProcess/WebPage/ca/LayerTreeHostCA.h:
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:

* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
(WebKit::LayerTreeHostCAMac::scheduleLayerFlush): Bail out if scheduling is not enabled.
(WebKit::LayerTreeHostCAMac::setLayerFlushSchedulingEnabled): Added. Sets the flag. If disabling
flushing, cancels the pending flush.
(WebKit::LayerTreeHostCAMac::flushPendingLayerChangesRunLoopObserverCallback): Added an assertion.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp:
(WebKit::LayerTreeHostCAWin::scheduleLayerFlush): Bail out if scheduling is not enabled.
(WebKit::LayerTreeHostCAWin::setLayerFlushSchedulingEnabled): Added. Sets the flag. If disabling
flushing, cancels the pending flush.

* WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
Source/WebKit2/WebProcess/WebPage/LayerTreeHost.h
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.h
Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h
Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm
Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.cpp
Source/WebKit2/WebProcess/WebPage/ca/win/LayerTreeHostCAWin.h