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

Unified Diff: components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.cc

Issue 2937233002: Use HitTestAggregator in GpuRootCompositorFrameSink (Closed)
Patch Set: rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « components/viz/service/frame_sinks/gpu_root_compositor_frame_sink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698