| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, | 1856 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, |
| 1857 const GURL& url) { | 1857 const GURL& url) { |
| 1858 const base::CommandLine& command_line = | 1858 const base::CommandLine& command_line = |
| 1859 *base::CommandLine::ForCurrentProcess(); | 1859 *base::CommandLine::ForCurrentProcess(); |
| 1860 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1860 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
| 1861 use_software = true; | 1861 use_software = true; |
| 1862 | 1862 |
| 1863 #if defined(USE_AURA) | 1863 #if defined(USE_AURA) |
| 1864 if (!use_software && IsRunningInMash() && | 1864 if (!use_software && IsRunningInMash() && |
| 1865 !command_line.HasSwitch(switches::kNoUseMusInRenderer)) { | 1865 !command_line.HasSwitch(switches::kNoUseMusInRenderer)) { |
| 1866 scoped_refptr<gpu::GpuChannelHost> channel = EstablishGpuChannelSync(); |
| 1867 // If the channel could not be established correctly, then return null. This |
| 1868 // would cause the compositor to wait and try again at a later time. |
| 1869 if (!channel) |
| 1870 return nullptr; |
| 1866 return RendererWindowTreeClient::Get(routing_id) | 1871 return RendererWindowTreeClient::Get(routing_id) |
| 1867 ->CreateCompositorFrameSink( | 1872 ->CreateCompositorFrameSink( |
| 1868 frame_sink_id, | 1873 frame_sink_id, gpu_->CreateContextProvider(std::move(channel)), |
| 1869 gpu_->CreateContextProvider(EstablishGpuChannelSync()), | |
| 1870 GetGpuMemoryBufferManager()); | 1874 GetGpuMemoryBufferManager()); |
| 1871 } | 1875 } |
| 1872 #endif | 1876 #endif |
| 1873 | 1877 |
| 1874 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; | 1878 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; |
| 1875 | 1879 |
| 1876 if (command_line.HasSwitch(switches::kEnableVulkan)) { | 1880 if (command_line.HasSwitch(switches::kEnableVulkan)) { |
| 1877 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = | 1881 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = |
| 1878 cc::VulkanInProcessContextProvider::Create(); | 1882 cc::VulkanInProcessContextProvider::Create(); |
| 1879 if (vulkan_context_provider) { | 1883 if (vulkan_context_provider) { |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2388 } | 2392 } |
| 2389 } | 2393 } |
| 2390 | 2394 |
| 2391 void RenderThreadImpl::OnRendererInterfaceRequest( | 2395 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2392 mojom::RendererAssociatedRequest request) { | 2396 mojom::RendererAssociatedRequest request) { |
| 2393 DCHECK(!renderer_binding_.is_bound()); | 2397 DCHECK(!renderer_binding_.is_bound()); |
| 2394 renderer_binding_.Bind(std::move(request)); | 2398 renderer_binding_.Bind(std::move(request)); |
| 2395 } | 2399 } |
| 2396 | 2400 |
| 2397 } // namespace content | 2401 } // namespace content |
| OLD | NEW |