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_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_CONTEXT_PROVIDER_H_ |
6 #define CC_CONTEXT_PROVIDER_H_ | 6 #define CC_CONTEXT_PROVIDER_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 | 9 |
10 class GrContext; | 10 class GrContext; |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual bool BindToCurrentThread() = 0; | 25 virtual bool BindToCurrentThread() = 0; |
26 | 26 |
27 virtual WebKit::WebGraphicsContext3D* Context3d() = 0; | 27 virtual WebKit::WebGraphicsContext3D* Context3d() = 0; |
28 virtual class GrContext* GrContext() = 0; | 28 virtual class GrContext* GrContext() = 0; |
29 | 29 |
30 // Ask the provider to check if the contexts are valid or lost. If they are, | 30 // Ask the provider to check if the contexts are valid or lost. If they are, |
31 // this should invalidate the provider so that it can be replaced with a new | 31 // this should invalidate the provider so that it can be replaced with a new |
32 // one. | 32 // one. |
33 virtual void VerifyContexts() = 0; | 33 virtual void VerifyContexts() = 0; |
34 | 34 |
| 35 // A method to be called from the main thread that should return true if |
| 36 // the context inside the provider is no longer valid. |
| 37 virtual bool DestroyedOnMainThread() = 0; |
| 38 |
35 protected: | 39 protected: |
36 friend class base::RefCountedThreadSafe<ContextProvider>; | 40 friend class base::RefCountedThreadSafe<ContextProvider>; |
37 virtual ~ContextProvider() {} | 41 virtual ~ContextProvider() {} |
38 }; | 42 }; |
39 | 43 |
40 } // namespace cc | 44 } // namespace cc |
41 | 45 |
42 #endif // CC_CONTEXT_PROVIDER_H_ | 46 #endif // CC_CONTEXT_PROVIDER_H_ |
OLD | NEW |