Chromium Code Reviews| Index: cc/output/context_provider.h |
| diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h |
| index 44c69412d3ba901268b3a60c96203e2c5755a0e7..c993a1172d7264bdc32dcb85bad0784e67705dec 100644 |
| --- a/cc/output/context_provider.h |
| +++ b/cc/output/context_provider.h |
| @@ -50,6 +50,19 @@ class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> { |
| std::unique_ptr<ContextCacheController::ScopedBusy> busy_; |
| }; |
| + class CC_EXPORT ScopedContext { |
|
danakj
2017/05/01 22:57:33
I don't think this class is doing more than if you
sohan
2017/05/03 11:06:35
Done.
|
| + public: |
| + explicit ScopedContext(ContextProvider* context_provider); |
| + ~ScopedContext(); |
| + |
| + gpu::gles2::GLES2Interface* ContextGL() { |
| + return context_provider_->ContextGL(); |
| + } |
| + |
| + private: |
| + ContextProvider* const context_provider_; |
| + std::unique_ptr<ContextCacheController::ScopedBusy> busy_; |
| + }; |
| // 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 |