Avoid doing work at 60fps for tiled layers when not necessary
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2013 03:42:59 +0000 (03:42 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Jan 2013 03:42:59 +0000 (03:42 +0000)
commit30b6bf5687fa912ecde2209e9ea12f4f0c326fca
treecbd58429edc6aafbf5c72f2ef8d5cc904097c112
parentb930c978bb509aaff1cdb0d7b3f3938ec3db4476
Avoid doing work at 60fps for tiled layers when not necessary
https://bugs.webkit.org/show_bug.cgi?id=108135

Reviewed by Dean Jackson.

When there were any tiled layers on the page, we would run a CVDisplayLink
to cause GraphicsLayerCA to flush, in order to update tiled layer visible rects.
This is overkill; we should only do this if the tiled layer is affected by
an accelerated animation.

Fix by tracking whether an ancestor has a running animation when committing
GraphicsLayerCAs.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState): Start with an empty CommitState.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Push CommitState for
each layer, which tracks whether an ancestor has a running transform animation.
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): updateLayerAnimations() renamed.
(WebCore::GraphicsLayerCA::updateAnimations): Renamed from updateLayerAnimations().
(WebCore::GraphicsLayerCA::isRunningTransformAnimation): Look in the map of running
animations for one affecting transform. This list is normally small (one item).
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::CommitState::CommitState):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h