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

Issue 1454323002: Display skips swapping if overlays draw the damage (Closed)

Created:
5 years, 1 month ago by watk
Modified:
5 years ago
Reviewers:
ccameron, piman
CC:
chromium-reviews, darin-cc_chromium.org, cc-bugs_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

After scheduling overlay planes it's possible that the damaged region is completely drawn by overlays, and drawing to the surface is skipped. This will commonly occur during fullscreen video playback where the video is in an overlay. In this case, it's much more power efficient to skip SwapBuffers for the native surface. This CL updates Renderer::DrawFrame to return whether it skipped drawing because of overlays, and Display to skip the Swap in that case. BUG=533630 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel

Patch Set 1 : Try skipping the swap at the cc::OutputSurface level #

Total comments: 1

Patch Set 2 : Try skipping the swap at the cc::Display level #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -35 lines) Patch
M cc/output/delegating_renderer.h View 1 1 chunk +5 lines, -5 lines 0 comments Download
M cc/output/delegating_renderer.cc View 1 2 chunks +7 lines, -5 lines 0 comments Download
M cc/output/direct_renderer.h View 1 1 chunk +5 lines, -5 lines 0 comments Download
M cc/output/direct_renderer.cc View 1 4 chunks +16 lines, -10 lines 0 comments Download
M cc/output/output_surface.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M cc/output/renderer.h View 1 2 chunks +12 lines, -5 lines 0 comments Download
M cc/surfaces/display.cc View 1 2 chunks +11 lines, -4 lines 0 comments Download
M content/browser/renderer_host/compositor_impl_android.cc View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (5 generated)
watk
Hey ccameron, I tried two different methods to achieve this. I'm pretty sure patch set ...
5 years, 1 month ago (2015-11-19 06:15:42 UTC) #5
ccameron
I like PS1 a bit better, but I think the best approach would be to ...
5 years, 1 month ago (2015-11-19 09:28:03 UTC) #7
piman
I don't understand either approach. ScheduleOverlayPlane doesn't do anything until Swap/PostSubBuffer - otherwise you can't ...
5 years, 1 month ago (2015-11-19 21:14:14 UTC) #8
piman
https://codereview.chromium.org/1454323002/diff/1/cc/output/gl_renderer.cc File cc/output/gl_renderer.cc (right): https://codereview.chromium.org/1454323002/diff/1/cc/output/gl_renderer.cc#newcode2612 cc/output/gl_renderer.cc:2612: // choose whether to do a full swap or ...
5 years, 1 month ago (2015-11-19 21:22:04 UTC) #9
piman
5 years, 1 month ago (2015-11-19 21:22:07 UTC) #10
watk
On 2015/11/19 21:14:14, piman (slow to review) wrote: > I don't understand either approach. ScheduleOverlayPlane ...
5 years, 1 month ago (2015-11-19 21:22:08 UTC) #11
piman
On 2015/11/19 21:22:08, watk wrote: > On 2015/11/19 21:14:14, piman (slow to review) wrote: > ...
5 years, 1 month ago (2015-11-19 21:25:54 UTC) #12
piman
On 2015/11/19 21:25:54, piman (slow to review) wrote: > On 2015/11/19 21:22:08, watk wrote: > ...
5 years, 1 month ago (2015-11-19 21:27:02 UTC) #13
watk
5 years, 1 month ago (2015-11-19 21:28:42 UTC) #14
On 2015/11/19 21:27:02, piman (slow to review) wrote:
> On 2015/11/19 21:25:54, piman (slow to review) wrote:
> > On 2015/11/19 21:22:08, watk wrote:
> > > On 2015/11/19 21:14:14, piman (slow to review) wrote:
> > > > I don't understand either approach. ScheduleOverlayPlane doesn't do
> anything
> > > > until Swap/PostSubBuffer - otherwise you can't have atomic changes!
While
> I
> > > > agree that you may want to skip the swap, you still need a form of
> > > > CommitOverlayPlanes() or something.
> > > 
> > > I know what you mean. It's non-obvious that this should work. The reason
it
> > > should be ok in practice, and correct me if I'm missing something, is
> because
> > > the only configuration where we'll skip the Swap is on Android for
> fullscreen
> > > video, and in that case we don't need any atomic changes. If you're
skipping
> > the
> > > swap it's because there's nothing that could be updated atomically with
the
> > > overlay: only the overlay is visible and the overlay will be drawn in
> > > ScheduleOverlayPlane instead of waiting for Swap.
> > > 
> > > WDYT?
> > 
> > I think that we should add a CommitOverlayPlanes and keep things consistent.
> 
> (there's perfectly valid reasons to skip the swap on other platforms too if
> damage is covered by overlays)

Ok, this certainly sounds like the right solution, thanks. I can start looking
at how we'd do it.

Powered by Google App Engine
This is Rietveld 408576698