Descriptioncc: 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
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=192706
Patch Set 1 #Patch Set 2 : #Patch Set 3 : nit #Patch Set 4 : morenits #Patch Set 5 : rebased #Patch Set 6 : Add perf test #
Total comments: 11
Patch Set 7 : #Patch Set 8 : rebasewoo #Patch Set 9 : semicolons #Patch Set 10 : #Patch Set 11 : RebaseOnConsolodate #Patch Set 12 : Rebase #Patch Set 13 : Rebase #
Messages
Total messages: 53 (0 generated)
|