| 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/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 DISALLOW_COPY_AND_ASSIGN(GpuClient); | 91 DISALLOW_COPY_AND_ASSIGN(GpuClient); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace | 94 } // namespace |
| 95 | 95 |
| 96 GpuHost::GpuHost(GpuHostDelegate* delegate) | 96 GpuHost::GpuHost(GpuHostDelegate* delegate) |
| 97 : delegate_(delegate), | 97 : delegate_(delegate), |
| 98 next_client_id_(kInternalGpuChannelClientId + 1), | 98 next_client_id_(kInternalGpuChannelClientId + 1), |
| 99 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 99 main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 100 gpu_host_binding_(this) { | 100 gpu_host_binding_(this) { |
| 101 gpu_main_impl_ = base::MakeUnique<GpuMain>(GetProxy(&gpu_main_)); | 101 gpu_main_impl_ = base::MakeUnique<GpuMain>(MakeRequest(&gpu_main_)); |
| 102 gpu_main_impl_->OnStart(); | 102 gpu_main_impl_->OnStart(); |
| 103 // TODO(sad): Once GPU process is split, this would look like: | 103 // TODO(sad): Once GPU process is split, this would look like: |
| 104 // connector->ConnectToInterface("gpu", &gpu_main_); | 104 // connector->ConnectToInterface("gpu", &gpu_main_); |
| 105 gpu_main_->CreateGpuService(GetProxy(&gpu_service_), | 105 gpu_main_->CreateGpuService(MakeRequest(&gpu_service_), |
| 106 gpu_host_binding_.CreateInterfacePtrAndBind()); | 106 gpu_host_binding_.CreateInterfacePtrAndBind()); |
| 107 gpu_memory_buffer_manager_ = base::MakeUnique<ServerGpuMemoryBufferManager>( | 107 gpu_memory_buffer_manager_ = base::MakeUnique<ServerGpuMemoryBufferManager>( |
| 108 gpu_service_.get(), next_client_id_++); | 108 gpu_service_.get(), next_client_id_++); |
| 109 } | 109 } |
| 110 | 110 |
| 111 GpuHost::~GpuHost() {} | 111 GpuHost::~GpuHost() {} |
| 112 | 112 |
| 113 void GpuHost::Add(mojom::GpuRequest request) { | 113 void GpuHost::Add(mojom::GpuRequest request) { |
| 114 mojo::MakeStrongBinding( | 114 mojo::MakeStrongBinding( |
| 115 base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_, | 115 base::MakeUnique<GpuClient>(next_client_id_++, &gpu_info_, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 138 void GpuHost::DidLoseContext(bool offscreen, | 138 void GpuHost::DidLoseContext(bool offscreen, |
| 139 gpu::error::ContextLostReason reason, | 139 gpu::error::ContextLostReason reason, |
| 140 const GURL& active_url) {} | 140 const GURL& active_url) {} |
| 141 | 141 |
| 142 void GpuHost::StoreShaderToDisk(int32_t client_id, | 142 void GpuHost::StoreShaderToDisk(int32_t client_id, |
| 143 const std::string& key, | 143 const std::string& key, |
| 144 const std::string& shader) {} | 144 const std::string& shader) {} |
| 145 | 145 |
| 146 } // namespace ws | 146 } // namespace ws |
| 147 } // namespace ui | 147 } // namespace ui |
| OLD | NEW |