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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 bool lose_context_when_out_of_memory = false; | 1287 bool lose_context_when_out_of_memory = false; |
1288 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( | 1288 gpu_va_context_provider_ = ContextProviderCommandBuffer::Create( |
1289 make_scoped_ptr( | 1289 make_scoped_ptr( |
1290 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1290 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
1291 gpu_channel_host.get(), | 1291 gpu_channel_host.get(), |
1292 attributes, | 1292 attributes, |
1293 lose_context_when_out_of_memory, | 1293 lose_context_when_out_of_memory, |
1294 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), | 1294 GURL("chrome://gpu/RenderThreadImpl::GetGpuVDAContext3D"), |
1295 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), | 1295 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
1296 NULL)), | 1296 NULL)), |
1297 "GPU-VideoAccelerator-Offscreen"); | 1297 GPU_VIDEO_ACCELERATOR_CONTEXT); |
1298 } | 1298 } |
1299 } | 1299 } |
1300 if (gpu_va_context_provider_.get()) { | 1300 if (gpu_va_context_provider_.get()) { |
1301 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( | 1301 gpu_factories = RendererGpuVideoAcceleratorFactories::Create( |
1302 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_); | 1302 gpu_channel_host.get(), media_task_runner, gpu_va_context_provider_); |
1303 } | 1303 } |
1304 return gpu_factories; | 1304 return gpu_factories; |
1305 } | 1305 } |
1306 | 1306 |
1307 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 1307 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
(...skipping 21 matching lines...) Expand all Loading... |
1329 shared_main_thread_contexts_ = NULL; | 1329 shared_main_thread_contexts_ = NULL; |
1330 #if defined(OS_ANDROID) | 1330 #if defined(OS_ANDROID) |
1331 if (SynchronousCompositorFactory* factory = | 1331 if (SynchronousCompositorFactory* factory = |
1332 SynchronousCompositorFactory::GetInstance()) { | 1332 SynchronousCompositorFactory::GetInstance()) { |
1333 shared_main_thread_contexts_ = factory->CreateOffscreenContextProvider( | 1333 shared_main_thread_contexts_ = factory->CreateOffscreenContextProvider( |
1334 GetOffscreenAttribs(), "Offscreen-MainThread"); | 1334 GetOffscreenAttribs(), "Offscreen-MainThread"); |
1335 } | 1335 } |
1336 #endif | 1336 #endif |
1337 if (!shared_main_thread_contexts_.get()) { | 1337 if (!shared_main_thread_contexts_.get()) { |
1338 shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( | 1338 shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( |
1339 CreateOffscreenContext3d(), "Offscreen-MainThread"); | 1339 CreateOffscreenContext3d(), RENDERER_MAINTHREAD_CONTEXT); |
1340 } | 1340 } |
1341 if (shared_main_thread_contexts_.get() && | 1341 if (shared_main_thread_contexts_.get() && |
1342 !shared_main_thread_contexts_->BindToCurrentThread()) | 1342 !shared_main_thread_contexts_->BindToCurrentThread()) |
1343 shared_main_thread_contexts_ = NULL; | 1343 shared_main_thread_contexts_ = NULL; |
1344 } | 1344 } |
1345 return shared_main_thread_contexts_; | 1345 return shared_main_thread_contexts_; |
1346 } | 1346 } |
1347 | 1347 |
1348 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 1348 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
1349 if (!audio_renderer_mixer_manager_) { | 1349 if (!audio_renderer_mixer_manager_) { |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 } | 1895 } |
1896 | 1896 |
1897 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1897 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1898 size_t erased = | 1898 size_t erased = |
1899 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1899 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1900 routing_id_); | 1900 routing_id_); |
1901 DCHECK_EQ(1u, erased); | 1901 DCHECK_EQ(1u, erased); |
1902 } | 1902 } |
1903 | 1903 |
1904 } // namespace content | 1904 } // namespace content |
OLD | NEW |