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

Issue 2785103003: [cc] CompositorFrameSinkSupport: Defer BeginFrameAck of pending frames. (Closed)

Created:
3 years, 8 months ago by Eric Seckler
Modified:
3 years, 7 months ago
CC:
chromium-reviews, cc-bugs_chromium.org, Sami, enne (OOO)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[cc] CompositorFrameSinkSupport: Defer BeginFrameAck of pending frames. This defers forwarding the BeginFrameAck attached to a CompositorFrame submitted to CompositorFrameSinkSupport until it is activated. For this purpose, CFSS continues to observe BeginFrames while a frame is pending to be activated, even if the client is not in need of BeginFrames. This is work towards unified BeginFrame acknowledgments, see: Tracking bug: https://crbug.com/697086 Design doc: http://bit.ly/beginframeacks DO_NOT_SUBMIT. superseded by https://codereview.chromium.org/2854163003/. BUG=703079, 697086, 646774 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Patch Set 1 #

Total comments: 14

Patch Set 2 : add some comments, plumb SurfaceDiscarded. #

Total comments: 12

Patch Set 3 : address comments, some fixes, added tests. #

Total comments: 6

Patch Set 4 : add comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+335 lines, -34 lines) Patch
M cc/surfaces/compositor_frame_sink_support.h View 1 2 6 chunks +33 lines, -1 line 0 comments Download
M cc/surfaces/compositor_frame_sink_support.cc View 1 2 3 6 chunks +148 lines, -20 lines 0 comments Download
M cc/surfaces/compositor_frame_sink_support_unittest.cc View 1 2 3 chunks +136 lines, -4 lines 0 comments Download
M cc/surfaces/direct_compositor_frame_sink_unittest.cc View 3 chunks +6 lines, -8 lines 0 comments Download
M cc/surfaces/surface_factory.cc View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M cc/surfaces/surface_factory_client.h View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (12 generated)
Eric Seckler
Fady + Brian, could you have a look if this is sensible? :) Once we ...
3 years, 8 months ago (2017-03-30 09:38:04 UTC) #5
Fady Samuel
A bunch of questions. I'm still trying to wrap my head around this code. Thanks! ...
3 years, 8 months ago (2017-03-30 12:41:55 UTC) #8
Fady Samuel
A bunch of questions. I'm still trying to wrap my head around this code. Thanks! ...
3 years, 8 months ago (2017-03-30 12:41:56 UTC) #9
Eric Seckler
On 2017/03/30 12:41:56, Fady Samuel wrote: > A bunch of questions. I'm still trying to ...
3 years, 8 months ago (2017-03-30 14:20:50 UTC) #10
Fady Samuel
https://codereview.chromium.org/2785103003/diff/20001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2785103003/diff/20001/cc/surfaces/compositor_frame_sink_support.cc#newcode96 cc/surfaces/compositor_frame_sink_support.cc:96: begin_frame_ack_for_pending_frame_.source_id = ack.source_id; I wonder if we can modify ...
3 years, 8 months ago (2017-03-31 00:09:02 UTC) #11
Eric Seckler
I added some tests now too. However, I realized that SurfaceDependencyTracker is also a BeginFrameObserver ...
3 years, 8 months ago (2017-03-31 15:24:03 UTC) #12
brianderson
https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_frame_sink_support.cc File cc/surfaces/compositor_frame_sink_support.cc (right): https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_frame_sink_support.cc#newcode96 cc/surfaces/compositor_frame_sink_support.cc:96: begin_frame_ack_for_pending_frame_->source_id = ack.source_id; Is it possible for the source_id ...
3 years, 8 months ago (2017-03-31 19:21:27 UTC) #17
Eric Seckler
3 years, 8 months ago (2017-04-03 11:21:00 UTC) #18
Let's try out doing this in SurfaceDependencyTracker before getting hung up on
this patch though :)

https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_...
File cc/surfaces/compositor_frame_sink_support.cc (right):

https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_...
cc/surfaces/compositor_frame_sink_support.cc:96:
begin_frame_ack_for_pending_frame_->source_id = ack.source_id;
On 2017/03/31 19:21:27, brianderson wrote:
> Is it possible for the source_id to change?
> 
> If not, should this be a DCHECK?
> If yes, do we need to store a collection of acks?

Considering headless use cases (dynamically replacing the BFS): yeah, it's
possible :)

We don't need to store multiple acks though, since we can always only ack the
latest BeginFrame. If the source changes, we just update the
latest_confirmed_sequence_number of the begin_frame_ack_for_pending_frame_ (that
we will eventually send when the CompositorFrame activates).

https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_...
cc/surfaces/compositor_frame_sink_support.cc:268: if
(last_begin_frame_args_.IsValid()) {
On 2017/03/31 19:21:27, brianderson wrote:
> Can you add a comment explaining why this block is needed?

Done.

https://codereview.chromium.org/2785103003/diff/40001/cc/surfaces/compositor_...
cc/surfaces/compositor_frame_sink_support.cc:327: void
CompositorFrameSinkSupport::AcknowledgeLastBeginFrameWithoutUpdates() {
On 2017/03/31 19:21:27, brianderson wrote:
> It looks like this acknowledges the most recently sent begin frame even before
> the pending frame hasn't been acknowledged.
Correct. In order to eventually acknowledge the activated CompositorFrame's
updates (to latest_confirmed_sequence_number), we need to continue observing the
BeginFrame source. We use this method to acknowledge BeginFrames that pass while
the frame is still pending and to ack the current BeginFrame if the pending
frame is discarded for some reason.

> When would you want to acknowledge out of order?
You're right, I guess we could decide not to send acks for past BeginFrames
(during OnBeginFrame), since these acks are for not for the current BeginFrame
and contain no updates to latest_confirmed_sequence_number.

Powered by Google App Engine
This is Rietveld 408576698