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 19 matching lines...) Expand all Loading... |
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 DestroyedOnMainThread() override; |
38 void SetLostContextCallback( | 38 void SetLostContextCallback( |
39 const LostContextCallback& lost_context_callback) override; | 39 const LostContextCallback& lost_context_callback) override; |
40 void SetMemoryPolicyChangedCallback( | |
41 const MemoryPolicyChangedCallback& memory_policy_changed_callback) | |
42 override; | |
43 | 40 |
44 protected: | 41 protected: |
45 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); | 42 explicit BlimpContextProvider(gfx::AcceleratedWidget widget); |
46 ~BlimpContextProvider() override; | 43 ~BlimpContextProvider() override; |
47 | 44 |
48 private: | 45 private: |
49 void OnLostContext(); | 46 void OnLostContext(); |
50 | 47 |
51 base::ThreadChecker main_thread_checker_; | 48 base::ThreadChecker main_thread_checker_; |
52 base::ThreadChecker context_thread_checker_; | 49 base::ThreadChecker context_thread_checker_; |
53 | 50 |
54 base::Lock context_lock_; | 51 base::Lock context_lock_; |
55 scoped_ptr<gpu::GLInProcessContext> context_; | 52 scoped_ptr<gpu::GLInProcessContext> context_; |
56 skia::RefPtr<class GrContext> gr_context_; | 53 skia::RefPtr<class GrContext> gr_context_; |
57 | 54 |
58 cc::ContextProvider::Capabilities capabilities_; | 55 cc::ContextProvider::Capabilities capabilities_; |
59 | 56 |
60 LostContextCallback lost_context_callback_; | 57 LostContextCallback lost_context_callback_; |
61 | 58 |
62 base::Lock destroyed_lock_; | 59 base::Lock destroyed_lock_; |
63 bool destroyed_; | 60 bool destroyed_; |
64 | 61 |
65 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); | 62 DISALLOW_COPY_AND_ASSIGN(BlimpContextProvider); |
66 }; | 63 }; |
67 | 64 |
68 } // namespace blimp | 65 } // namespace blimp |
69 | 66 |
70 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ | 67 #endif // BLIMP_CLIENT_COMPOSITOR_BLIMP_CONTEXT_PROVIDER_H_ |
OLD | NEW |