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

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

Issue 16235005: Add ContextProvider overrides to SynchronousCompositorFactory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/renderer/android/synchronous_compositor_factory.h » ('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 ea72bc79bc179123c272a454bf0dfe2524c4ed52..7a53cd057cf3c0b48d9f148cbe1daa3112c58979 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -12,6 +12,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/renderer/android/synchronous_compositor_factory.h"
+#include "webkit/common/gpu/context_provider_in_process.h"
namespace content {
@@ -59,8 +60,26 @@ class SynchronousCompositorFactoryImpl : public SynchronousCompositorFactory {
return &synchronous_input_event_filter_;
}
+ virtual scoped_refptr<cc::ContextProvider>
+ GetOffscreenContextProviderForMainThread() OVERRIDE {
+ NOTIMPLEMENTED()
+ << "Synchronous compositor does not support main thread context yet.";
+ return scoped_refptr<cc::ContextProvider>();
+ }
+
+ virtual scoped_refptr<cc::ContextProvider>
+ GetOffscreenContextProviderForCompositorThread() OVERRIDE {
+ if (!offscreen_context_for_compositor_thread_ ||
+ offscreen_context_for_compositor_thread_->DestroyedOnMainThread()) {
+ offscreen_context_for_compositor_thread_ =
+ webkit::gpu::ContextProviderInProcess::Create();
+ }
+ return offscreen_context_for_compositor_thread_;
+ }
+
private:
SynchronousInputEventFilter synchronous_input_event_filter_;
+ scoped_refptr<cc::ContextProvider> offscreen_context_for_compositor_thread_;
};
base::LazyInstance<SynchronousCompositorFactoryImpl>::Leaky g_factory =
« no previous file with comments | « no previous file | content/renderer/android/synchronous_compositor_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698