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 "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const LostContextCallback& lost_context_callback) = 0; | 71 const LostContextCallback& lost_context_callback) = 0; |
72 | 72 |
73 // Sets a callback to be called when swap buffers completes. This should be | 73 // Sets a callback to be called when swap buffers completes. This should be |
74 // called from the same thread that the context is bound to. | 74 // called from the same thread that the context is bound to. |
75 typedef base::Closure SwapBuffersCompleteCallback; | 75 typedef base::Closure SwapBuffersCompleteCallback; |
76 virtual void SetSwapBuffersCompleteCallback( | 76 virtual void SetSwapBuffersCompleteCallback( |
77 const SwapBuffersCompleteCallback& swap_buffers_complete_callback) = 0; | 77 const SwapBuffersCompleteCallback& swap_buffers_complete_callback) = 0; |
78 | 78 |
79 // Sets a callback to be called when the memory policy changes. This should be | 79 // Sets a callback to be called when the memory policy changes. This should be |
80 // called from the same thread that the context is bound to. | 80 // called from the same thread that the context is bound to. |
81 typedef base::Callback<void( | 81 typedef base::Callback<void(const cc::ManagedMemoryPolicy& policy)> |
82 const cc::ManagedMemoryPolicy& policy, | 82 MemoryPolicyChangedCallback; |
83 bool discard_backbuffer_when_not_visible)> MemoryPolicyChangedCallback; | |
84 virtual void SetMemoryPolicyChangedCallback( | 83 virtual void SetMemoryPolicyChangedCallback( |
85 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; | 84 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
86 | 85 |
87 protected: | 86 protected: |
88 friend class base::RefCountedThreadSafe<ContextProvider>; | 87 friend class base::RefCountedThreadSafe<ContextProvider>; |
89 virtual ~ContextProvider() {} | 88 virtual ~ContextProvider() {} |
90 }; | 89 }; |
91 | 90 |
92 } // namespace cc | 91 } // namespace cc |
93 | 92 |
94 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 93 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
OLD | NEW |