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

Unified Diff: content/renderer/mus/renderer_window_tree_client.cc

Issue 2886873002: Only send the FrameSinkId to client when it is necessary (Closed)
Patch Set: Address review issues. Created 3 years, 7 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
Index: content/renderer/mus/renderer_window_tree_client.cc
diff --git a/content/renderer/mus/renderer_window_tree_client.cc b/content/renderer/mus/renderer_window_tree_client.cc
index d78e3f2b22218aaa8551e9db48c8ebfbdb84306f..45fe8e03fcc2ba22e0d1092dbed4ce79abbfa0ef 100644
--- a/content/renderer/mus/renderer_window_tree_client.cc
+++ b/content/renderer/mus/renderer_window_tree_client.cc
@@ -53,7 +53,7 @@ void RendererWindowTreeClient::RequestCompositorFrameSink(
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const CompositorFrameSinkCallback& callback) {
DCHECK(pending_compositor_frame_sink_callback_.is_null());
- if (frame_sink_id_.is_valid()) {
+ if (tree_) {
RequestCompositorFrameSinkInternal(std::move(context_provider),
gpu_memory_buffer_manager, callback);
return;
@@ -77,9 +77,12 @@ void RendererWindowTreeClient::RequestCompositorFrameSinkInternal(
gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
const CompositorFrameSinkCallback& callback) {
std::unique_ptr<ui::ClientCompositorFrameSinkBinding> frame_sink_binding;
+ bool enable_surface_synchronization =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ cc::switches::kEnableSurfaceSynchronization);
auto frame_sink = ui::ClientCompositorFrameSink::Create(
- frame_sink_id_, std::move(context_provider), gpu_memory_buffer_manager,
- &frame_sink_binding);
+ std::move(context_provider), gpu_memory_buffer_manager,
+ &frame_sink_binding, enable_surface_synchronization);
tree_->AttachCompositorFrameSink(
root_window_id_, frame_sink_binding->TakeFrameSinkRequest(),
mojo::MakeProxy(frame_sink_binding->TakeFrameSinkClient()));
@@ -97,9 +100,7 @@ void RendererWindowTreeClient::OnEmbed(
int64_t display_id,
ui::Id focused_window_id,
bool drawn,
- const cc::FrameSinkId& frame_sink_id,
const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
- frame_sink_id_ = frame_sink_id;
root_window_id_ = root->window_id;
tree_ = std::move(tree);
if (!pending_compositor_frame_sink_callback_.is_null()) {
@@ -136,7 +137,6 @@ void RendererWindowTreeClient::OnTopLevelCreated(
ui::mojom::WindowDataPtr data,
int64_t display_id,
bool drawn,
- const cc::FrameSinkId& frame_sink_id,
const base::Optional<cc::LocalSurfaceId>& local_surface_id) {
NOTREACHED();
}
« no previous file with comments | « content/renderer/mus/renderer_window_tree_client.h ('k') | services/ui/public/cpp/client_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698