[BlackBerry] Fix all flicker caused by empty/incomplete geometries.
authorjpetsovits@rim.com <jpetsovits@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 16:58:17 +0000 (16:58 +0000)
committerjpetsovits@rim.com <jpetsovits@rim.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 16:58:17 +0000 (16:58 +0000)
commit6371c8579bb04275e5ec14c076adf4cf2c9f27ec
treea7c0a2dbabc931445220bc2b7b2ecb446255beee
parent49d74628a2d4f365c7c1f0d47c5053d288d51efb
[BlackBerry] Fix all flicker caused by empty/incomplete geometries.
https://bugs.webkit.org/show_bug.cgi?id=108951
RIM PR 286925

Reviewed by Rob Buis.
Internally reviewed by Arvid Nilsson.

The main idea for this patch is that whenever we adopt
a new backingstore geometry that doesn't contain any
rendered tiles, or VisibleZoom render jobs that need more
tiles to be rendered to be considered complete, we'll then
suspend blitting until there is valid content to show.

This main idea is codified as checks for empty buffers
in adoptAsFrontState(), and checks for the current state
of the render queue after rendering content in render().
However, as BackingStore objects with disabled surface pools
or pure use of accelerated compositing also swap geometries
in some circumstances, the use of suspend counters grows
increasingly fragile.

To make this patch more resilient against regressions,
the current suspend counter is complemented with several
explicit conditions for suspending screen updates,
and both subsequently combined into a single cached
boolean value telling the UI thread whether or not to
suspend. In the future, other suspend calls can be
migrated to this "state machine" design as well,
potentially phasing out the suspend counter altogether.

The immediate result is that there will be no flashing
of background color between page loads or after discarding
tiles on scale changes until the content has been rendered.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::BackingStorePrivate):
(BlackBerry::WebKit::BackingStorePrivate::suspendBackingStoreUpdates):
(BlackBerry::WebKit::BackingStorePrivate::suspendScreenUpdates):
(BlackBerry::WebKit::BackingStorePrivate::resumeBackingStoreUpdates):
(BlackBerry::WebKit::BackingStorePrivate::resumeScreenUpdates):
(BlackBerry::WebKit::BackingStorePrivate::updateSuspendScreenUpdateState):
(WebKit):
(BlackBerry::WebKit::BackingStorePrivate::render):
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::adoptAsFrontState):
(BlackBerry::WebKit::BackingStorePrivate::setCurrentBackingStoreOwner):
(BlackBerry::WebKit::BackingStore::releaseOwnedBackingStoreMemory):
* Api/BackingStore_p.h:
(BackingStorePrivate):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setVisible):
(BlackBerry::WebKit::WebPagePrivate::setCompositorDrawsRootLayer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142137 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/blackberry/Api/BackingStore.cpp
Source/WebKit/blackberry/Api/BackingStore_p.h
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog