Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Issue 12662021: cc: Don't draw and swap if the frame will not change. (Closed)

Created:
7 years, 9 months ago by danakj
Modified:
7 years, 1 month ago
CC:
chromium-reviews, cc-bugs_chromium.org, backer
Visibility:
Public.

Description

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 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+644 lines, -212 lines) Patch
M cc/cc_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 23 chunks +23 lines, -23 lines 0 comments Download
M cc/output/delegating_renderer_unittest.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M cc/test/fake_layer_tree_host_impl.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M cc/test/layer_tree_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +9 lines, -8 lines 0 comments Download
M cc/trees/damage_tracker.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +1 line, -2 lines 0 comments Download
M cc/trees/damage_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -5 lines 0 comments Download
M cc/trees/damage_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +17 lines, -12 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +6 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +42 lines, -9 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 83 chunks +163 lines, -101 lines 0 comments Download
M cc/trees/layer_tree_host_perftest.cc View 1 2 3 4 5 4 chunks +13 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +30 lines, -24 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_context.cc View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -6 lines 0 comments Download
A cc/trees/layer_tree_host_unittest_damage.cc View 1 2 3 4 5 6 7 8 9 1 chunk +275 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_delegated.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -1 line 0 comments Download
M cc/trees/single_thread_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -2 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +28 lines, -11 lines 0 comments Download
M cc/trees/thread_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 53 (0 generated)
danakj
7 years, 9 months ago (2013-03-22 02:33:24 UTC) #1
danakj
Bots show up red regardless of their state at the moment :|
7 years, 9 months ago (2013-03-22 02:33:45 UTC) #2
piman
What about CompositeAndReadback? Assuming the previous swap was non-preserving.
7 years, 9 months ago (2013-03-22 02:39:17 UTC) #3
danakj
On 2013/03/22 02:39:17, piman wrote: > What about CompositeAndReadback? Assuming the previous swap was non-preserving. ...
7 years, 9 months ago (2013-03-22 02:42:12 UTC) #4
piman
On Thu, Mar 21, 2013 at 7:42 PM, <danakj@chromium.org> wrote: > On 2013/03/22 02:39:17, piman ...
7 years, 9 months ago (2013-03-22 02:51:33 UTC) #5
danakj
On Thu, Mar 21, 2013 at 10:51 PM, Antoine Labour <piman@chromium.org> wrote: > On Thu, ...
7 years, 9 months ago (2013-03-22 02:56:19 UTC) #6
danakj
+shawnsingh
7 years, 9 months ago (2013-03-22 19:02:01 UTC) #7
danakj
+shawnsingh for real
7 years, 9 months ago (2013-03-22 19:02:10 UTC) #8
danakj
I've added support for readback with tests. PTAL
7 years, 9 months ago (2013-03-22 19:02:24 UTC) #9
nduca
(as a followup, would be good to add a synthetic example of this to tools/perf/page_sets/tough_animation_cases ...
7 years, 9 months ago (2013-03-23 01:02:53 UTC) #10
danakj
On Fri, Mar 22, 2013 at 9:02 PM, <nduca@chromium.org> wrote: > (as a followup, would ...
7 years, 9 months ago (2013-03-23 01:06:20 UTC) #11
shawnsingh
Looks great for damage tracker changes. It does seem like a possibly cleaner concept to ...
7 years, 9 months ago (2013-03-23 01:08:14 UTC) #12
nduca
> Hm, not sure what that would look like. You'd need animating thing on the ...
7 years, 9 months ago (2013-03-23 01:32:20 UTC) #13
danakj
On 2013/03/23 01:32:20, nduca wrote: > > Hm, not sure what that would look like. ...
7 years, 9 months ago (2013-03-23 03:22:57 UTC) #14
nduca
Something to keep on our radar. This might be fine as is since its a ...
7 years, 9 months ago (2013-03-23 03:51:35 UTC) #15
danakj
Here's some perftest results. Before: [ RUN ] LayerTreeHostPerfTestJsonReader.TenTenSingleThread *RESULT 10_10_layer_tree: frames= 3089.37 runs/s After: ...
7 years, 9 months ago (2013-03-26 01:23:34 UTC) #16
danakj
Also rebased this on GTFO changes. PTAL. +enne
7 years, 9 months ago (2013-03-26 01:24:23 UTC) #17
enne (OOO)
In general, this is great! nduca: Please correct me if I'm wrong, but I thought ...
7 years, 9 months ago (2013-03-26 01:42:07 UTC) #18
danakj
Also fixed some bad rebasing in the unit tests, they pass again now. https://codereview.chromium.org/12662021/diff/26001/cc/test/layer_tree_test.cc File ...
7 years, 9 months ago (2013-03-26 02:00:10 UTC) #19
danakj
https://codereview.chromium.org/12662021/diff/26001/cc/test/layer_tree_test.cc File cc/test/layer_tree_test.cc (right): https://codereview.chromium.org/12662021/diff/26001/cc/test/layer_tree_test.cc#newcode424 cc/test/layer_tree_test.cc:424: return; 2013/03/26 02:00:10, danakj wrote: > On 2013/03/26 01:42:07, ...
7 years, 9 months ago (2013-03-26 02:26:05 UTC) #20
nduca
I think the CanDraw is meant to protect against white outs, but it doesn't protect ...
7 years, 9 months ago (2013-03-26 20:09:47 UTC) #21
danakj
On Tue, Mar 26, 2013 at 4:09 PM, <nduca@chromium.org> wrote: > I think the CanDraw ...
7 years, 9 months ago (2013-03-26 20:25:36 UTC) #22
nduca
Use your discretion I guess. :) Worst case, the universe explodes and we learn something! ...
7 years, 9 months ago (2013-03-26 23:19:49 UTC) #23
danakj
enne: ping. should we go ahead with this? anything you want me to experiment with ...
7 years, 8 months ago (2013-03-29 16:48:28 UTC) #24
enne (OOO)
lgtm I think this is probably ok. I have this faint memory where not swapping ...
7 years, 8 months ago (2013-03-29 16:54:20 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/38002
7 years, 8 months ago (2013-03-29 17:11:03 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 8 months ago (2013-03-29 17:29:35 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/52003
7 years, 8 months ago (2013-03-29 17:36:28 UTC) #28
commit-bot: I haz the power
Failed to trigger a try job on linux_chromeos HTTP Error 400: Bad Request
7 years, 8 months ago (2013-03-29 18:43:48 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/65002
7 years, 8 months ago (2013-03-29 18:43:55 UTC) #30
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 8 months ago (2013-03-29 19:11:32 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/65002
7 years, 8 months ago (2013-03-29 19:45:58 UTC) #32
commit-bot: I haz the power
Failed to trigger a try job on linux_chromeos HTTP Error 400: Bad Request
7 years, 8 months ago (2013-03-29 21:01:59 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/70001
7 years, 8 months ago (2013-03-29 21:02:08 UTC) #34
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=112800
7 years, 8 months ago (2013-03-29 22:47:27 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/70001
7 years, 8 months ago (2013-03-29 23:30:49 UTC) #36
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=98345
7 years, 8 months ago (2013-03-30 00:39:33 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/70001
7 years, 8 months ago (2013-03-30 03:24:55 UTC) #38
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=98391
7 years, 8 months ago (2013-03-30 04:26:30 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/70001
7 years, 8 months ago (2013-03-30 22:29:40 UTC) #40
commit-bot: I haz the power
Failed to apply patch for cc/trees/layer_tree_host_impl.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 8 months ago (2013-03-30 22:29:50 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/101001
7 years, 8 months ago (2013-03-30 23:21:57 UTC) #42
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) content_browsertests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=98423
7 years, 8 months ago (2013-03-31 01:15:11 UTC) #43
danakj
This definitely breaks a test. I'll have to figure out why and what to do ...
7 years, 8 months ago (2013-03-31 03:53:01 UTC) #44
danakj
The unit test that is failing is WebContentsViewAuraTest.QuickOverscrollDirectionChange. It failed because the message loop never ...
7 years, 8 months ago (2013-04-04 03:49:45 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/101001
7 years, 8 months ago (2013-04-06 00:36:59 UTC) #46
commit-bot: I haz the power
Failed to apply patch for cc/trees/single_thread_proxy.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 8 months ago (2013-04-06 00:37:03 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/danakj@chromium.org/12662021/110001
7 years, 8 months ago (2013-04-06 00:38:40 UTC) #48
commit-bot: I haz the power
Change committed as 192706
7 years, 8 months ago (2013-04-06 05:01:24 UTC) #49
Tom Hudson
Universe may not have exploded, but Clank is broken by this CL. I presume a ...
7 years, 8 months ago (2013-04-08 16:15:41 UTC) #50
danakj
On Mon, Apr 8, 2013 at 12:15 PM, <tomhudson@chromium.org> wrote: > Universe may not have ...
7 years, 8 months ago (2013-04-08 16:19:34 UTC) #51
danakj
On Mon, Apr 8, 2013 at 12:19 PM, Dana Jansens <danakj@chromium.org> wrote: > On Mon, ...
7 years, 8 months ago (2013-04-08 16:20:01 UTC) #52
no sievers
7 years, 8 months ago (2013-04-08 19:10:53 UTC) #53
Message was sent while issue was closed.
On 2013/04/08 16:20:01, danakj wrote:
> On Mon, Apr 8, 2013 at 12:19 PM, Dana Jansens <mailto:danakj@chromium.org>
wrote:
> 
> > On Mon, Apr 8, 2013 at 12:15 PM, <mailto:tomhudson@chromium.org> wrote:
> >
> >> Universe may not have exploded, but Clank is broken by this CL. I presume
> >> a side
> >> effect of our private reliance on the compositor.
> >>
> >
> > Broken how?
> >
> 
> Actually, can you file a bug about it rather than discussing here?
> 
> Thanks!
> - Dana
> 
> 
> >
> >
> >>
> >>
>
https://chromiumcodereview.**appspot.com/12662021/%3Chttps://chromiumcoderevi...>
> >>
> >
> >

crbug.com/228978 filed. The problem is with the app expecting swap callbacks,
which are now sometimes skipped.

Powered by Google App Engine
This is Rietveld 408576698