OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CC_OUTPUT_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_OUTPUT_CONTEXT_PROVIDER_H_ |
6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_ | 6 #define CC_OUTPUT_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Delete all cached gpu resources. | 87 // Delete all cached gpu resources. |
88 virtual void DeleteCachedResources() = 0; | 88 virtual void DeleteCachedResources() = 0; |
89 | 89 |
90 // Sets a callback to be called when the context is lost. This should be | 90 // Sets a callback to be called when the context is lost. This should be |
91 // called from the same thread that the context is bound to. To avoid races, | 91 // called from the same thread that the context is bound to. To avoid races, |
92 // it should be called before BindToCurrentThread(). | 92 // it should be called before BindToCurrentThread(). |
93 typedef base::Closure LostContextCallback; | 93 typedef base::Closure LostContextCallback; |
94 virtual void SetLostContextCallback( | 94 virtual void SetLostContextCallback( |
95 const LostContextCallback& lost_context_callback) = 0; | 95 const LostContextCallback& lost_context_callback) = 0; |
96 | 96 |
| 97 // Sets a callback to be called when the memory policy changes. This should be |
| 98 // called from the same thread that the context is bound to. |
| 99 typedef base::Callback<void(const ManagedMemoryPolicy& policy)> |
| 100 MemoryPolicyChangedCallback; |
| 101 virtual void SetMemoryPolicyChangedCallback( |
| 102 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
| 103 |
97 protected: | 104 protected: |
98 friend class base::RefCountedThreadSafe<ContextProvider>; | 105 friend class base::RefCountedThreadSafe<ContextProvider>; |
99 virtual ~ContextProvider() {} | 106 virtual ~ContextProvider() {} |
100 }; | 107 }; |
101 | 108 |
102 } // namespace cc | 109 } // namespace cc |
103 | 110 |
104 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 111 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
OLD | NEW |