| 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 <utility> | 10 #include <utility> |
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1424 shared_main_thread_contexts_ = CreateOffscreenContext( | 1424 shared_main_thread_contexts_ = CreateOffscreenContext( |
| 1425 std::move(gpu_channel_host), gpu::SharedMemoryLimits(), support_locking, | 1425 std::move(gpu_channel_host), gpu::SharedMemoryLimits(), support_locking, |
| 1426 ui::command_buffer_metrics::RENDERER_MAINTHREAD_CONTEXT, | 1426 ui::command_buffer_metrics::RENDERER_MAINTHREAD_CONTEXT, |
| 1427 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL); | 1427 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL); |
| 1428 if (!shared_main_thread_contexts_->BindToCurrentThread()) | 1428 if (!shared_main_thread_contexts_->BindToCurrentThread()) |
| 1429 shared_main_thread_contexts_ = nullptr; | 1429 shared_main_thread_contexts_ = nullptr; |
| 1430 return shared_main_thread_contexts_; | 1430 return shared_main_thread_contexts_; |
| 1431 } | 1431 } |
| 1432 | 1432 |
| 1433 #if defined(OS_ANDROID) | 1433 #if defined(OS_ANDROID) |
| 1434 | |
| 1435 scoped_refptr<StreamTextureFactory> RenderThreadImpl::GetStreamTexureFactory() { | 1434 scoped_refptr<StreamTextureFactory> RenderThreadImpl::GetStreamTexureFactory() { |
| 1436 DCHECK(IsMainThread()); | 1435 DCHECK(IsMainThread()); |
| 1437 if (!stream_texture_factory_.get() || | 1436 if (!stream_texture_factory_.get() || |
| 1438 stream_texture_factory_->ContextGL()->GetGraphicsResetStatusKHR() != | 1437 stream_texture_factory_->ContextGL()->GetGraphicsResetStatusKHR() != |
| 1439 GL_NO_ERROR) { | 1438 GL_NO_ERROR) { |
| 1440 scoped_refptr<ui::ContextProviderCommandBuffer> shared_context_provider = | 1439 scoped_refptr<ui::ContextProviderCommandBuffer> shared_context_provider = |
| 1441 SharedMainThreadContextProvider(); | 1440 SharedMainThreadContextProvider(); |
| 1442 if (!shared_context_provider) { | 1441 if (!shared_context_provider) { |
| 1443 stream_texture_factory_ = nullptr; | 1442 stream_texture_factory_ = nullptr; |
| 1444 return nullptr; | 1443 return nullptr; |
| (...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2437 } | 2436 } |
| 2438 } | 2437 } |
| 2439 | 2438 |
| 2440 void RenderThreadImpl::OnRendererInterfaceRequest( | 2439 void RenderThreadImpl::OnRendererInterfaceRequest( |
| 2441 mojom::RendererAssociatedRequest request) { | 2440 mojom::RendererAssociatedRequest request) { |
| 2442 DCHECK(!renderer_binding_.is_bound()); | 2441 DCHECK(!renderer_binding_.is_bound()); |
| 2443 renderer_binding_.Bind(std::move(request)); | 2442 renderer_binding_.Bind(std::move(request)); |
| 2444 } | 2443 } |
| 2445 | 2444 |
| 2446 } // namespace content | 2445 } // namespace content |
| OLD | NEW |