| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 gpu::gles2::GLES2Interface* ContextGL() override; | 23 gpu::gles2::GLES2Interface* ContextGL() override; |
| 24 gpu::ContextSupport* ContextSupport() override; | 24 gpu::ContextSupport* ContextSupport() override; |
| 25 class GrContext* GrContext() override; | 25 class GrContext* GrContext() override; |
| 26 void InvalidateGrContext(uint32_t state) override; | 26 void InvalidateGrContext(uint32_t state) override; |
| 27 void SetupLock() override; | 27 void SetupLock() override; |
| 28 base::Lock* GetLock() override; | 28 base::Lock* GetLock() override; |
| 29 Capabilities ContextCapabilities() override; | 29 Capabilities ContextCapabilities() override; |
| 30 void DeleteCachedResources() override {} | 30 void DeleteCachedResources() override {} |
| 31 void SetLostContextCallback( | 31 void SetLostContextCallback( |
| 32 const LostContextCallback& lost_context_callback) override {} | 32 const LostContextCallback& lost_context_callback) override {} |
| 33 void SetMemoryPolicyChangedCallback( |
| 34 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
| 35 override {} |
| 33 | 36 |
| 34 protected: | 37 protected: |
| 35 friend class base::RefCountedThreadSafe<ContextProvider>; | 38 friend class base::RefCountedThreadSafe<ContextProvider>; |
| 36 ~ContextProvider() override; | 39 ~ContextProvider() override; |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 static void ContextLostThunk(void* closure) { | 42 static void ContextLostThunk(void* closure) { |
| 40 static_cast<ContextProvider*>(closure)->ContextLost(); | 43 static_cast<ContextProvider*>(closure)->ContextLost(); |
| 41 } | 44 } |
| 42 void ContextLost(); | 45 void ContextLost(); |
| 43 | 46 |
| 44 cc::ContextProvider::Capabilities capabilities_; | 47 cc::ContextProvider::Capabilities capabilities_; |
| 45 mojo::ScopedMessagePipeHandle command_buffer_handle_; | 48 mojo::ScopedMessagePipeHandle command_buffer_handle_; |
| 46 MojoGLES2Context context_; | 49 MojoGLES2Context context_; |
| 47 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; | 50 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; |
| 48 | 51 |
| 49 base::Lock context_lock_; | 52 base::Lock context_lock_; |
| 50 | 53 |
| 51 DISALLOW_COPY_AND_ASSIGN(ContextProvider); | 54 DISALLOW_COPY_AND_ASSIGN(ContextProvider); |
| 52 }; | 55 }; |
| 53 | 56 |
| 54 } // namespace mus | 57 } // namespace mus |
| 55 | 58 |
| 56 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ | 59 #endif // COMPONENTS_MUS_PUBLIC_CPP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |