[iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 20:56:37 +0000 (20:56 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 May 2014 20:56:37 +0000 (20:56 +0000)
commita6a4f19b61a40af3b0dae22536bdd38563649eed
tree430e5f8cc61a4e38e795f38d5946f3b045021968
parent1b97cfd2c8478634b5d55e55aa5af46430f1efd1
[iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
https://bugs.webkit.org/show_bug.cgi?id=132667
<rdar://problem/15349483>

Reviewed by Darin Adler.

* Shared/mac/RemoteLayerBackingStore.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
(WebKit::RemoteLayerBackingStore::flush): Deleted.
Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
and drops our reference to it. This needs to be called on all backing store between paints.

* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
(WebKit::flushBackingStoreChangesInTransaction): Deleted.
Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
We will only ever have a single commit in flight at a time, and there's a new
RELEASE_ASSERT to ensure that is the case.
We package up the commit on the main thread; the queue calls CGContextFlush
on all of the newly painted contexts and then tosses the commit over to the UI process.
This is a win in many cases because the Web process main thread can go ahead
and do other non-painting tasks while the queue is blocked on painting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.h
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm