[iOS] Throttle painting using a UI-process-side CADisplayLink
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 18:11:46 +0000 (18:11 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Jul 2014 18:11:46 +0000 (18:11 +0000)
commit2c51e523882ee3b94bcadb7241875369f15db5cc
tree014fd251f368ecfb9b74d42be934b265908cde4d
parentb1dc7308e999ddb5a8d49fdc3211bba48499b27b
[iOS] Throttle painting using a UI-process-side CADisplayLink
https://bugs.webkit.org/show_bug.cgi?id=134879
<rdar://problem/17641699>

Reviewed by Simon Fraser.

Just waiting for CA to commit is insufficient to actually throttle to 60fps,
because nothing will block the main runloop from spinning.

Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
the first time it fires after we commit. This is not a guarantee that
our content is on the screen, but we don't have any way to make that guarantee yet.

This will throttle painting, rAF, etc. to the display refresh rate.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
(-[OneShotDisplayLinkHandler dealloc]):
(-[OneShotDisplayLinkHandler displayLinkFired:]):
(-[OneShotDisplayLinkHandler invalidate]):
(-[OneShotDisplayLinkHandler schedule]):
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
(WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@171068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm