Commit 150f8669 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

chromeos: only register for first-surface-activation if necessary

This is only necessary when running in tests.

BUG=none
TEST=covered by tests

Change-Id: Ifa5aeace0ee9623e9392b2fb0912e1c2be7d6005
Reviewed-on: https://chromium-review.googlesource.com/c/1476032
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarSaman Sami <samans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632840}
parent 32e48c41
...@@ -6,12 +6,13 @@ ...@@ -6,12 +6,13 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/debug/stack_trace.h" #include "base/command_line.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "components/viz/common/surfaces/surface_info.h" #include "components/viz/common/surfaces/surface_info.h"
#include "components/viz/host/host_frame_sink_manager.h" #include "components/viz/host/host_frame_sink_manager.h"
#include "services/ws/client_change.h" #include "services/ws/client_change.h"
#include "services/ws/client_change_tracker.h" #include "services/ws/client_change_tracker.h"
#include "services/ws/common/switches.h"
#include "services/ws/proxy_window.h" #include "services/ws/proxy_window.h"
#include "services/ws/window_service.h" #include "services/ws/window_service.h"
#include "services/ws/window_tree.h" #include "services/ws/window_tree.h"
...@@ -90,8 +91,14 @@ void ClientRoot::RegisterVizEmbeddingSupport() { ...@@ -90,8 +91,14 @@ void ClientRoot::RegisterVizEmbeddingSupport() {
window_->env()->context_factory_private()->GetHostFrameSinkManager(); window_->env()->context_factory_private()->GetHostFrameSinkManager();
viz::FrameSinkId frame_sink_id = viz::FrameSinkId frame_sink_id =
ProxyWindow::GetMayBeNull(window_)->frame_sink_id(); ProxyWindow::GetMayBeNull(window_)->frame_sink_id();
// This code only needs first-surface-activation for tests.
const bool wants_first_surface_activation =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseTestConfig);
host_frame_sink_manager->RegisterFrameSinkId( host_frame_sink_manager->RegisterFrameSinkId(
frame_sink_id, this, viz::ReportFirstSurfaceActivation::kYes); frame_sink_id, this,
wants_first_surface_activation ? viz::ReportFirstSurfaceActivation::kYes
: viz::ReportFirstSurfaceActivation::kNo);
window_->SetEmbedFrameSinkId(frame_sink_id); window_->SetEmbedFrameSinkId(frame_sink_id);
UpdateLocalSurfaceIdAndClientSurfaceEmbedder(); UpdateLocalSurfaceIdAndClientSurfaceEmbedder();
...@@ -403,6 +410,8 @@ void ClientRoot::OnHostResized(aura::WindowTreeHost* host) { ...@@ -403,6 +410,8 @@ void ClientRoot::OnHostResized(aura::WindowTreeHost* host) {
void ClientRoot::OnFirstSurfaceActivation( void ClientRoot::OnFirstSurfaceActivation(
const viz::SurfaceInfo& surface_info) { const viz::SurfaceInfo& surface_info) {
// NOTE: this function is only called if kUseTestConfig is supplied. See
// call to RegisterFrameSinkId().
if (window_tree_->client_name().empty()) if (window_tree_->client_name().empty())
return; return;
......
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