| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/ui/ws/gpu_host.h" | 5 #include "services/ui/ws/gpu_host.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 24 #include "ui/gfx/win/rendering_window_manager.h" | 24 #include "ui/gfx/win/rendering_window_manager.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace ui { | 27 namespace ui { |
| 28 namespace ws { | 28 namespace ws { |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| 32 // The client Id 1 is reserved for the display compositor. | 32 // The client Id 1 is reserved for the frame sink manager. |
| 33 const int32_t kInternalGpuChannelClientId = 2; | 33 const int32_t kInternalGpuChannelClientId = 2; |
| 34 | 34 |
| 35 } // namespace | 35 } // namespace |
| 36 | 36 |
| 37 GpuHost::GpuHost(GpuHostDelegate* delegate) | 37 GpuHost::GpuHost(GpuHostDelegate* delegate) |
| 38 : delegate_(delegate), | 38 : delegate_(delegate), |
| 39 next_client_id_(kInternalGpuChannelClientId + 1), | 39 next_client_id_(kInternalGpuChannelClientId + 1), |
| 40 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 40 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 41 gpu_host_binding_(this) { | 41 gpu_host_binding_(this) { |
| 42 // TODO(sad): Once GPU process is split, this would look like: | 42 // TODO(sad): Once GPU process is split, this would look like: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 65 gfx::RenderingWindowManager::GetInstance()->RegisterParent(widget); | 65 gfx::RenderingWindowManager::GetInstance()->RegisterParent(widget); |
| 66 #endif | 66 #endif |
| 67 } | 67 } |
| 68 | 68 |
| 69 void GpuHost::OnAcceleratedWidgetDestroyed(gfx::AcceleratedWidget widget) { | 69 void GpuHost::OnAcceleratedWidgetDestroyed(gfx::AcceleratedWidget widget) { |
| 70 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 71 gfx::RenderingWindowManager::GetInstance()->UnregisterParent(widget); | 71 gfx::RenderingWindowManager::GetInstance()->UnregisterParent(widget); |
| 72 #endif | 72 #endif |
| 73 } | 73 } |
| 74 | 74 |
| 75 void GpuHost::CreateDisplayCompositor( | 75 void GpuHost::CreateFrameSinkManager( |
| 76 cc::mojom::DisplayCompositorRequest request, | 76 cc::mojom::FrameSinkManagerRequest request, |
| 77 cc::mojom::DisplayCompositorClientPtr client) { | 77 cc::mojom::FrameSinkManagerClientPtr client) { |
| 78 gpu_main_->CreateDisplayCompositor(std::move(request), std::move(client)); | 78 gpu_main_->CreateFrameSinkManager(std::move(request), std::move(client)); |
| 79 } | 79 } |
| 80 | 80 |
| 81 GpuClient* GpuHost::AddInternal(mojom::GpuRequest request) { | 81 GpuClient* GpuHost::AddInternal(mojom::GpuRequest request) { |
| 82 auto client(base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_, | 82 auto client(base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_, |
| 83 gpu_memory_buffer_manager_.get(), | 83 gpu_memory_buffer_manager_.get(), |
| 84 gpu_service_.get())); | 84 gpu_service_.get())); |
| 85 GpuClient* client_ref = client.get(); | 85 GpuClient* client_ref = client.get(); |
| 86 gpu_bindings_.AddBinding(std::move(client), std::move(request)); | 86 gpu_bindings_.AddBinding(std::move(client), std::move(request)); |
| 87 return client_ref; | 87 return client_ref; |
| 88 } | 88 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 void GpuHost::StoreShaderToDisk(int32_t client_id, | 136 void GpuHost::StoreShaderToDisk(int32_t client_id, |
| 137 const std::string& key, | 137 const std::string& key, |
| 138 const std::string& shader) {} | 138 const std::string& shader) {} |
| 139 | 139 |
| 140 void GpuHost::RecordLogMessage(int32_t severity, | 140 void GpuHost::RecordLogMessage(int32_t severity, |
| 141 const std::string& header, | 141 const std::string& header, |
| 142 const std::string& message) {} | 142 const std::string& message) {} |
| 143 | 143 |
| 144 } // namespace ws | 144 } // namespace ws |
| 145 } // namespace ui | 145 } // namespace ui |
| OLD | NEW |