| 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 <vector> | 10 #include <vector> |
| (...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 if (!gpu_channel_host) { | 880 if (!gpu_channel_host) { |
| 881 gpu_channel_host = EstablishGpuChannelSync( | 881 gpu_channel_host = EstablishGpuChannelSync( |
| 882 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); | 882 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); |
| 883 } | 883 } |
| 884 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( | 884 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( |
| 885 make_scoped_ptr( | 885 make_scoped_ptr( |
| 886 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 886 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 887 gpu_channel_host.get(), | 887 gpu_channel_host.get(), |
| 888 blink::WebGraphicsContext3D::Attributes(), | 888 blink::WebGraphicsContext3D::Attributes(), |
| 889 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), | 889 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), |
| 890 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())), | 890 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 891 NULL)), |
| 891 "GPU-VideoAccelerator-Offscreen"); | 892 "GPU-VideoAccelerator-Offscreen"); |
| 892 } | 893 } |
| 893 } | 894 } |
| 894 if (gpu_channel_host) { | 895 if (gpu_channel_host) { |
| 895 gpu_factories = new RendererGpuVideoAcceleratorFactories( | 896 gpu_factories = new RendererGpuVideoAcceleratorFactories( |
| 896 gpu_channel_host.get(), gpu_va_context_provider_); | 897 gpu_channel_host.get(), gpu_va_context_provider_); |
| 897 } | 898 } |
| 898 return gpu_factories; | 899 return gpu_factories; |
| 899 } | 900 } |
| 900 | 901 |
| 901 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 902 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
| 902 RenderThreadImpl::CreateOffscreenContext3d() { | 903 RenderThreadImpl::CreateOffscreenContext3d() { |
| 903 blink::WebGraphicsContext3D::Attributes attributes; | 904 blink::WebGraphicsContext3D::Attributes attributes; |
| 904 attributes.shareResources = true; | 905 attributes.shareResources = true; |
| 905 attributes.depth = false; | 906 attributes.depth = false; |
| 906 attributes.stencil = false; | 907 attributes.stencil = false; |
| 907 attributes.antialias = false; | 908 attributes.antialias = false; |
| 908 attributes.noAutomaticFlushes = true; | 909 attributes.noAutomaticFlushes = true; |
| 909 | 910 |
| 910 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( | 911 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( |
| 911 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); | 912 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
| 912 return make_scoped_ptr( | 913 return make_scoped_ptr( |
| 913 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 914 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 914 gpu_channel_host.get(), | 915 gpu_channel_host.get(), |
| 915 attributes, | 916 attributes, |
| 916 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), | 917 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), |
| 917 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())); | 918 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 919 NULL)); |
| 918 } | 920 } |
| 919 | 921 |
| 920 scoped_refptr<cc::ContextProvider> | 922 scoped_refptr<cc::ContextProvider> |
| 921 RenderThreadImpl::OffscreenCompositorContextProvider() { | 923 RenderThreadImpl::OffscreenCompositorContextProvider() { |
| 922 DCHECK(IsMainThread()); | 924 DCHECK(IsMainThread()); |
| 923 | 925 |
| 924 #if defined(OS_ANDROID) | 926 #if defined(OS_ANDROID) |
| 925 if (SynchronousCompositorFactory* factory = | 927 if (SynchronousCompositorFactory* factory = |
| 926 SynchronousCompositorFactory::GetInstance()) { | 928 SynchronousCompositorFactory::GetInstance()) { |
| 927 if (compositor_message_loop_proxy_) | 929 if (compositor_message_loop_proxy_) |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1351 if (!gamepad_shared_memory_reader_) | 1353 if (!gamepad_shared_memory_reader_) |
| 1352 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 1354 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
| 1353 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1355 gamepad_shared_memory_reader_->SampleGamepads(*data); |
| 1354 } | 1356 } |
| 1355 | 1357 |
| 1356 base::ProcessId RenderThreadImpl::renderer_process_id() const { | 1358 base::ProcessId RenderThreadImpl::renderer_process_id() const { |
| 1357 return renderer_process_id_; | 1359 return renderer_process_id_; |
| 1358 } | 1360 } |
| 1359 | 1361 |
| 1360 } // namespace content | 1362 } // namespace content |
| OLD | NEW |