| 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 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1840 } | 1840 } |
| 1841 | 1841 |
| 1842 gpu_channel_ = gpu_->EstablishGpuChannelSync(); | 1842 gpu_channel_ = gpu_->EstablishGpuChannelSync(); |
| 1843 if (gpu_channel_) | 1843 if (gpu_channel_) |
| 1844 GetContentClient()->SetGpuInfo(gpu_channel_->gpu_info()); | 1844 GetContentClient()->SetGpuInfo(gpu_channel_->gpu_info()); |
| 1845 return gpu_channel_; | 1845 return gpu_channel_; |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 std::unique_ptr<cc::CompositorFrameSink> | 1848 std::unique_ptr<cc::CompositorFrameSink> |
| 1849 RenderThreadImpl::CreateCompositorFrameSink( | 1849 RenderThreadImpl::CreateCompositorFrameSink( |
| 1850 const cc::FrameSinkId& frame_sink_id, |
| 1850 bool use_software, | 1851 bool use_software, |
| 1851 int routing_id, | 1852 int routing_id, |
| 1852 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, | 1853 scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue, |
| 1853 const GURL& url) { | 1854 const GURL& url) { |
| 1854 const base::CommandLine& command_line = | 1855 const base::CommandLine& command_line = |
| 1855 *base::CommandLine::ForCurrentProcess(); | 1856 *base::CommandLine::ForCurrentProcess(); |
| 1856 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) | 1857 if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
| 1857 use_software = true; | 1858 use_software = true; |
| 1858 | 1859 |
| 1859 #if defined(USE_AURA) | 1860 #if defined(USE_AURA) |
| 1860 if (GetServiceManagerConnection() && !use_software && | 1861 if (GetServiceManagerConnection() && !use_software && |
| 1861 command_line.HasSwitch(switches::kUseMusInRenderer)) { | 1862 command_line.HasSwitch(switches::kUseMusInRenderer)) { |
| 1862 RenderWidgetMusConnection* connection = | 1863 RenderWidgetMusConnection* connection = |
| 1863 RenderWidgetMusConnection::GetOrCreate(routing_id); | 1864 RenderWidgetMusConnection::GetOrCreate(routing_id); |
| 1864 return connection->CreateCompositorFrameSink( | 1865 return connection->CreateCompositorFrameSink( |
| 1865 gpu_->CreateContextProvider(EstablishGpuChannelSync()), | 1866 frame_sink_id, gpu_->CreateContextProvider(EstablishGpuChannelSync()), |
| 1866 GetGpuMemoryBufferManager()); | 1867 GetGpuMemoryBufferManager()); |
| 1867 } | 1868 } |
| 1868 #endif | 1869 #endif |
| 1869 | 1870 |
| 1870 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; | 1871 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; |
| 1871 | 1872 |
| 1872 if (command_line.HasSwitch(switches::kEnableVulkan)) { | 1873 if (command_line.HasSwitch(switches::kEnableVulkan)) { |
| 1873 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = | 1874 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = |
| 1874 cc::VulkanInProcessContextProvider::Create(); | 1875 cc::VulkanInProcessContextProvider::Create(); |
| 1875 if (vulkan_context_provider) { | 1876 if (vulkan_context_provider) { |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 } | 2421 } |
| 2421 } | 2422 } |
| 2422 | 2423 |
| 2423 void RenderThreadImpl::OnRendererInterfaceRequest( | 2424 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2424 mojom::RendererAssociatedRequest request) { | 2425 mojom::RendererAssociatedRequest request) { |
| 2425 DCHECK(!renderer_binding_.is_bound()); | 2426 DCHECK(!renderer_binding_.is_bound()); |
| 2426 renderer_binding_.Bind(std::move(request)); | 2427 renderer_binding_.Bind(std::move(request)); |
| 2427 } | 2428 } |
| 2428 | 2429 |
| 2429 } // namespace content | 2430 } // namespace content |
| OLD | NEW |