OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/mus/renderer_window_tree_client.h" | 5 #include "content/renderer/mus/renderer_window_tree_client.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 RendererWindowTreeClient::~RendererWindowTreeClient() { | 71 RendererWindowTreeClient::~RendererWindowTreeClient() { |
72 g_connections.Get().erase(routing_id_); | 72 g_connections.Get().erase(routing_id_); |
73 } | 73 } |
74 | 74 |
75 void RendererWindowTreeClient::RequestCompositorFrameSinkInternal( | 75 void RendererWindowTreeClient::RequestCompositorFrameSinkInternal( |
76 scoped_refptr<cc::ContextProvider> context_provider, | 76 scoped_refptr<cc::ContextProvider> context_provider, |
77 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, | 77 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
78 const CompositorFrameSinkCallback& callback) { | 78 const CompositorFrameSinkCallback& callback) { |
79 std::unique_ptr<ui::ClientCompositorFrameSinkBinding> frame_sink_binding; | 79 std::unique_ptr<ui::ClientCompositorFrameSinkBinding> frame_sink_binding; |
| 80 bool enable_surface_synchronization = |
| 81 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 82 cc::switches::kEnableSurfaceSynchronization); |
80 auto frame_sink = ui::ClientCompositorFrameSink::Create( | 83 auto frame_sink = ui::ClientCompositorFrameSink::Create( |
81 frame_sink_id_, std::move(context_provider), gpu_memory_buffer_manager, | 84 std::move(context_provider), gpu_memory_buffer_manager, |
82 &frame_sink_binding); | 85 &frame_sink_binding, enable_surface_synchronization); |
83 tree_->AttachCompositorFrameSink( | 86 tree_->AttachCompositorFrameSink( |
84 root_window_id_, frame_sink_binding->TakeFrameSinkRequest(), | 87 root_window_id_, frame_sink_binding->TakeFrameSinkRequest(), |
85 mojo::MakeProxy(frame_sink_binding->TakeFrameSinkClient())); | 88 mojo::MakeProxy(frame_sink_binding->TakeFrameSinkClient())); |
86 callback.Run(std::move(frame_sink)); | 89 callback.Run(std::move(frame_sink)); |
87 } | 90 } |
88 | 91 |
89 void RendererWindowTreeClient::DestroySelf() { | 92 void RendererWindowTreeClient::DestroySelf() { |
90 delete this; | 93 delete this; |
91 } | 94 } |
92 | 95 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 bool success) {} | 260 bool success) {} |
258 | 261 |
259 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} | 262 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} |
260 | 263 |
261 void RendererWindowTreeClient::GetWindowManager( | 264 void RendererWindowTreeClient::GetWindowManager( |
262 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { | 265 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { |
263 NOTREACHED(); | 266 NOTREACHED(); |
264 } | 267 } |
265 | 268 |
266 } // namespace content | 269 } // namespace content |
OLD | NEW |