summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp')
-rw-r--r--Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 0ee42f4..0c5359a 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -52,6 +52,7 @@ DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy* webPageProxy)
, m_currentBackingStoreStateID(0)
, m_nextBackingStoreStateID(0)
, m_isWaitingForDidUpdateBackingStoreState(false)
+ , m_isBackingStoreDiscardable(true)
, m_discardBackingStoreTimer(RunLoop::current(), this, &DrawingAreaProxyImpl::discardBackingStore)
{
}
@@ -135,12 +136,31 @@ void DrawingAreaProxyImpl::visibilityDidChange()
// Resume painting.
m_webPageProxy->process()->send(Messages::DrawingArea::ResumePainting(), m_webPageProxy->pageID());
+
+#if USE(ACCELERATED_COMPOSITING)
+ // If we don't have a backing store, go ahead and mark the backing store as being changed so
+ // that when paint we'll actually wait for something to paint and not flash white.
+ if (!m_backingStore && m_layerTreeContext.isEmpty())
+ backingStoreStateDidChange(DoNotRespondImmediately);
+#endif
}
void DrawingAreaProxyImpl::setPageIsVisible(bool)
{
}
+void DrawingAreaProxyImpl::setBackingStoreIsDiscardable(bool isBackingStoreDiscardable)
+{
+ if (m_isBackingStoreDiscardable == isBackingStoreDiscardable)
+ return;
+
+ m_isBackingStoreDiscardable = isBackingStoreDiscardable;
+ if (m_isBackingStoreDiscardable)
+ discardBackingStoreSoon();
+ else
+ m_discardBackingStoreTimer.stop();
+}
+
void DrawingAreaProxyImpl::update(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
{
ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
@@ -277,7 +297,7 @@ void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState()
return;
if (m_webPageProxy->process()->isLaunching())
return;
-
+
#if USE(ACCELERATED_COMPOSITING)
// FIXME: waitForAndDispatchImmediately will always return the oldest DidUpdateBackingStoreState message that
// hasn't yet been processed. But it might be better to skip ahead to some other DidUpdateBackingStoreState
@@ -311,6 +331,9 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode()
void DrawingAreaProxyImpl::discardBackingStoreSoon()
{
+ if (!m_isBackingStoreDiscardable)
+ return;
+
// We'll wait this many seconds after the last paint before throwing away our backing store to save memory.
// FIXME: It would be smarter to make this delay based on how expensive painting is. See <http://webkit.org/b/55733>.
static const double discardBackingStoreDelay = 5;