summaryrefslogtreecommitdiffstats
path: root/cc/output
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-06 05:01:20 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-06 05:01:20 +0000
commite0341359793fd1b9cef790e6927d6fa2cb33c0ff (patch)
tree75dd6a56c44aeea4a6bab43a21aad7ce30584b80 /cc/output
parent34e25581f9c2513ef1b294cadfa6c4ea250c288c (diff)
downloadchromium_src-e0341359793fd1b9cef790e6927d6fa2cb33c0ff.zip
chromium_src-e0341359793fd1b9cef790e6927d6fa2cb33c0ff.tar.gz
chromium_src-e0341359793fd1b9cef790e6927d6fa2cb33c0ff.tar.bz2
cc: Don't draw and swap if the frame will not change.
When there is no visible damage in the root surface, we have no reason to do CalculateRenderPasses, DrawLayers, or SwapBuffers. This adds an early out in each of these when there is no damage, but storing a flag on the FrameData to communicate this state. When doing a readback, we need to make sure we draw the area being read back, so we pass a damage rect in to PrepareToDraw to enforce this. This mechanism can be used to also implement the "ForceFullFrameDamage" mechanism, so we move the flag to LayerTreeHostImpl and have DamageTracker take a general rect instead. Before: [ RUN ] LayerTreeHostPerfTestJsonReader.TenTenSingleThread *RESULT 10_10_layer_tree: frames= 3089.37 runs/s After: [ RUN ] LayerTreeHostPerfTestJsonReader.TenTenSingleThread *RESULT 10_10_layer_tree: frames= 4679.13 runs/s When there's no damage, a full single-threaded commit+composite speeds up about 50%. Tests: DamageTrackerTest.DamageWhenAddedExternally LayerTreeHostDamageTestNoDamageDoesNotSwap.RunSingleThread LayerTreeHostDamageTestNoDamageDoesNotSwap.RunMultiThread LayerTreeHostDamageTestNoDamageReadbackDoesDraw.RunSingleThread LayerTreeHostDamageTestNoDamageReadbackDoesDraw.RunMultiThread LayerTreeHostDamageTestForcedFullDamage.RunSingleThread LayerTreeHostDamageTestForcedFullDamage.RunMultiThread Adding a new perf test with damage: LayerTreeHostPerfTestJsonReader.TenTenSingleThread_FullDamageEachFrame *RESULT 10_10_layer_tree: frames= 3233.98 runs/s R=nduca BUG=222915 Review URL: https://chromiumcodereview.appspot.com/12662021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192706 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/output')
-rw-r--r--cc/output/delegating_renderer_unittest.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/cc/output/delegating_renderer_unittest.cc b/cc/output/delegating_renderer_unittest.cc
index 5357a58..e270860 100644
--- a/cc/output/delegating_renderer_unittest.cc
+++ b/cc/output/delegating_renderer_unittest.cc
@@ -43,8 +43,9 @@ class DelegatingRendererTestDraw : public DelegatingRendererTest {
virtual void AfterTest() OVERRIDE {}
- virtual bool PrepareToDrawOnThread(
- LayerTreeHostImpl*, LayerTreeHostImpl::FrameData* frame, bool result)
+ virtual bool PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
+ LayerTreeHostImpl::FrameData* frame,
+ bool result)
OVERRIDE {
EXPECT_EQ(0u, output_surface_->num_sent_frames());