| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 5 #ifndef COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 6 #define COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 explicit ContextProvider(mojo::ScopedMessagePipeHandle command_buffer_handle); | 21 explicit ContextProvider(mojo::ScopedMessagePipeHandle command_buffer_handle); |
| 22 | 22 |
| 23 // cc::ContextProvider implementation. | 23 // cc::ContextProvider implementation. |
| 24 bool BindToCurrentThread() override; | 24 bool BindToCurrentThread() override; |
| 25 gpu::gles2::GLES2Interface* ContextGL() override; | 25 gpu::gles2::GLES2Interface* ContextGL() override; |
| 26 gpu::ContextSupport* ContextSupport() override; | 26 gpu::ContextSupport* ContextSupport() override; |
| 27 class GrContext* GrContext() override; | 27 class GrContext* GrContext() override; |
| 28 void InvalidateGrContext(uint32_t state) override; | 28 void InvalidateGrContext(uint32_t state) override; |
| 29 void SetupLock() override; | 29 void SetupLock() override; |
| 30 base::Lock* GetLock() override; | 30 base::Lock* GetLock() override; |
| 31 Capabilities ContextCapabilities() override; | 31 gpu::Capabilities ContextCapabilities() override; |
| 32 void DeleteCachedResources() override {} | 32 void DeleteCachedResources() override {} |
| 33 void SetLostContextCallback( | 33 void SetLostContextCallback( |
| 34 const LostContextCallback& lost_context_callback) override {} | 34 const LostContextCallback& lost_context_callback) override {} |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 friend class base::RefCountedThreadSafe<ContextProvider>; | 37 friend class base::RefCountedThreadSafe<ContextProvider>; |
| 38 ~ContextProvider() override; | 38 ~ContextProvider() override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 static void ContextLostThunk(void* closure) { | 41 static void ContextLostThunk(void* closure) { |
| 42 static_cast<ContextProvider*>(closure)->ContextLost(); | 42 static_cast<ContextProvider*>(closure)->ContextLost(); |
| 43 } | 43 } |
| 44 void ContextLost(); | 44 void ContextLost(); |
| 45 | 45 |
| 46 cc::ContextProvider::Capabilities capabilities_; | |
| 47 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 46 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
| 48 MojoGLES2Context context_; | 47 MojoGLES2Context context_; |
| 49 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; | 48 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; |
| 50 | 49 |
| 51 base::Lock context_lock_; | 50 base::Lock context_lock_; |
| 52 | 51 |
| 53 DISALLOW_COPY_AND_ASSIGN(ContextProvider); | 52 DISALLOW_COPY_AND_ASSIGN(ContextProvider); |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 } // namespace mus | 55 } // namespace mus |
| 57 | 56 |
| 58 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 57 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |