| 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 MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 5 #ifndef MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
| 6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 6 #define MOJO_CC_CONTEXT_PROVIDER_MOJO_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 11 matching lines...) Expand all Loading... |
| 22 bool BindToCurrentThread() override; | 22 bool BindToCurrentThread() override; |
| 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 VerifyContexts() override {} | 30 void VerifyContexts() override {} |
| 31 void DeleteCachedResources() override {} | 31 void DeleteCachedResources() override {} |
| 32 bool DestroyedOnMainThread() override; | 32 bool HasBeenLostOnMainThread() override; |
| 33 void SetLostContextCallback( | 33 void SetLostContextCallback( |
| 34 const LostContextCallback& lost_context_callback) override {} | 34 const LostContextCallback& lost_context_callback) override {} |
| 35 void SetMemoryPolicyChangedCallback( | 35 void SetMemoryPolicyChangedCallback( |
| 36 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 36 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
| 37 override {} | 37 override {} |
| 38 bool HasBeenDestroyed() override; |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 friend class base::RefCountedThreadSafe<ContextProviderMojo>; | 41 friend class base::RefCountedThreadSafe<ContextProviderMojo>; |
| 41 ~ContextProviderMojo() override; | 42 ~ContextProviderMojo() override; |
| 42 | 43 |
| 43 private: | 44 private: |
| 44 static void ContextLostThunk(void* closure) { | 45 static void ContextLostThunk(void* closure) { |
| 45 static_cast<ContextProviderMojo*>(closure)->ContextLost(); | 46 static_cast<ContextProviderMojo*>(closure)->ContextLost(); |
| 46 } | 47 } |
| 47 void ContextLost(); | 48 void ContextLost(); |
| 48 | 49 |
| 49 cc::ContextProvider::Capabilities capabilities_; | 50 cc::ContextProvider::Capabilities capabilities_; |
| 50 ScopedMessagePipeHandle command_buffer_handle_; | 51 ScopedMessagePipeHandle command_buffer_handle_; |
| 51 MojoGLES2Context context_; | 52 MojoGLES2Context context_; |
| 52 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; | 53 scoped_ptr<gpu::gles2::GLES2Interface> context_gl_; |
| 53 | 54 |
| 54 base::Lock context_lock_; | 55 base::Lock context_lock_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); | 57 DISALLOW_COPY_AND_ASSIGN(ContextProviderMojo); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace mojo | 60 } // namespace mojo |
| 60 | 61 |
| 61 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ | 62 #endif // MOJO_CC_CONTEXT_PROVIDER_MOJO_H_ |
| OLD | NEW |