 Chromium Code Reviews
 Chromium Code Reviews Issue 2908783002:
  WIP Hittest Component.
    
  
    Issue 2908783002:
  WIP Hittest Component. 
  | Index: components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc | 
| diff --git a/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc b/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc | 
| index 393f53fc2eb7d7d1b55226c84b1b895e1bfcf9d8..980031dd5e8c5b5dcaa2d7f42f0c33f0f8c6e559 100644 | 
| --- a/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc | 
| +++ b/components/viz/frame_sinks/gpu_root_compositor_frame_sink.cc | 
| @@ -4,6 +4,8 @@ | 
| #include "components/viz/frame_sinks/gpu_root_compositor_frame_sink.h" | 
| +#include "base/command_line.h" | 
| +#include "cc/base/switches.h" | 
| #include "cc/surfaces/compositor_frame_sink_support.h" | 
| #include "cc/surfaces/display.h" | 
| @@ -44,6 +46,11 @@ GpuRootCompositorFrameSink::GpuRootCompositorFrameSink( | 
| base::Unretained(this))); | 
| display_->Initialize(this, surface_manager); | 
| display_->SetVisible(true); | 
| + | 
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| 
rjkroege
2017/06/09 15:47:07
We must have a layering discussion with Fady. I am
 
gklassen
2017/06/12 16:30:41
Thank you.  I have moved the switch to viz on Fady
 | 
| + cc::switches::kUseVizHitTest)) { | 
| + hit_test_aggregator_ = base::MakeUnique<hit_test::HitTestAggregator>(); | 
| + } | 
| } | 
| GpuRootCompositorFrameSink::~GpuRootCompositorFrameSink() = default; | 
| @@ -114,7 +121,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() {} | 
| @@ -125,6 +135,8 @@ void GpuRootCompositorFrameSink::DidReceiveCompositorFrameAck( | 
| } | 
| void GpuRootCompositorFrameSink::OnBeginFrame(const cc::BeginFrameArgs& args) { | 
| + if (hit_test_aggregator_) | 
| + hit_test_aggregator_->Swap(); | 
| if (client_) | 
| client_->OnBeginFrame(args); | 
| } |