summaryrefslogtreecommitdiff
path: root/Source/WebKit/blackberry/Api/BackingStore.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-23 09:28:44 +0200
commit815f1ed417bd26fbe2abbdf20ac5d3423b30796c (patch)
tree923c9a9e2834ccab60f5caecfb8f0ac410c1dd9e /Source/WebKit/blackberry/Api/BackingStore.cpp
parentb4ad5d9d2b96baacd0180ead50de5195ca78af2d (diff)
downloadqtwebkit-815f1ed417bd26fbe2abbdf20ac5d3423b30796c.tar.gz
Imported WebKit commit e65cbc5b6ac32627c797e7fc7f46eb7794410c92 (http://svn.webkit.org/repository/webkit/trunk@123308)
New snapshot with better configure tests
Diffstat (limited to 'Source/WebKit/blackberry/Api/BackingStore.cpp')
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore.cpp55
1 files changed, 47 insertions, 8 deletions
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp
index 61fddfa16..78102c179 100644
--- a/Source/WebKit/blackberry/Api/BackingStore.cpp
+++ b/Source/WebKit/blackberry/Api/BackingStore.cpp
@@ -196,8 +196,9 @@ Platform::IntSize BackingStoreGeometry::backingStoreSize() const
}
BackingStorePrivate::BackingStorePrivate()
- : m_suspendScreenUpdates(false)
- , m_suspendBackingStoreUpdates(false)
+ : m_suspendScreenUpdates(0)
+ , m_suspendBackingStoreUpdates(0)
+ , m_resumeOperation(BackingStore::None)
, m_suspendRenderJobs(false)
, m_suspendRegularRenderJobs(false)
, m_isScrollingOrZooming(false)
@@ -279,12 +280,18 @@ bool BackingStorePrivate::isOpenGLCompositing() const
void BackingStorePrivate::suspendScreenAndBackingStoreUpdates()
{
- m_suspendBackingStoreUpdates = true;
+ if (m_suspendScreenUpdates) {
+ BlackBerry::Platform::log(BlackBerry::Platform::LogLevelInfo,
+ "Screen and backingstore already suspended, increasing suspend counter.");
+ }
+
+ ++m_suspendBackingStoreUpdates;
// Make sure the user interface thread gets the message before we proceed
// because blitContents can be called from this thread and it must honor
// this flag.
- m_suspendScreenUpdates = true;
+ ++m_suspendScreenUpdates;
+
BlackBerry::Platform::userInterfaceThreadMessageClient()->syncToCurrentMessage();
#if USE(ACCELERATED_COMPOSITING)
@@ -294,14 +301,42 @@ void BackingStorePrivate::suspendScreenAndBackingStoreUpdates()
void BackingStorePrivate::resumeScreenAndBackingStoreUpdates(BackingStore::ResumeUpdateOperation op)
{
- m_suspendBackingStoreUpdates = false;
+ ASSERT(m_suspendScreenUpdates);
+ ASSERT(m_suspendBackingStoreUpdates);
+
+ // Both variables are similar except for the timing of setting them.
+ ASSERT(m_suspendScreenUpdates == m_suspendBackingStoreUpdates);
+
+ if (!m_suspendScreenUpdates || !m_suspendBackingStoreUpdates) {
+ BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical,
+ "Call mismatch: Screen and backingstore haven't been suspended, therefore won't resume!");
+ return;
+ }
+
+ // Out of all nested resume calls, resume with the maximum-impact operation.
+ if (op == BackingStore::RenderAndBlit
+ || (m_resumeOperation == BackingStore::None && op == BackingStore::Blit))
+ m_resumeOperation = op;
+
+ if (m_suspendScreenUpdates >= 2 && m_suspendBackingStoreUpdates >= 2) { // we're still suspended
+ BlackBerry::Platform::log(BlackBerry::Platform::LogLevelInfo,
+ "Screen and backingstore still suspended, decreasing suspend counter.");
+ --m_suspendBackingStoreUpdates;
+ --m_suspendScreenUpdates;
+ return;
+ }
+
+ --m_suspendBackingStoreUpdates;
+
+ op = m_resumeOperation;
+ m_resumeOperation = BackingStore::None;
#if USE(ACCELERATED_COMPOSITING)
if (op != BackingStore::None) {
if (isOpenGLCompositing() && !isActive()) {
m_webPage->d->setCompositorDrawsRootLayer(true);
m_webPage->d->setNeedsOneShotDrawingSynchronization();
- m_suspendScreenUpdates = false;
+ --m_suspendScreenUpdates;
BlackBerry::Platform::userInterfaceThreadMessageClient()->syncToCurrentMessage();
return;
}
@@ -322,7 +357,7 @@ void BackingStorePrivate::resumeScreenAndBackingStoreUpdates(BackingStore::Resum
// Make sure the user interface thread gets the message before we proceed
// because blitContents can be called from the user interface thread and
// it must honor this flag.
- m_suspendScreenUpdates = false;
+ --m_suspendScreenUpdates;
BlackBerry::Platform::userInterfaceThreadMessageClient()->syncToCurrentMessage();
// Do some blitting if necessary.
@@ -1567,7 +1602,7 @@ void BackingStorePrivate::blitContents(const Platform::IntRect& dstRect,
for (unsigned int i = 0; i < blittedTiles.size(); ++i)
blittedTiles[i]->setBlitGeneration(m_blitGeneration);
- clock_gettime(CLOCK_REALTIME, &m_currentBlitEnd);
+ clock_gettime(CLOCK_MONOTONIC, &m_currentBlitEnd);
m_currentBlitEnd.tv_nsec += 30 * 1000 * 1000;
if (m_currentBlitEnd.tv_nsec >= 1000000000L) {
m_currentBlitEnd.tv_sec += 1;
@@ -2179,6 +2214,10 @@ void BackingStorePrivate::createSurfaces()
swapState();
createVisibleTileBufferForWebPage(m_webPage->d);
+
+ // Don't try to blit to screen unless we have a buffer.
+ if (!buffer())
+ suspendScreenAndBackingStoreUpdates();
}
void BackingStorePrivate::createVisibleTileBuffer()