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

Unified Diff: cc/output/context_provider.h

Issue 1985973002: Defer compositor context creation to the thread. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextfactory: . Created 4 years, 7 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 | cc/output/gl_renderer_unittest.cc » ('j') | cc/test/test_context_provider.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/context_provider.h
diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h
index 2245b643e134b464d0db441cd4bd5dfae0ca2d2e..0ebb02eb13e0668fc59600525fce167512fcef12 100644
--- a/cc/output/context_provider.h
+++ b/cc/output/context_provider.h
@@ -57,13 +57,15 @@ class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> {
base::AutoLock context_lock_;
};
- // Bind the 3d context to the current thread. This should be called before
- // accessing the contexts. Calling it more than once should have no effect.
- // Once this function has been called, the class should only be accessed
- // from the same thread unless the function has some explicitly specified
- // rules for access on a different thread. See SetupLockOnMainThread(), which
- // can be used to provide access from multiple threads.
- virtual bool BindToCurrentThread() = 0;
+ // This Factory class allows deferred creation of a context provider (for eg.
+ // on another thread than the main thread).
+ class Factory {
+ public:
+ // Creates and returns a new context provider. The context provider may only
+ // be used on the thread it is created on unless it supports locking (via
+ // the ScopedContextLock class).
+ virtual scoped_refptr<ContextProvider> CreateContext() = 0;
+ };
virtual gpu::gles2::GLES2Interface* ContextGL() = 0;
virtual gpu::ContextSupport* ContextSupport() = 0;
« no previous file with comments | « no previous file | cc/output/gl_renderer_unittest.cc » ('j') | cc/test/test_context_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698