| 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" |
| 11 #include "cc/base/switches.h" | 11 #include "cc/base/switches.h" |
| 12 #include "components/viz/client/client_layer_tree_frame_sink.h" | 12 #include "components/viz/client/client_layer_tree_frame_sink.h" |
| 13 #include "components/viz/client/hit_test_data_provider.h" |
| 13 #include "components/viz/client/local_surface_id_provider.h" | 14 #include "components/viz/client/local_surface_id_provider.h" |
| 14 | 15 |
| 15 namespace content { | 16 namespace content { |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 typedef std::map<int, RendererWindowTreeClient*> ConnectionMap; | 19 typedef std::map<int, RendererWindowTreeClient*> ConnectionMap; |
| 19 base::LazyInstance<ConnectionMap>::Leaky g_connections = | 20 base::LazyInstance<ConnectionMap>::Leaky g_connections = |
| 20 LAZY_INSTANCE_INITIALIZER; | 21 LAZY_INSTANCE_INITIALIZER; |
| 21 } // namespace | 22 } // namespace |
| 22 | 23 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 cc::mojom::CompositorFrameSinkRequest sink_request = | 82 cc::mojom::CompositorFrameSinkRequest sink_request = |
| 82 mojo::MakeRequest(&sink_info); | 83 mojo::MakeRequest(&sink_info); |
| 83 cc::mojom::CompositorFrameSinkClientPtr client; | 84 cc::mojom::CompositorFrameSinkClientPtr client; |
| 84 cc::mojom::CompositorFrameSinkClientRequest client_request = | 85 cc::mojom::CompositorFrameSinkClientRequest client_request = |
| 85 mojo::MakeRequest(&client); | 86 mojo::MakeRequest(&client); |
| 86 constexpr bool enable_surface_synchronization = true; | 87 constexpr bool enable_surface_synchronization = true; |
| 87 auto frame_sink = base::MakeUnique<viz::ClientLayerTreeFrameSink>( | 88 auto frame_sink = base::MakeUnique<viz::ClientLayerTreeFrameSink>( |
| 88 std::move(context_provider), nullptr /* worker_context_provider */, | 89 std::move(context_provider), nullptr /* worker_context_provider */, |
| 89 gpu_memory_buffer_manager, nullptr /* shared_bitmap_manager */, | 90 gpu_memory_buffer_manager, nullptr /* shared_bitmap_manager */, |
| 90 nullptr /* synthetic_begin_frame_source */, std::move(sink_info), | 91 nullptr /* synthetic_begin_frame_source */, std::move(sink_info), |
| 91 std::move(client_request), | 92 std::move(client_request), nullptr /* hit_test_data_provider_ */, |
| 92 base::MakeUnique<viz::DefaultLocalSurfaceIdProvider>(), | 93 base::MakeUnique<viz::DefaultLocalSurfaceIdProvider>(), |
| 93 enable_surface_synchronization); | 94 enable_surface_synchronization); |
| 94 tree_->AttachCompositorFrameSink(root_window_id_, std::move(sink_request), | 95 tree_->AttachCompositorFrameSink(root_window_id_, std::move(sink_request), |
| 95 std::move(client)); | 96 std::move(client)); |
| 96 callback.Run(std::move(frame_sink)); | 97 callback.Run(std::move(frame_sink)); |
| 97 } | 98 } |
| 98 | 99 |
| 99 void RendererWindowTreeClient::DestroySelf() { | 100 void RendererWindowTreeClient::DestroySelf() { |
| 100 delete this; | 101 delete this; |
| 101 } | 102 } |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 bool success) {} | 270 bool success) {} |
| 270 | 271 |
| 271 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} | 272 void RendererWindowTreeClient::RequestClose(uint32_t window_id) {} |
| 272 | 273 |
| 273 void RendererWindowTreeClient::GetWindowManager( | 274 void RendererWindowTreeClient::GetWindowManager( |
| 274 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { | 275 mojo::AssociatedInterfaceRequest<ui::mojom::WindowManager> internal) { |
| 275 NOTREACHED(); | 276 NOTREACHED(); |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace content | 279 } // namespace content |
| OLD | NEW |