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

Unified Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 22766004: Fullscreen video in Android WebView (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address nits Created 7 years, 4 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
« no previous file with comments | « no previous file | content/content_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/in_process/synchronous_compositor_impl.cc
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc
index 041511ea0bb65fb22f4d2e5d4a0a7205e0a0d57d..74048d86c84ed5ac477cfc8432c5f0e56d7bf02c 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -66,10 +66,16 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
}
virtual scoped_refptr<cc::ContextProvider>
- GetOffscreenContextProviderForMainThread() OVERRIDE {
- NOTIMPLEMENTED()
- << "Synchronous compositor does not support main thread context yet.";
- return scoped_refptr<cc::ContextProvider>();
+ GetOffscreenContextProviderForMainThread() OVERRIDE {
+ if (!offscreen_context_for_main_thread_.get() ||
+ offscreen_context_for_main_thread_->DestroyedOnMainThread()) {
+ offscreen_context_for_main_thread_ =
+ webkit::gpu::ContextProviderInProcess::Create();
+ if (offscreen_context_for_main_thread_.get() &&
+ !offscreen_context_for_main_thread_->BindToCurrentThread())
+ offscreen_context_for_main_thread_ = NULL;
+ }
+ return offscreen_context_for_main_thread_;
}
// This is called on both renderer main thread (offscreen context creation
@@ -95,6 +101,7 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
// Only guards construction of |offscreen_context_for_compositor_thread_|,
// not usage.
base::Lock offscreen_context_for_compositor_thread_creation_lock_;
+ scoped_refptr<cc::ContextProvider> offscreen_context_for_main_thread_;
scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_;
};
« no previous file with comments | « no previous file | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698