[BlackBerry] CSS animations stop running during zoom
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 21:59:18 +0000 (21:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 21:59:18 +0000 (21:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109606

Patch by Andrew Lo <anlo@rim.com> on 2013-02-12
Reviewed by Rob Buis.
Internally reviewed by Jakob Petsovits.

Internal PR 286160.
New BackingStore API for suspending/resuming geometry updates.

This is needed because we want to allow render jobs to continue during
zoom, but we don't want to allow geometry updates during zoom.

Prevent scroll/zoom render jobs from being added to the queue if
the tile is outside the expanded content rect.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
(BlackBerry::WebKit::BackingStorePrivate::suspendGeometryUpdates):
(WebKit):
(BlackBerry::WebKit::BackingStorePrivate::resumeGeometryUpdates):
(BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
(BlackBerry::WebKit::BackingStore::suspendGeometryUpdates):
(BlackBerry::WebKit::BackingStore::resumeGeometryUpdates):
* Api/BackingStore.h:
* Api/BackingStore_p.h:
(BackingStorePrivate):
* WebKitSupport/RenderQueue.cpp:
(BlackBerry::WebKit::RenderQueue::addToScrollZoomQueue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142670 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/blackberry/Api/BackingStore.cpp
Source/WebKit/blackberry/Api/BackingStore.h
Source/WebKit/blackberry/Api/BackingStore_p.h
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/RenderQueue.cpp

index 32ca11dc7b7635c47c68feaabc41603f268f7778..62b1d23b2843ef906c812f04138adc13f87624f8 100644 (file)
@@ -205,6 +205,7 @@ bool BackingStoreGeometry::isTileCorrespondingToBuffer(TileIndex index, TileBuff
 BackingStorePrivate::BackingStorePrivate()
     : m_suspendScreenUpdateCounterWebKitThread(0)
     , m_suspendBackingStoreUpdates(0)
+    , m_suspendGeometryUpdates(0)
     , m_resumeOperation(BackingStore::None)
     , m_suspendScreenUpdatesWebKitThread(true)
     , m_suspendScreenUpdatesUserInterfaceThread(true)
@@ -301,6 +302,18 @@ void BackingStorePrivate::suspendBackingStoreUpdates()
     atomic_add(&m_suspendBackingStoreUpdates, 1);
 }
 
+void BackingStorePrivate::suspendGeometryUpdates()
+{
+    ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
+
+    if (m_suspendGeometryUpdates) {
+        BBLOG(Platform::LogLevelInfo,
+            "Backingstore geometry already suspended, increasing suspend counter.");
+    }
+
+    ++m_suspendGeometryUpdates;
+}
+
 void BackingStorePrivate::suspendScreenUpdates()
 {
     ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
@@ -340,6 +353,29 @@ void BackingStorePrivate::resumeBackingStoreUpdates()
     dispatchRenderJob();
 }
 
+
+void BackingStorePrivate::resumeGeometryUpdates()
+{
+    ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
+
+    ASSERT(m_suspendGeometryUpdates >= 1);
+    if (m_suspendGeometryUpdates < 1) {
+        Platform::logAlways(Platform::LogLevelCritical,
+            "Call mismatch: Backingstore geometry hasn't been suspended, therefore won't resume!");
+        return;
+    }
+
+    // Set a flag indicating that we're about to resume geometry updates and
+    // the tile matrix should be updated as a consequence by the first render
+    // job that happens after this resumption of geometry updates.
+    if (m_suspendGeometryUpdates == 1)
+        setTileMatrixNeedsUpdate();
+
+    --m_suspendGeometryUpdates;
+
+    dispatchRenderJob();
+}
+
 void BackingStorePrivate::resumeScreenUpdates(BackingStore::ResumeUpdateOperation op)
 {
     ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
@@ -767,7 +803,7 @@ void BackingStorePrivate::setBackingStoreRect(const Platform::IntRect& backingSt
         return;
     }
 
-    if (m_suspendBackingStoreUpdates)
+    if (m_suspendBackingStoreUpdates || m_suspendGeometryUpdates)
         return;
 
     Platform::IntRect oldBackingStoreRect = frontState()->backingStoreRect();
@@ -2422,6 +2458,16 @@ void BackingStore::resumeBackingStoreUpdates()
     d->resumeBackingStoreUpdates();
 }
 
+void BackingStore::suspendGeometryUpdates()
+{
+    d->suspendGeometryUpdates();
+}
+
+void BackingStore::resumeGeometryUpdates()
+{
+    d->resumeGeometryUpdates();
+}
+
 void BackingStore::suspendScreenUpdates()
 {
     d->suspendScreenUpdates();
index 1c523de9a9034544f215464a7f7e6bd872da6d86..112d2b1307de077efe8f253bd1d6cd1e79c89447 100644 (file)
@@ -61,6 +61,9 @@ public:
     void suspendBackingStoreUpdates();
     void resumeBackingStoreUpdates();
 
+    void suspendGeometryUpdates();
+    void resumeGeometryUpdates();
+
     void suspendScreenUpdates();
     void resumeScreenUpdates(BackingStore::ResumeUpdateOperation);
 
index 2f40f4071a34f2c6b589ab9fbbe8616d6622d4ee..f31fa00229d9fada218af05e59c1448294b77b47 100644 (file)
@@ -135,6 +135,12 @@ public:
     // Resumes all backingstore updates so that rendering to the backingstore is enabled.
     void resumeBackingStoreUpdates();
 
+    // Suspends all backingstore geometry updates.
+    void suspendGeometryUpdates();
+
+    // Resumes all backingstore geometry updates.
+    void resumeGeometryUpdates();
+
     // Suspends all screen updates so that 'blitVisibleContents' is disabled.
     void suspendScreenUpdates();
 
@@ -345,6 +351,7 @@ public:
 
     unsigned m_suspendScreenUpdateCounterWebKitThread;
     unsigned m_suspendBackingStoreUpdates;
+    unsigned m_suspendGeometryUpdates;
     BackingStore::ResumeUpdateOperation m_resumeOperation;
 
     bool m_suspendScreenUpdatesWebKitThread;
index 1db9c039598858f51aa509e73ef73219582aff6b..bdc6b2eb5d960639747978199dd3234893ee63f0 100644 (file)
@@ -1,3 +1,34 @@
+2013-02-12  Andrew Lo  <anlo@rim.com>
+
+        [BlackBerry] CSS animations stop running during zoom
+        https://bugs.webkit.org/show_bug.cgi?id=109606
+
+        Reviewed by Rob Buis.
+        Internally reviewed by Jakob Petsovits.
+
+        Internal PR 286160.
+        New BackingStore API for suspending/resuming geometry updates.
+
+        This is needed because we want to allow render jobs to continue during
+        zoom, but we don't want to allow geometry updates during zoom.
+
+        Prevent scroll/zoom render jobs from being added to the queue if
+        the tile is outside the expanded content rect.
+
+        * Api/BackingStore.cpp:
+        (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
+        (BlackBerry::WebKit::BackingStorePrivate::suspendGeometryUpdates):
+        (WebKit):
+        (BlackBerry::WebKit::BackingStorePrivate::resumeGeometryUpdates):
+        (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
+        (BlackBerry::WebKit::BackingStore::suspendGeometryUpdates):
+        (BlackBerry::WebKit::BackingStore::resumeGeometryUpdates):
+        * Api/BackingStore.h:
+        * Api/BackingStore_p.h:
+        (BackingStorePrivate):
+        * WebKitSupport/RenderQueue.cpp:
+        (BlackBerry::WebKit::RenderQueue::addToScrollZoomQueue):
+
 2013-02-12  Christophe Dumez  <ch.dumez@sisa.samsung.com>
 
         Remove remaining traces of Web Intents
index 7045f155679c72aa9bcee29e4b7f125c4c55a449..0879ed1deb8e06ae5d714903dee6f8882abd2b24 100644 (file)
@@ -344,10 +344,22 @@ void RenderQueue::addToRegularQueue(const Platform::IntRectRegion& region)
 
 void RenderQueue::addToScrollZoomQueue(const TileIndexList& addedTiles, TileIndexList* alreadyQueuedTiles)
 {
+    Platform::IntRect contentsRect = m_parent->expandedContentsRect();
     for (size_t i = 0; i < addedTiles.size(); ++i) {
         if (alreadyQueuedTiles->contains(addedTiles[i]))
             continue;
 
+        Platform::IntRect tileRect(m_parent->frontState()->originOfTile(addedTiles[i]), m_parent->tileSize());
+        if (!contentsRect.intersects(tileRect)) {
+#if DEBUG_RENDER_QUEUE
+                Platform::logAlways(Platform::LogLevelCritical,
+                    "RenderQueue::addToScrollZoomQueue tile at %s outside of expanded contents rect %s, ignoring.",
+                    tileRect.toString().c_str(),
+                    contentsRect.toString().c_str());
+#endif
+            continue;
+        }
+
 #if DEBUG_RENDER_QUEUE
         Platform::logAlways(Platform::LogLevelCritical,
             "RenderQueue::addToScrollZoomQueue tile at %s",