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" |
11 #include "gpu/command_buffer/common/capabilities.h" | 11 #include "gpu/command_buffer/common/capabilities.h" |
12 | 12 #include "third_party/skia/include/gpu/GrContext.h" |
13 class GrContext; | |
14 | 13 |
15 namespace base { | 14 namespace base { |
16 class Lock; | 15 class Lock; |
17 } | 16 } |
18 | 17 |
19 namespace gpu { | 18 namespace gpu { |
20 class ContextSupport; | 19 class ContextSupport; |
21 namespace gles2 { class GLES2Interface; } | 20 namespace gles2 { class GLES2Interface; } |
22 } | 21 } |
23 | 22 |
(...skipping 13 matching lines...) Expand all Loading... | |
37 virtual gpu::ContextSupport* ContextSupport() = 0; | 36 virtual gpu::ContextSupport* ContextSupport() = 0; |
38 virtual class GrContext* GrContext() = 0; | 37 virtual class GrContext* GrContext() = 0; |
39 | 38 |
40 struct Capabilities { | 39 struct Capabilities { |
41 gpu::Capabilities gpu; | 40 gpu::Capabilities gpu; |
42 size_t max_transfer_buffer_usage_bytes; | 41 size_t max_transfer_buffer_usage_bytes; |
43 | 42 |
44 CC_EXPORT Capabilities(); | 43 CC_EXPORT Capabilities(); |
45 }; | 44 }; |
46 | 45 |
46 // invalidate the cached OGL state in GrContext | |
piman
2015/05/06 22:03:40
nit: "Invalidates" (uppercase, descriptive rather
CodeByThePound
2015/05/06 22:27:55
Acknowledged.
| |
47 void InvalidateGrContext(uint32_t state = kAll_GrBackendState); | |
piman
2015/05/06 22:03:40
nit: no default arguments, per style guide
CodeByThePound
2015/05/06 22:27:55
Acknowledged.
| |
48 | |
47 // Sets up a lock so this context can be used from multiple threads. | 49 // Sets up a lock so this context can be used from multiple threads. |
48 virtual void SetupLock() = 0; | 50 virtual void SetupLock() = 0; |
49 | 51 |
50 // Returns the lock that should be held if using this context from multiple | 52 // Returns the lock that should be held if using this context from multiple |
51 // threads. | 53 // threads. |
52 virtual base::Lock* GetLock() = 0; | 54 virtual base::Lock* GetLock() = 0; |
53 | 55 |
54 // Returns the capabilities of the currently bound 3d context. | 56 // Returns the capabilities of the currently bound 3d context. |
55 virtual Capabilities ContextCapabilities() = 0; | 57 virtual Capabilities ContextCapabilities() = 0; |
56 | 58 |
(...skipping 23 matching lines...) Expand all Loading... | |
80 // Sets a callback to be called when the memory policy changes. This should be | 82 // Sets a callback to be called when the memory policy changes. This should be |
81 // called from the same thread that the context is bound to. | 83 // called from the same thread that the context is bound to. |
82 typedef base::Callback<void(const ManagedMemoryPolicy& policy)> | 84 typedef base::Callback<void(const ManagedMemoryPolicy& policy)> |
83 MemoryPolicyChangedCallback; | 85 MemoryPolicyChangedCallback; |
84 virtual void SetMemoryPolicyChangedCallback( | 86 virtual void SetMemoryPolicyChangedCallback( |
85 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; | 87 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
86 | 88 |
87 protected: | 89 protected: |
88 friend class base::RefCountedThreadSafe<ContextProvider>; | 90 friend class base::RefCountedThreadSafe<ContextProvider>; |
89 virtual ~ContextProvider() {} | 91 virtual ~ContextProvider() {} |
92 | |
93 private: | |
94 virtual void DoInvalidateGrContext(uint32_t) = 0; | |
90 }; | 95 }; |
91 | 96 |
92 } // namespace cc | 97 } // namespace cc |
93 | 98 |
94 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 99 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
OLD | NEW |