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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Sets up a lock so this context can be used from multiple threads. | 51 // Sets up a lock so this context can be used from multiple threads. |
52 virtual void SetupLock() = 0; | 52 virtual void SetupLock() = 0; |
53 | 53 |
54 // Returns the lock that should be held if using this context from multiple | 54 // Returns the lock that should be held if using this context from multiple |
55 // threads. | 55 // threads. |
56 virtual base::Lock* GetLock() = 0; | 56 virtual base::Lock* GetLock() = 0; |
57 | 57 |
58 // Returns the capabilities of the currently bound 3d context. | 58 // Returns the capabilities of the currently bound 3d context. |
59 virtual Capabilities ContextCapabilities() = 0; | 59 virtual Capabilities ContextCapabilities() = 0; |
60 | 60 |
61 // Checks if the context is currently known to be lost. | |
62 virtual bool IsContextLost() = 0; | |
63 | |
64 // Ask the provider to check if the contexts are valid or lost. If they are, | 61 // Ask the provider to check if the contexts are valid or lost. If they are, |
65 // this should invalidate the provider so that it can be replaced with a new | 62 // this should invalidate the provider so that it can be replaced with a new |
66 // one. | 63 // one. |
67 virtual void VerifyContexts() = 0; | 64 virtual void VerifyContexts() = 0; |
68 | 65 |
69 // Delete all cached gpu resources. | 66 // Delete all cached gpu resources. |
70 virtual void DeleteCachedResources() = 0; | 67 virtual void DeleteCachedResources() = 0; |
71 | 68 |
72 // A method to be called from the main thread that should return true if | 69 // A method to be called from the main thread that should return true if |
73 // the context inside the provider is no longer valid. | 70 // the context inside the provider is no longer valid. |
(...skipping 15 matching lines...) Expand all Loading... |
89 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; | 86 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
90 | 87 |
91 protected: | 88 protected: |
92 friend class base::RefCountedThreadSafe<ContextProvider>; | 89 friend class base::RefCountedThreadSafe<ContextProvider>; |
93 virtual ~ContextProvider() {} | 90 virtual ~ContextProvider() {} |
94 }; | 91 }; |
95 | 92 |
96 } // namespace cc | 93 } // namespace cc |
97 | 94 |
98 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 95 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
OLD | NEW |