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 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 if (!gpu_channel_host) { | 892 if (!gpu_channel_host) { |
893 gpu_channel_host = EstablishGpuChannelSync( | 893 gpu_channel_host = EstablishGpuChannelSync( |
894 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); | 894 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); |
895 } | 895 } |
896 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( | 896 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( |
897 make_scoped_ptr( | 897 make_scoped_ptr( |
898 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 898 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
899 gpu_channel_host.get(), | 899 gpu_channel_host.get(), |
900 blink::WebGraphicsContext3D::Attributes(), | 900 blink::WebGraphicsContext3D::Attributes(), |
901 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), | 901 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), |
902 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())), | 902 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 903 NULL)), |
903 "GPU-VideoAccelerator-Offscreen"); | 904 "GPU-VideoAccelerator-Offscreen"); |
904 } | 905 } |
905 } | 906 } |
906 if (gpu_channel_host) { | 907 if (gpu_channel_host) { |
907 gpu_factories = new RendererGpuVideoAcceleratorFactories( | 908 gpu_factories = new RendererGpuVideoAcceleratorFactories( |
908 gpu_channel_host.get(), gpu_va_context_provider_); | 909 gpu_channel_host.get(), gpu_va_context_provider_); |
909 } | 910 } |
910 return gpu_factories; | 911 return gpu_factories; |
911 } | 912 } |
912 | 913 |
913 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 914 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
914 RenderThreadImpl::CreateOffscreenContext3d() { | 915 RenderThreadImpl::CreateOffscreenContext3d() { |
915 blink::WebGraphicsContext3D::Attributes attributes; | 916 blink::WebGraphicsContext3D::Attributes attributes; |
916 attributes.shareResources = true; | 917 attributes.shareResources = true; |
917 attributes.depth = false; | 918 attributes.depth = false; |
918 attributes.stencil = false; | 919 attributes.stencil = false; |
919 attributes.antialias = false; | 920 attributes.antialias = false; |
920 attributes.noAutomaticFlushes = true; | 921 attributes.noAutomaticFlushes = true; |
921 | 922 |
922 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( | 923 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( |
923 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); | 924 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
924 return make_scoped_ptr( | 925 return make_scoped_ptr( |
925 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 926 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
926 gpu_channel_host.get(), | 927 gpu_channel_host.get(), |
927 attributes, | 928 attributes, |
928 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), | 929 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), |
929 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())); | 930 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 931 NULL)); |
930 } | 932 } |
931 | 933 |
932 scoped_refptr<cc::ContextProvider> | 934 scoped_refptr<cc::ContextProvider> |
933 RenderThreadImpl::OffscreenCompositorContextProvider() { | 935 RenderThreadImpl::OffscreenCompositorContextProvider() { |
934 DCHECK(IsMainThread()); | 936 DCHECK(IsMainThread()); |
935 | 937 |
936 #if defined(OS_ANDROID) | 938 #if defined(OS_ANDROID) |
937 if (SynchronousCompositorFactory* factory = | 939 if (SynchronousCompositorFactory* factory = |
938 SynchronousCompositorFactory::GetInstance()) { | 940 SynchronousCompositorFactory::GetInstance()) { |
939 if (compositor_message_loop_proxy_) | 941 if (compositor_message_loop_proxy_) |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 if (!gamepad_shared_memory_reader_) | 1371 if (!gamepad_shared_memory_reader_) |
1370 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); | 1372 gamepad_shared_memory_reader_.reset(new GamepadSharedMemoryReader); |
1371 gamepad_shared_memory_reader_->SampleGamepads(*data); | 1373 gamepad_shared_memory_reader_->SampleGamepads(*data); |
1372 } | 1374 } |
1373 | 1375 |
1374 base::ProcessId RenderThreadImpl::renderer_process_id() const { | 1376 base::ProcessId RenderThreadImpl::renderer_process_id() const { |
1375 return renderer_process_id_; | 1377 return renderer_process_id_; |
1376 } | 1378 } |
1377 | 1379 |
1378 } // namespace content | 1380 } // namespace content |
OLD | NEW |