OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #endif | 93 #endif |
94 | 94 |
95 using cc::ContextProvider; | 95 using cc::ContextProvider; |
96 using gpu::gles2::GLES2Interface; | 96 using gpu::gles2::GLES2Interface; |
97 | 97 |
98 namespace { | 98 namespace { |
99 | 99 |
100 const int kNumRetriesBeforeSoftwareFallback = 4; | 100 const int kNumRetriesBeforeSoftwareFallback = 4; |
101 | 101 |
102 bool IsUsingMus() { | 102 bool IsUsingMus() { |
103 return shell::ShellIsRemote(); | 103 return service_manager::ServiceManagerIsRemote(); |
104 } | 104 } |
105 | 105 |
106 scoped_refptr<content::ContextProviderCommandBuffer> CreateContextCommon( | 106 scoped_refptr<content::ContextProviderCommandBuffer> CreateContextCommon( |
107 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, | 107 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host, |
108 gpu::SurfaceHandle surface_handle, | 108 gpu::SurfaceHandle surface_handle, |
109 bool need_alpha_channel, | 109 bool need_alpha_channel, |
110 bool support_locking, | 110 bool support_locking, |
111 content::ContextProviderCommandBuffer* shared_context_provider, | 111 content::ContextProviderCommandBuffer* shared_context_provider, |
112 content::command_buffer_metrics::ContextType type) { | 112 content::command_buffer_metrics::ContextType type) { |
113 DCHECK( | 113 DCHECK( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // Make sure the lost context callback doesn't try to run during destruction. | 190 // Make sure the lost context callback doesn't try to run during destruction. |
191 callback_factory_.InvalidateWeakPtrs(); | 191 callback_factory_.InvalidateWeakPtrs(); |
192 | 192 |
193 task_graph_runner_->Shutdown(); | 193 task_graph_runner_->Shutdown(); |
194 } | 194 } |
195 | 195 |
196 std::unique_ptr<cc::SoftwareOutputDevice> | 196 std::unique_ptr<cc::SoftwareOutputDevice> |
197 GpuProcessTransportFactory::CreateSoftwareOutputDevice( | 197 GpuProcessTransportFactory::CreateSoftwareOutputDevice( |
198 ui::Compositor* compositor) { | 198 ui::Compositor* compositor) { |
199 #if defined(USE_AURA) | 199 #if defined(USE_AURA) |
200 if (shell::ShellIsRemote()) { | 200 if (service_manager::ServiceManagerIsRemote()) { |
201 NOTREACHED(); | 201 NOTREACHED(); |
202 return nullptr; | 202 return nullptr; |
203 } | 203 } |
204 #endif | 204 #endif |
205 | 205 |
206 #if defined(OS_WIN) | 206 #if defined(OS_WIN) |
207 return std::unique_ptr<cc::SoftwareOutputDevice>( | 207 return std::unique_ptr<cc::SoftwareOutputDevice>( |
208 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); | 208 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); |
209 #elif defined(USE_OZONE) | 209 #elif defined(USE_OZONE) |
210 return SoftwareOutputDeviceOzone::Create(compositor); | 210 return SoftwareOutputDeviceOzone::Create(compositor); |
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 shared_vulkan_context_provider_ = | 872 shared_vulkan_context_provider_ = |
873 cc::VulkanInProcessContextProvider::Create(); | 873 cc::VulkanInProcessContextProvider::Create(); |
874 } | 874 } |
875 | 875 |
876 shared_vulkan_context_provider_initialized_ = true; | 876 shared_vulkan_context_provider_initialized_ = true; |
877 } | 877 } |
878 return shared_vulkan_context_provider_; | 878 return shared_vulkan_context_provider_; |
879 } | 879 } |
880 | 880 |
881 } // namespace content | 881 } // namespace content |
OLD | NEW |