Skip to content

Commit

Permalink
[BlackBerry] Checkerboard flashes on Go Back
Browse files Browse the repository at this point in the history
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: http://svn.webkit.org/repository/webkit/trunk@125611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Aug 14, 2012
1 parent 4fdcbac commit 68634f6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/WebKit/blackberry/Api/WebPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 17 additions & 0 deletions Source/WebKit/blackberry/ChangeLog
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 68634f6

Please sign in to comment.