Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: content/renderer/render_thread_impl.cc

Issue 251343002: Remove offscreen compositor contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 8122735227b8f1b7e02b6f2f6aeb2dc88e00969e..c15816bf6968c34e547dbb41090df6c83035c4de 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -564,11 +564,6 @@ void RenderThreadImpl::Shutdown() {
// Clean up plugin channels before this thread goes away.
NPChannelBase::CleanupChannels();
#endif
-
- // Leak shared contexts on other threads, as we can not get to the correct
- // thread to destroy them.
- if (offscreen_compositor_contexts_.get())
- offscreen_compositor_contexts_->set_leak_on_destroy();
piman 2014/04/24 00:14:00 nit: Is there anything calling set_leak_on_destroy
danakj 2014/04/24 15:01:32 Done.
}
bool RenderThreadImpl::Send(IPC::Message* msg) {
@@ -1022,28 +1017,6 @@ RenderThreadImpl::CreateOffscreenContext3d() {
NULL));
}
-scoped_refptr<cc::ContextProvider>
-RenderThreadImpl::OffscreenCompositorContextProvider() {
- DCHECK(IsMainThread());
-
-#if defined(OS_ANDROID)
- if (SynchronousCompositorFactory* factory =
- SynchronousCompositorFactory::GetInstance()) {
- if (compositor_message_loop_proxy_)
- return factory->GetOffscreenContextProviderForCompositorThread();
- return factory->GetSharedOffscreenContextProviderForMainThread();
- }
-#endif
-
- if (!offscreen_compositor_contexts_.get() ||
- offscreen_compositor_contexts_->DestroyedOnMainThread()) {
- offscreen_compositor_contexts_ = ContextProviderCommandBuffer::Create(
- CreateOffscreenContext3d(),
- "Compositor-Offscreen");
- }
- return offscreen_compositor_contexts_;
-}
-
scoped_refptr<webkit::gpu::ContextProviderWebContext>
RenderThreadImpl::SharedMainThreadContextProvider() {
DCHECK(IsMainThread());
@@ -1055,19 +1028,8 @@ RenderThreadImpl::SharedMainThreadContextProvider() {
if (!shared_main_thread_contexts_ ||
shared_main_thread_contexts_->DestroyedOnMainThread()) {
- if (compositor_message_loop_proxy_) {
- // In threaded compositing mode, we have to create a new ContextProvider
- // to bind to the main thread since the compositor's is bound to the
- // compositor thread.
- shared_main_thread_contexts_ =
- ContextProviderCommandBuffer::Create(CreateOffscreenContext3d(),
- "Offscreen-MainThread");
- } else {
- // In single threaded mode, we can use the same context provider.
- shared_main_thread_contexts_ =
- static_cast<ContextProviderCommandBuffer*>(
- OffscreenCompositorContextProvider().get());
- }
+ shared_main_thread_contexts_ = ContextProviderCommandBuffer::Create(
+ CreateOffscreenContext3d(), "Offscreen-MainThread");
}
if (shared_main_thread_contexts_ &&
!shared_main_thread_contexts_->BindToCurrentThread())

Powered by Google App Engine
This is Rietveld 408576698