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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 124063003: [NOT FOR COMMIT] Hacks to get hardware canvas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mass corruption on detach Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/android/in_process/synchronous_compositor_impl.h" 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "cc/input/input_handler.h" 10 #include "cc/input/input_handler.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext( 133 WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(
134 context.Pass(), attributes)); 134 context.Pass(), attributes));
135 } 135 }
136 136
137 virtual scoped_refptr<cc::ContextProvider> 137 virtual scoped_refptr<cc::ContextProvider>
138 GetOffscreenContextProviderForMainThread() OVERRIDE { 138 GetOffscreenContextProviderForMainThread() OVERRIDE {
139 // This check only guarantees the main thread context is created after 139 // This check only guarantees the main thread context is created after
140 // a compositor did successfully initialize hardware draw in the past. 140 // a compositor did successfully initialize hardware draw in the past.
141 // In particular this does not guarantee that the main thread context 141 // In particular this does not guarantee that the main thread context
142 // will fail creation when all compositors release hardware draw. 142 // will fail creation when all compositors release hardware draw.
143 bool failed = !CanCreateMainThreadContext(); 143 bool failed = false; // !CanCreateMainThreadContext();
144 if (!failed && 144 if (!failed &&
145 (!offscreen_context_for_main_thread_.get() || 145 (!offscreen_context_for_main_thread_.get() ||
146 offscreen_context_for_main_thread_->DestroyedOnMainThread())) { 146 offscreen_context_for_main_thread_->DestroyedOnMainThread())) {
147 offscreen_context_for_main_thread_ = 147 offscreen_context_for_main_thread_ =
148 webkit::gpu::ContextProviderInProcess::Create( 148 webkit::gpu::ContextProviderInProcess::Create(
149 CreateOffscreenContext(), 149 CreateOffscreenContext(),
150 "Compositor-Offscreen"); 150 "Compositor-Offscreen");
151 failed = !offscreen_context_for_main_thread_.get() || 151 failed = !offscreen_context_for_main_thread_.get() ||
152 !offscreen_context_for_main_thread_->BindToCurrentThread(); 152 !offscreen_context_for_main_thread_->BindToCurrentThread();
153 } 153 }
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 g_factory.Get(); // Ensure it's initialized. 485 g_factory.Get(); // Ensure it's initialized.
486 SynchronousCompositorImpl::CreateForWebContents(contents); 486 SynchronousCompositorImpl::CreateForWebContents(contents);
487 } 487 }
488 if (SynchronousCompositorImpl* instance = 488 if (SynchronousCompositorImpl* instance =
489 SynchronousCompositorImpl::FromWebContents(contents)) { 489 SynchronousCompositorImpl::FromWebContents(contents)) {
490 instance->SetClient(client); 490 instance->SetClient(client);
491 } 491 }
492 } 492 }
493 493
494 } // namespace content 494 } // namespace content
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | content/browser/android/in_process/synchronous_compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698