| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 #endif | 261 #endif |
| 262 | 262 |
| 263 return validator; | 263 return validator; |
| 264 } | 264 } |
| 265 | 265 |
| 266 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) { | 266 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) { |
| 267 #if defined(OS_CHROMEOS) | 267 #if defined(OS_CHROMEOS) |
| 268 // Software fallback does not happen on Chrome OS. | 268 // Software fallback does not happen on Chrome OS. |
| 269 return true; | 269 return true; |
| 270 #endif | 270 #endif |
| 271 if (IsUsingMus()) |
| 272 return true; |
| 271 | 273 |
| 272 #if defined(OS_WIN) | 274 #if defined(OS_WIN) |
| 273 if (::GetProp(compositor->widget(), kForceSoftwareCompositor) && | 275 if (::GetProp(compositor->widget(), kForceSoftwareCompositor) && |
| 274 ::RemoveProp(compositor->widget(), kForceSoftwareCompositor)) | 276 ::RemoveProp(compositor->widget(), kForceSoftwareCompositor)) |
| 275 return false; | 277 return false; |
| 276 #endif | 278 #endif |
| 277 | 279 |
| 278 return GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor(); | 280 return GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor(); |
| 279 } | 281 } |
| 280 | 282 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // The widget might have been released in the meantime. | 324 // The widget might have been released in the meantime. |
| 323 PerCompositorDataMap::iterator it = | 325 PerCompositorDataMap::iterator it = |
| 324 per_compositor_data_.find(compositor.get()); | 326 per_compositor_data_.find(compositor.get()); |
| 325 if (it == per_compositor_data_.end()) | 327 if (it == per_compositor_data_.end()) |
| 326 return; | 328 return; |
| 327 | 329 |
| 328 PerCompositorData* data = it->second; | 330 PerCompositorData* data = it->second; |
| 329 DCHECK(data); | 331 DCHECK(data); |
| 330 | 332 |
| 331 if (num_attempts > kNumRetriesBeforeSoftwareFallback) { | 333 if (num_attempts > kNumRetriesBeforeSoftwareFallback) { |
| 334 bool fatal = IsUsingMus(); |
| 332 #if defined(OS_CHROMEOS) | 335 #if defined(OS_CHROMEOS) |
| 333 LOG(FATAL) << "Unable to create a UI graphics context, and cannot use " | 336 fatal = true; |
| 334 << "software compositing on ChromeOS."; | |
| 335 #endif | 337 #endif |
| 338 LOG_IF(FATAL, fatal) << "Unable to create a UI graphics context, and " |
| 339 << "cannot use software compositing on ChromeOS."; |
| 336 create_gpu_output_surface = false; | 340 create_gpu_output_surface = false; |
| 337 } | 341 } |
| 338 | 342 |
| 339 #if defined(OS_WIN) | 343 #if defined(OS_WIN) |
| 340 gfx::RenderingWindowManager::GetInstance()->RegisterParent( | 344 gfx::RenderingWindowManager::GetInstance()->RegisterParent( |
| 341 compositor->widget()); | 345 compositor->widget()); |
| 342 #endif | 346 #endif |
| 343 | 347 |
| 344 scoped_refptr<cc::VulkanInProcessContextProvider> vulkan_context_provider = | 348 scoped_refptr<cc::VulkanInProcessContextProvider> vulkan_context_provider = |
| 345 SharedVulkanContextProvider(); | 349 SharedVulkanContextProvider(); |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 shared_vulkan_context_provider_ = | 862 shared_vulkan_context_provider_ = |
| 859 cc::VulkanInProcessContextProvider::Create(); | 863 cc::VulkanInProcessContextProvider::Create(); |
| 860 } | 864 } |
| 861 | 865 |
| 862 shared_vulkan_context_provider_initialized_ = true; | 866 shared_vulkan_context_provider_initialized_ = true; |
| 863 } | 867 } |
| 864 return shared_vulkan_context_provider_; | 868 return shared_vulkan_context_provider_; |
| 865 } | 869 } |
| 866 | 870 |
| 867 } // namespace content | 871 } // namespace content |
| OLD | NEW |