Title: [134990] trunk/Source/WebKit/blackberry
Revision
134990
Author
commit-qu...@webkit.org
Date
2012-11-16 13:01:00 -0800 (Fri, 16 Nov 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=102540
[BlackBerry] Checkerboard flicker when pinch zooming out on google.com/nwshp

Patch by Adam Treat <atr...@rim.com> on 2012-11-16
Reviewed by George Staikos.
PR 245827

Disable updates to the backingstore tile matrix when backingstore updates
are disabled.  This prevents changes to the tile matrix when we are in the
middle of a pinch zoom which can cause checkebroard flickering.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
(BlackBerry::WebKit::BackingStorePrivate::resumeBackingStoreUpdates):
(BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
(BlackBerry::WebKit::BackingStorePrivate::render):
(BlackBerry::WebKit::BackingStorePrivate::renderVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::renderBackingStore):
(BlackBerry::WebKit::BackingStorePrivate::updateTileMatrixIfNeeded):
(BlackBerry::WebKit::BackingStorePrivate::contentsSizeChanged):
(BlackBerry::WebKit::BackingStorePrivate::orientationChanged):
* Api/BackingStore_p.h:
(BlackBerry::WebKit::BackingStorePrivate::setTileMatrixNeedsUpdate):
(BackingStorePrivate):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/BackingStore.cpp (134989 => 134990)


--- trunk/Source/WebKit/blackberry/Api/BackingStore.cpp	2012-11-16 20:56:30 UTC (rev 134989)
+++ trunk/Source/WebKit/blackberry/Api/BackingStore.cpp	2012-11-16 21:01:00 UTC (rev 134990)
@@ -200,6 +200,7 @@
     , m_resumeOperation(BackingStore::None)
     , m_suspendRenderJobs(false)
     , m_suspendRegularRenderJobs(false)
+    , m_tileMatrixNeedsUpdate(false)
     , m_isScrollingOrZooming(false)
     , m_webPage(0)
     , m_client(0)
@@ -306,18 +307,23 @@
 
 void BackingStorePrivate::resumeBackingStoreUpdates()
 {
-    bool isSuspended = atomic_add_value(&m_suspendBackingStoreUpdates, 0) >= 1;
-    ASSERT(isSuspended);
-    if (!isSuspended) {
+    unsigned currentValue = atomic_add_value(&m_suspendBackingStoreUpdates, 0);
+    ASSERT(currentValue >= 1);
+    if (currentValue < 1) {
         BlackBerry::Platform::logAlways(BlackBerry::Platform::LogLevelCritical,
             "Call mismatch: Backingstore hasn't been suspended, therefore won't resume!");
         return;
     }
 
+    // Set a flag indicating that we're about to resume backingstore updates and
+    // the tile matrix should be updated as a consequence by the first render
+    // job that happens after this resumption of backingstore updates.
+    if (currentValue == 1)
+        setTileMatrixNeedsUpdate();
+
     atomic_sub(&m_suspendBackingStoreUpdates, 1);
 }
 
-
 void BackingStorePrivate::resumeScreenUpdates(BackingStore::ResumeUpdateOperation op)
 {
     ASSERT(m_suspendScreenUpdates);
@@ -717,6 +723,9 @@
         return;
     }
 
+    if (m_suspendBackingStoreUpdates)
+        return;
+
     Platform::IntRect currentBackingStoreRect = frontState()->backingStoreRect();
     double currentScale = frontState()->scale();
 
@@ -1055,6 +1064,11 @@
     if (!isActive())
         return false;
 
+    // This is the first render job that has been performed since resumption of
+    // backingstore updates and the tile matrix needs updating since we suspend
+    // tile matrix updating with backingstore updates
+    updateTileMatrixIfNeeded();
+
     TileRectList tileRectList = mapFromTransformedContentsToTiles(rect);
     if (tileRectList.isEmpty())
         return false;
@@ -1160,6 +1174,7 @@
 
 bool BackingStorePrivate::renderVisibleContents()
 {
+    updateTileMatrixIfNeeded();
     Platform::IntRect renderRect = shouldDirectRenderingToWindow() ? visibleContentsRect() : visibleTilesRect();
     if (render(renderRect)) {
         m_renderQueue->clear(renderRect, true /*clearRegularRenderJobs*/);
@@ -1170,6 +1185,7 @@
 
 bool BackingStorePrivate::renderBackingStore()
 {
+    updateTileMatrixIfNeeded();
     return render(frontState()->backingStoreRect());
 }
 
@@ -1965,12 +1981,18 @@
 {
     ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
 
+    if (!m_tileMatrixNeedsUpdate)
+        return;
+
+    m_tileMatrixNeedsUpdate = false;
+
     // This will update the tile matrix.
     scrollBackingStore(0, 0);
 }
 
 void BackingStorePrivate::contentsSizeChanged(const Platform::IntSize&)
 {
+    setTileMatrixNeedsUpdate();
     updateTileMatrixIfNeeded();
 }
 
@@ -2039,6 +2061,7 @@
 void BackingStorePrivate::orientationChanged()
 {
     ASSERT(BlackBerry::Platform::webKitThreadMessageClient()->isCurrentThread());
+    setTileMatrixNeedsUpdate();
     updateTileMatrixIfNeeded();
     createVisibleTileBuffer();
 }

Modified: trunk/Source/WebKit/blackberry/Api/BackingStore_p.h (134989 => 134990)


--- trunk/Source/WebKit/blackberry/Api/BackingStore_p.h	2012-11-16 20:56:30 UTC (rev 134989)
+++ trunk/Source/WebKit/blackberry/Api/BackingStore_p.h	2012-11-16 21:01:00 UTC (rev 134990)
@@ -282,6 +282,7 @@
     TileRectList mapFromTransformedContentsToTiles(const Platform::IntRect&) const;
     TileRectList mapFromTransformedContentsToTiles(const Platform::IntRect&, BackingStoreGeometry*) const;
 
+    void setTileMatrixNeedsUpdate() { m_tileMatrixNeedsUpdate = true; }
     void updateTileMatrixIfNeeded();
 
     // Called by WebPagePrivate::notifyTransformedContentsSizeChanged.
@@ -364,6 +365,7 @@
 
     bool m_suspendRenderJobs;
     bool m_suspendRegularRenderJobs;
+    bool m_tileMatrixNeedsUpdate;
     bool m_isScrollingOrZooming;
     WebPage* m_webPage;
     BackingStoreClient* m_client;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (134989 => 134990)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-11-16 20:56:30 UTC (rev 134989)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-11-16 21:01:00 UTC (rev 134990)
@@ -1,3 +1,29 @@
+2012-11-16  Adam Treat  <atr...@rim.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=102540
+        [BlackBerry] Checkerboard flicker when pinch zooming out on google.com/nwshp
+
+        Reviewed by George Staikos.
+        PR 245827
+
+        Disable updates to the backingstore tile matrix when backingstore updates
+        are disabled.  This prevents changes to the tile matrix when we are in the
+        middle of a pinch zoom which can cause checkebroard flickering.
+
+        * Api/BackingStore.cpp:
+        (BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
+        (BlackBerry::WebKit::BackingStorePrivate::resumeBackingStoreUpdates):
+        (BlackBerry::WebKit::BackingStorePrivate::setBackingStoreRect):
+        (BlackBerry::WebKit::BackingStorePrivate::render):
+        (BlackBerry::WebKit::BackingStorePrivate::renderVisibleContents):
+        (BlackBerry::WebKit::BackingStorePrivate::renderBackingStore):
+        (BlackBerry::WebKit::BackingStorePrivate::updateTileMatrixIfNeeded):
+        (BlackBerry::WebKit::BackingStorePrivate::contentsSizeChanged):
+        (BlackBerry::WebKit::BackingStorePrivate::orientationChanged):
+        * Api/BackingStore_p.h:
+        (BlackBerry::WebKit::BackingStorePrivate::setTileMatrixNeedsUpdate):
+        (BackingStorePrivate):
+
 2012-11-16  Rob Buis  <rb...@rim.com>
 
         [BlackBerry] FCC doesn't work in textarea
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to