Chromium Code Reviews| Index: cc/output/context_provider.h |
| diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h |
| index 2245b643e134b464d0db441cd4bd5dfae0ca2d2e..dadda38e4f5247a8c1c52a8adc5b67c0553c6716 100644 |
| --- a/cc/output/context_provider.h |
| +++ b/cc/output/context_provider.h |
| @@ -57,13 +57,21 @@ 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 API is how to create a context provider in a deferred way (ie. |
| + // on another thread than the main thread). |
| + class DeferredCreate { |
|
piman
2016/05/17 03:41:40
naming-wise, how about Factory? It's shorter, and
danakj
2016/05/17 19:53:32
Ya it does. I was like ContextProvider::Factory is
|
| + 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; |
| + |
| + protected: |
| + DeferredCreate() {} |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(DeferredCreate); |
| + }; |
| virtual gpu::gles2::GLES2Interface* ContextGL() = 0; |
| virtual gpu::ContextSupport* ContextSupport() = 0; |