| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 5 #ifndef BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 6 #define BLIMP_CLIENT_COMPOSITOR_BLIMP_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 16 matching lines...) Expand all Loading... |
| 27 void DetachFromThread() override; | 27 void DetachFromThread() override; |
| 28 Capabilities ContextCapabilities() override; | 28 Capabilities ContextCapabilities() override; |
| 29 gpu::gles2::GLES2Interface* ContextGL() override; | 29 gpu::gles2::GLES2Interface* ContextGL() override; |
| 30 gpu::ContextSupport* ContextSupport() override; | 30 gpu::ContextSupport* ContextSupport() override; |
| 31 class GrContext* GrContext() override; | 31 class GrContext* GrContext() override; |
| 32 void InvalidateGrContext(uint32_t state) override; | 32 void InvalidateGrContext(uint32_t state) override; |
| 33 void SetupLock() override; | 33 void SetupLock() override; |
| 34 base::Lock* GetLock() override; | 34 base::Lock* GetLock() override; |
| 35 void VerifyContexts() override; | 35 void VerifyContexts() override; |
| 36 void DeleteCachedResources() override; | 36 void DeleteCachedResources() override; |
| 37 bool DestroyedOnMainThread() override; | 37 bool HasBeenLostOnMainThread() override; |
| 38 void SetLostContextCallback( | 38 void SetLostContextCallback( |
| 39 const LostContextCallback& lost_context_callback) override; | 39 const LostContextCallback& lost_context_callback) override; |
| 40 void SetMemoryPolicyChangedCallback( | 40 void SetMemoryPolicyChangedCallback( |
| 41 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | 41 const MemoryPolicyChangedCallback& memory_policy_changed_callback) |
| 42 override; | 42 override; |
| 43 bool HasBeenDestroyed() override; |
| 43 | 44 |
| 44 protected: | 45 protected: |
| 45 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); | 46 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); |
| 46 ~BlimpContextProvider() override; | 47 ~BlimpContextProvider() override; |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 void OnLostContext(); | 50 void OnLostContext(); |
| 50 | 51 |
| 51 base::ThreadChecker main_thread_checker_; | 52 base::ThreadChecker main_thread_checker_; |
| 52 base::ThreadChecker context_thread_checker_; | 53 base::ThreadChecker context_thread_checker_; |
| 53 | 54 |
| 54 base::Lock context_lock_; | 55 base::Lock context_lock_; |
| 55 scoped_ptr<gpu::GLInProcessContext> context_; | 56 scoped_ptr<gpu::GLInProcessContext> context_; |
| 56 skia::RefPtr<class GrContext> gr_context_; | 57 skia::RefPtr<class GrContext> gr_context_; |
| 57 | 58 |
| 58 cc::ContextProvider::Capabilities capabilities_; | 59 cc::ContextProvider::Capabilities capabilities_; |
| 59 | 60 |
| 60 LostContextCallback lost_context_callback_; | 61 LostContextCallback lost_context_callback_; |
| 61 | 62 |
| 62 base::Lock destroyed_lock_; | 63 base::Lock lost_lock_; |
| 63 bool destroyed_; | 64 bool lost_; |
| 64 | 65 |
| 65 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 66 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace blimp | 69 } // namespace blimp |
| 69 | 70 |
| 70 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 71 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
| OLD | NEW |