| 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 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 NULL)); | 1476 NULL)); |
| 1477 } | 1477 } |
| 1478 | 1478 |
| 1479 scoped_refptr<cc_blink::ContextProviderWebContext> | 1479 scoped_refptr<cc_blink::ContextProviderWebContext> |
| 1480 RenderThreadImpl::SharedMainThreadContextProvider() { | 1480 RenderThreadImpl::SharedMainThreadContextProvider() { |
| 1481 DCHECK(IsMainThread()); | 1481 DCHECK(IsMainThread()); |
| 1482 if (!shared_main_thread_contexts_.get() || | 1482 if (!shared_main_thread_contexts_.get() || |
| 1483 shared_main_thread_contexts_->DestroyedOnMainThread()) { | 1483 shared_main_thread_contexts_->DestroyedOnMainThread()) { |
| 1484 shared_main_thread_contexts_ = NULL; | 1484 shared_main_thread_contexts_ = NULL; |
| 1485 #if defined(OS_ANDROID) | 1485 #if defined(OS_ANDROID) |
| 1486 if (SynchronousCompositorFactory* factory = | 1486 SynchronousCompositorFactory* factory = |
| 1487 SynchronousCompositorFactory::GetInstance()) { | 1487 SynchronousCompositorFactory::GetInstance(); |
| 1488 if (factory && factory->OverrideWithFactory()) { |
| 1488 shared_main_thread_contexts_ = factory->CreateOffscreenContextProvider( | 1489 shared_main_thread_contexts_ = factory->CreateOffscreenContextProvider( |
| 1489 GetOffscreenAttribs(), "Offscreen-MainThread"); | 1490 GetOffscreenAttribs(), "Offscreen-MainThread"); |
| 1490 } | 1491 } |
| 1491 #endif | 1492 #endif |
| 1492 if (!shared_main_thread_contexts_.get()) { | 1493 if (!shared_main_thread_contexts_.get()) { |
| 1493 shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( | 1494 shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create( |
| 1494 CreateOffscreenContext3d(), RENDERER_MAINTHREAD_CONTEXT); | 1495 CreateOffscreenContext3d(), RENDERER_MAINTHREAD_CONTEXT); |
| 1495 } | 1496 } |
| 1496 if (shared_main_thread_contexts_.get() && | 1497 if (shared_main_thread_contexts_.get() && |
| 1497 !shared_main_thread_contexts_->BindToCurrentThread()) | 1498 !shared_main_thread_contexts_->BindToCurrentThread()) |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2036 } | 2037 } |
| 2037 | 2038 |
| 2038 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 2039 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 2039 size_t erased = | 2040 size_t erased = |
| 2040 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 2041 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 2041 routing_id_); | 2042 routing_id_); |
| 2042 DCHECK_EQ(1u, erased); | 2043 DCHECK_EQ(1u, erased); |
| 2043 } | 2044 } |
| 2044 | 2045 |
| 2045 } // namespace content | 2046 } // namespace content |
| OLD | NEW |