diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 20:54:53 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-13 20:54:53 +0000 |
commit | f4e25f9a40366ba27f302fe51f30f1b7671287c6 (patch) | |
tree | 9343a1c937f58c42407f46e85f79ede067f8d966 /cc/test/fake_content_layer.cc | |
parent | 883255b1652d6aeb32d8b1c741ac2b477c03b6fb (diff) | |
download | chromium_src-f4e25f9a40366ba27f302fe51f30f1b7671287c6.zip chromium_src-f4e25f9a40366ba27f302fe51f30f1b7671287c6.tar.gz chromium_src-f4e25f9a40366ba27f302fe51f30f1b7671287c6.tar.bz2 |
cc: Early out in PushPropertiesTo tree walk for commit.
If a subtree is not dirty, don't walk it doing PushPropertiesTo for all
its layers.
We know a layer needs PushPropertiesTo called on it when it requests
SetNeedsCommit() for itself, as this implies it has some value to push
across to the impl tree. If this has been called, it has nothing to push.
There are exceptions to this rule for some layers:
1) tiled layer
- Occlusion can be affected by changes anywhere in the tree, and this
changes what the layer chooses to push.
2) scrollbar layer crbug.com/259095
- Resources for the impl thread are chosen by the main thread, and this
must be done every commit in order to deal with situations like lost
context.
3) picture layer crbug.com/259402
- SyncFromActiveTree needs to be done every commit. This could potentially
be resolved.
4) delegated renderer layer crbug.com/259090
- Resources returned from the parent compositor must be returned to the
main thread currently, and this is done during push properties.
5) any layer with an animation crbug.com/259088
- Animations that complete on the impl thread are cleaned up on the main
thread by the next push properties on the animating layer. This could
be avoided by doing this cleanup in another place during commit.
Tested by:
LayerTreeHostTestLayersPushProperties
LayerTreeHostTestPushPropertiesAddingToTreeRequiresPush
LayerTreeHostTestPushPropertiesRemovingChildStopsRecursion
LayerTreeHostTestPushPropertiesRemovingChildStopsRecursionWithPersistence
LayerTreeHostTestPushPropertiesSetPropertiesWhileOutsideTree
LayerTreeHostTestPushPropertiesSetPropertyInParentThenChild
LayerTreeHostTestPropertyChangesDuringUpdateArePushed
This adds a new perftest:
LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread
The test is basically the original TenTenSingleThread test, but it
toggles a property on a leaf node in the layer tree (the first node
in a pre-order walk) every commit to cause some push properties
to still happen.
Perf test results are as follows.
BEFORE:
LayerTreeHostPerfTestJsonReader.TenTenSingleThread
*RESULT 10_10_layer_tree: frames: 5725, 0.35 ms/frame
LayerTreeHostPerfTestJsonReader.TenTenSingleThread_FullDamageEachFrame
*RESULT 10_10_layer_tree: frames: 4505, 0.44 ms/frame
crollingLayerTreePerfTest.LongScrollablePage
*RESULT long_scrollable_page: frames: 22045, 0.09 ms/frame
ImplSidePaintingPerfTest.HeavyPage
*RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame
*RESULT heavy_layer_tree: commits: 406, 0.58 ms/commit
PageScaleImplSidePaintingPerfTest.HeavyPage
*RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame
*RESULT heavy_layer_tree: commits: 406, 0.74 ms/commit
LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread
*RESULT 10_10_layer_tree: frames: 4095, 0.49 ms/frame
AFTER:
LayerTreeHostPerfTestJsonReader.TenTenSingleThread
*RESULT 10_10_layer_tree: frames: 6635, 0.30 ms/frame
LayerTreeHostPerfTestJsonReader.TenTenSingleThread_FullDamageEachFrame
*RESULT 10_10_layer_tree: frames: 5035, 0.40 ms/frame
ScrollingLayerTreePerfTest.LongScrollablePage
*RESULT long_scrollable_page: frames: 22225, 0.09 ms/frame
ImplSidePaintingPerfTest.HeavyPage
*RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame
*RESULT heavy_layer_tree: commits: 406, 0.57 ms/commit
PageScaleImplSidePaintingPerfTest.HeavyPage
*RESULT heavy_layer_tree: frames: 405, 5.00 ms/frame
*RESULT heavy_layer_tree: commits: 406, 0.75 ms/commit
LayerTreeHostPerfTestLeafInvalidates.TenTenSingleThread
*RESULT 10_10_layer_tree: frames: 4505, 0.44 ms/frame
This is a perf change only, there should be no change in behaviour.
BUG=177756
Review URL: https://chromiumcodereview.appspot.com/12340033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211576 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_content_layer.cc')
-rw-r--r-- | cc/test/fake_content_layer.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cc/test/fake_content_layer.cc b/cc/test/fake_content_layer.cc index 5d452ea..5dcc512 100644 --- a/cc/test/fake_content_layer.cc +++ b/cc/test/fake_content_layer.cc @@ -11,7 +11,8 @@ namespace cc { FakeContentLayer::FakeContentLayer(ContentLayerClient* client) : ContentLayer(client), - update_count_(0) { + update_count_(0), + push_properties_count_(0) { SetAnchorPoint(gfx::PointF(0.f, 0.f)); SetBounds(gfx::Size(1, 1)); SetIsDrawable(true); @@ -31,6 +32,11 @@ bool FakeContentLayer::Update(ResourceUpdateQueue* queue, return updated; } +void FakeContentLayer::PushPropertiesTo(LayerImpl* layer) { + ContentLayer::PushPropertiesTo(layer); + push_properties_count_++; +} + bool FakeContentLayer::HaveBackingAt(int i, int j) { const PrioritizedResource* resource = ResourceAtForTesting(i, j); return resource && resource->have_backing_texture(); |