Commit 77f9e03f authored by kylechar's avatar kylechar Committed by Commit Bot

Fix OOPIF hit testing with unified desktop

With CrOS unified desktop the unified display skips drawing and instead
the physical displays embed the unified display surface. This means that
surface and hit test data aggregation happens for the physical displays.

However, hit testing still happens on the unified display in the browser
process. For OOPIF content the hit test data is missing and events are
routed to the wrong renderer process. As a result, OOPIFs never receive
events.

This CL fixes OOPIF hit testing on the unified display by ensuring
surface and hit test aggregation happens there and hit test data is sent
back to the browser process.

Bug: 1085860
Change-Id: I2e0809bf58d2c9fd949f815d59f3f0056d6f9590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2523417
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: default avatarVasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825876}
parent 77cff0df
...@@ -514,13 +514,16 @@ void Display::SetOutputIsSecure(bool secure) { ...@@ -514,13 +514,16 @@ void Display::SetOutputIsSecure(bool secure) {
} }
void Display::InitializeRenderer(bool enable_shared_images) { void Display::InitializeRenderer(bool enable_shared_images) {
auto mode = output_surface_->context_provider() || skia_output_surface_ bool uses_gpu_resources = output_surface_->context_provider() ||
? DisplayResourceProvider::kGpu skia_output_surface_ ||
: DisplayResourceProvider::kSoftware; output_surface_->capabilities().skips_draw;
resource_provider_ = std::make_unique<DisplayResourceProvider>( resource_provider_ = std::make_unique<DisplayResourceProvider>(
mode, output_surface_->context_provider(), bitmap_manager_, uses_gpu_resources ? DisplayResourceProvider::kGpu
: DisplayResourceProvider::kSoftware,
output_surface_->context_provider(), bitmap_manager_,
enable_shared_images); enable_shared_images);
if (settings_.use_skia_renderer && mode == DisplayResourceProvider::kGpu) { if (skia_output_surface_) {
renderer_ = std::make_unique<SkiaRenderer>( renderer_ = std::make_unique<SkiaRenderer>(
&settings_, debug_settings_, output_surface_.get(), &settings_, debug_settings_, output_surface_.get(),
resource_provider_.get(), overlay_processor_.get(), resource_provider_.get(), overlay_processor_.get(),
...@@ -600,11 +603,6 @@ bool Display::DrawAndSwap(base::TimeTicks expected_display_time) { ...@@ -600,11 +603,6 @@ bool Display::DrawAndSwap(base::TimeTicks expected_display_time) {
return false; return false;
} }
if (output_surface_->capabilities().skips_draw) {
TRACE_EVENT_INSTANT0("viz", "Skip draw", TRACE_EVENT_SCOPE_THREAD);
return true;
}
gfx::OverlayTransform current_display_transform = gfx::OVERLAY_TRANSFORM_NONE; gfx::OverlayTransform current_display_transform = gfx::OVERLAY_TRANSFORM_NONE;
Surface* surface = surface_manager_->GetSurfaceForId(current_surface_id_); Surface* surface = surface_manager_->GetSurfaceForId(current_surface_id_);
if (surface->HasActiveFrame()) { if (surface->HasActiveFrame()) {
...@@ -696,6 +694,14 @@ bool Display::DrawAndSwap(base::TimeTicks expected_display_time) { ...@@ -696,6 +694,14 @@ bool Display::DrawAndSwap(base::TimeTicks expected_display_time) {
// Run callbacks early to allow pipelining and collect presented callbacks. // Run callbacks early to allow pipelining and collect presented callbacks.
damage_tracker_->RunDrawCallbacks(); damage_tracker_->RunDrawCallbacks();
if (output_surface_->capabilities().skips_draw) {
TRACE_EVENT_INSTANT0("viz", "Skip draw", TRACE_EVENT_SCOPE_THREAD);
// Aggregation needs to happen before generating hit test for the unified
// desktop display. After this point skip drawing anything for real.
client_->DisplayWillDrawAndSwap(false, &frame.render_pass_list);
return true;
}
frame.latency_info.insert(frame.latency_info.end(), frame.latency_info.insert(frame.latency_info.end(),
stored_latency_info_.begin(), stored_latency_info_.begin(),
stored_latency_info_.end()); stored_latency_info_.end());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment