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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 | 1882 |
1883 #if defined(USE_AURA) | 1883 #if defined(USE_AURA) |
1884 if (!use_software && IsRunningInMash()) { | 1884 if (!use_software && IsRunningInMash()) { |
1885 scoped_refptr<gpu::GpuChannelHost> channel = EstablishGpuChannelSync(); | 1885 scoped_refptr<gpu::GpuChannelHost> channel = EstablishGpuChannelSync(); |
1886 // If the channel could not be established correctly, then return null. This | 1886 // If the channel could not be established correctly, then return null. This |
1887 // would cause the compositor to wait and try again at a later time. | 1887 // would cause the compositor to wait and try again at a later time. |
1888 if (!channel) { | 1888 if (!channel) { |
1889 callback.Run(nullptr); | 1889 callback.Run(nullptr); |
1890 return; | 1890 return; |
1891 } | 1891 } |
1892 callback.Run(RendererWindowTreeClient::Get(routing_id) | 1892 RendererWindowTreeClient::Get(routing_id) |
1893 ->CreateCompositorFrameSink( | 1893 ->RequestCompositorFrameSink( |
1894 cc::FrameSinkId(client_id_, routing_id), | 1894 gpu_->CreateContextProvider(std::move(channel)), |
1895 gpu_->CreateContextProvider(std::move(channel)), | 1895 GetGpuMemoryBufferManager(), callback); |
1896 GetGpuMemoryBufferManager())); | |
1897 return; | 1896 return; |
1898 } | 1897 } |
1899 #endif | 1898 #endif |
1900 | 1899 |
1901 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; | 1900 uint32_t compositor_frame_sink_id = g_next_compositor_frame_sink_id++; |
1902 | 1901 |
1903 if (command_line.HasSwitch(switches::kEnableVulkan)) { | 1902 if (command_line.HasSwitch(switches::kEnableVulkan)) { |
1904 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = | 1903 scoped_refptr<cc::VulkanContextProvider> vulkan_context_provider = |
1905 cc::VulkanInProcessContextProvider::Create(); | 1904 cc::VulkanInProcessContextProvider::Create(); |
1906 if (vulkan_context_provider) { | 1905 if (vulkan_context_provider) { |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2428 } | 2427 } |
2429 } | 2428 } |
2430 | 2429 |
2431 void RenderThreadImpl::OnRendererInterfaceRequest( | 2430 void RenderThreadImpl::OnRendererInterfaceRequest( |
2432 mojom::RendererAssociatedRequest request) { | 2431 mojom::RendererAssociatedRequest request) { |
2433 DCHECK(!renderer_binding_.is_bound()); | 2432 DCHECK(!renderer_binding_.is_bound()); |
2434 renderer_binding_.Bind(std::move(request)); | 2433 renderer_binding_.Bind(std::move(request)); |
2435 } | 2434 } |
2436 | 2435 |
2437 } // namespace content | 2436 } // namespace content |
OLD | NEW |