Chromium Code Reviews| Index: components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc |
| diff --git a/components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc b/components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc |
| index 41bde869157a37b7bdcbe5f882b807a1971f8cef..e106eabd748cb4ff33000ce2818855c868de6519 100644 |
| --- a/components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc |
| +++ b/components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc |
| @@ -6,6 +6,7 @@ |
| #include <utility> |
| +#include "base/command_line.h" |
| #include "components/viz/service/display/display.h" |
| #include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" |
| #include "components/viz/service/frame_sinks/frame_sink_manager.h" |
| @@ -49,6 +50,10 @@ GpuRootCompositorFrameSink::GpuRootCompositorFrameSink( |
| frame_sink_manager->RegisterBeginFrameSource( |
| display_begin_frame_source_.get(), frame_sink_id); |
| display_->Initialize(this, frame_sink_manager->surface_manager()); |
| + |
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kUseVizHitTest)) |
| + hit_test_aggregator_ = base::MakeUnique<HitTestAggregator>(); |
|
Fady Samuel
2017/07/17 17:08:24
Do we need a switch at all? Any reason not to alwa
gklassen
2017/07/17 21:09:52
It was included to keep runtime cost minimal when
|
| } |
| GpuRootCompositorFrameSink::~GpuRootCompositorFrameSink() { |
| @@ -118,7 +123,10 @@ void GpuRootCompositorFrameSink::DisplayOutputSurfaceLost() { |
| void GpuRootCompositorFrameSink::DisplayWillDrawAndSwap( |
| bool will_draw_and_swap, |
| - const cc::RenderPassList& render_pass) {} |
| + const cc::RenderPassList& render_pass) { |
| + if (hit_test_aggregator_) |
| + hit_test_aggregator_->PostTaskAggregate(display_->CurrentSurfaceId()); |
| +} |
| void GpuRootCompositorFrameSink::DisplayDidDrawAndSwap() {} |
| @@ -129,6 +137,8 @@ void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck( |
| } |
| void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| + if (hit_test_aggregator_) |
| + hit_test_aggregator_->Swap(); |
| if (client_) |
| client_->OnBeginFrame(args); |
| } |