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