[BlackBerry] Checkerboard flashes on Go Back
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 22:02:19 +0000 (22:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 22:02:19 +0000 (22:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=94018

Patch by Leo Yang <leoyang@rim.com> on 2012-08-14
Reviewed by Yong Li.
Reviewed internally by Yong Li.

The backing store need to be suspended before the
WebPagePrivate::restoreHistoryViewState() is called to avoid UI thread
drawing checkerboard.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::restoreHistoryViewState):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::restoreViewState):

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

Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp

index bf6dd3e..63cc224 100644 (file)
@@ -6424,10 +6424,11 @@ void WebPagePrivate::setTextZoomFactor(float textZoomFactor)
 
 void WebPagePrivate::restoreHistoryViewState(Platform::IntSize contentsSize, Platform::IntPoint scrollPosition, double scale, bool shouldReflowBlock)
 {
-    if (!m_mainFrame)
+    if (!m_mainFrame) {
+        m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
         return;
+    }
 
-    m_backingStore->d->suspendScreenAndBackingStoreUpdates(); // don't flash checkerboard for the setScrollPosition call
     m_mainFrame->view()->setContentsSizeFromHistory(contentsSize);
 
     // Here we need to set scroll position what we asked for.
index 37ff15b..9e83cf6 100644 (file)
@@ -1,3 +1,20 @@
+2012-08-14  Leo Yang  <leoyang@rim.com>
+
+        [BlackBerry] Checkerboard flashes on Go Back
+        https://bugs.webkit.org/show_bug.cgi?id=94018
+
+        Reviewed by Yong Li.
+        Reviewed internally by Yong Li.
+
+        The backing store need to be suspended before the
+        WebPagePrivate::restoreHistoryViewState() is called to avoid UI thread
+        drawing checkerboard.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::restoreHistoryViewState):
+        * WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
+        (WebCore::FrameLoaderClientBlackBerry::restoreViewState):
+
 2012-08-14  Mike Fenton  <mifenton@rim.com>
 
         [BlackBerry] Remove unnecessary \n's from InputHandler log messages.
index 29b065c..a0312b0 100644 (file)
@@ -1088,6 +1088,10 @@ void FrameLoaderClientBlackBerry::restoreViewState()
     if (orientationChanged && viewState.isZoomToFitScale)
         scale = BlackBerry::Platform::Graphics::Screen::primaryScreen()->width() * scale / static_cast<double>(BlackBerry::Platform::Graphics::Screen::primaryScreen()->height());
 
+    // Don't flash checkerboard before WebPagePrivate::restoreHistoryViewState() finished.
+    // This call will be balanced by BackingStorePrivate::resumeScreenAndBackingStoreUpdates() in WebPagePrivate::restoreHistoryViewState().
+    m_webPagePrivate->m_backingStore->d->suspendScreenAndBackingStoreUpdates();
+
     // It is not safe to render the page at this point. So we post a message instead. Messages have higher priority than timers.
     BlackBerry::Platform::webKitThreadMessageClient()->dispatchMessage(BlackBerry::Platform::createMethodCallMessage(
         &WebPagePrivate::restoreHistoryViewState, m_webPagePrivate, contentsSize, scrollPosition, scale, viewState.shouldReflowBlock));