Add SurfaceWillDraw notification

Desktop / Chromium - gklassen [chromium.org] - 15 June 2017 18:22 EDT

Adds a SurfaceWillDraw notification to allow observers to monitor as surfaces are added to the next display frame.

Viz will implement a hit-test component that will aggregate hit-test information published along with compositor frames. The aggregated data will be made available for hit testing in a shared memory object.

In order to ensure that the hit-test information matches the current information for the frame it needs to know which surfaces have been added to the current DisplayFrame.

A method has been added to Surface observer so that observers will be notified as surfaces are added to the Display frame. The notification is invoked during Surface Aggregation at the same place and following the same convention as the existing RunWillDrawCallback - the key difference being that this implementation allows one observer to monitor all surfaces without creating observers for each surface instance.

BUG=732398 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2938833002 Cr-Commit-Position: refs/heads/master@{#479865}

a15e976 Add SurfaceWillDraw notification
cc/surfaces/display_scheduler.cc | 2 ++
cc/surfaces/display_scheduler.h | 1 +
cc/surfaces/surface_aggregator.cc | 4 +++-
cc/surfaces/surface_aggregator_unittest.cc | 25 ++++++++++++++++++++--
cc/surfaces/surface_manager.cc | 6 ++++++
cc/surfaces/surface_manager.h | 4 ++++
cc/surfaces/surface_observer.h | 3 +++
cc/test/fake_surface_observer.cc | 10 +++++++++
cc/test/fake_surface_observer.h | 4 ++++
.../service/frame_sinks/mojo_frame_sink_manager.cc | 2 ++
.../service/frame_sinks/mojo_frame_sink_manager.h | 1 +
11 files changed, 59 insertions(+), 3 deletions(-)

Upstream: git.chromium.org


  • Share