| 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 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 if (!gpu_channel_host) { | 903 if (!gpu_channel_host) { |
| 904 gpu_channel_host = EstablishGpuChannelSync( | 904 gpu_channel_host = EstablishGpuChannelSync( |
| 905 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); | 905 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZ
E); |
| 906 } | 906 } |
| 907 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( | 907 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( |
| 908 make_scoped_ptr( | 908 make_scoped_ptr( |
| 909 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 909 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 910 gpu_channel_host.get(), | 910 gpu_channel_host.get(), |
| 911 blink::WebGraphicsContext3D::Attributes(), | 911 blink::WebGraphicsContext3D::Attributes(), |
| 912 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), | 912 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), |
| 913 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())), | 913 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 914 NULL)), |
| 914 "GPU-VideoAccelerator-Offscreen"); | 915 "GPU-VideoAccelerator-Offscreen"); |
| 915 if (gpu_va_context_provider_) { | 916 if (gpu_va_context_provider_) { |
| 916 media_loop_proxy->PostTask( | 917 media_loop_proxy->PostTask( |
| 917 FROM_HERE, | 918 FROM_HERE, |
| 918 base::Bind( | 919 base::Bind( |
| 919 base::IgnoreResult(&cc::ContextProvider::BindToCurrentThread), | 920 base::IgnoreResult(&cc::ContextProvider::BindToCurrentThread), |
| 920 gpu_va_context_provider_)); | 921 gpu_va_context_provider_)); |
| 921 } | 922 } |
| 922 } | 923 } |
| 923 } | 924 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 937 attributes.antialias = false; | 938 attributes.antialias = false; |
| 938 attributes.noAutomaticFlushes = true; | 939 attributes.noAutomaticFlushes = true; |
| 939 | 940 |
| 940 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( | 941 scoped_refptr<GpuChannelHost> gpu_channel_host(EstablishGpuChannelSync( |
| 941 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); | 942 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)); |
| 942 return make_scoped_ptr( | 943 return make_scoped_ptr( |
| 943 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 944 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 944 gpu_channel_host.get(), | 945 gpu_channel_host.get(), |
| 945 attributes, | 946 attributes, |
| 946 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), | 947 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"), |
| 947 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())); | 948 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 949 NULL)); |
| 948 } | 950 } |
| 949 | 951 |
| 950 scoped_refptr<cc::ContextProvider> | 952 scoped_refptr<cc::ContextProvider> |
| 951 RenderThreadImpl::OffscreenCompositorContextProvider() { | 953 RenderThreadImpl::OffscreenCompositorContextProvider() { |
| 952 DCHECK(IsMainThread()); | 954 DCHECK(IsMainThread()); |
| 953 | 955 |
| 954 #if defined(OS_ANDROID) | 956 #if defined(OS_ANDROID) |
| 955 if (SynchronousCompositorFactory* factory = | 957 if (SynchronousCompositorFactory* factory = |
| 956 SynchronousCompositorFactory::GetInstance()) { | 958 SynchronousCompositorFactory::GetInstance()) { |
| 957 if (compositor_message_loop_proxy_) | 959 if (compositor_message_loop_proxy_) |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 hidden_widget_count_--; | 1419 hidden_widget_count_--; |
| 1418 | 1420 |
| 1419 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { | 1421 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { |
| 1420 return; | 1422 return; |
| 1421 } | 1423 } |
| 1422 | 1424 |
| 1423 ScheduleIdleHandler(kLongIdleHandlerDelayMs); | 1425 ScheduleIdleHandler(kLongIdleHandlerDelayMs); |
| 1424 } | 1426 } |
| 1425 | 1427 |
| 1426 } // namespace content | 1428 } // namespace content |
| OLD | NEW |