| 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 26 matching lines...) Expand all Loading... |
| 37 virtual gpu::ContextSupport* ContextSupport() = 0; | 37 virtual gpu::ContextSupport* ContextSupport() = 0; |
| 38 virtual class GrContext* GrContext() = 0; | 38 virtual class GrContext* GrContext() = 0; |
| 39 | 39 |
| 40 struct Capabilities { | 40 struct Capabilities { |
| 41 gpu::Capabilities gpu; | 41 gpu::Capabilities gpu; |
| 42 size_t max_transfer_buffer_usage_bytes; | 42 size_t max_transfer_buffer_usage_bytes; |
| 43 | 43 |
| 44 CC_EXPORT Capabilities(); | 44 CC_EXPORT Capabilities(); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Invalidates the cached OpenGL state in GrContext. |
| 48 // See skia GrContext::resetContext for details. |
| 49 virtual void InvalidateGrContext(uint32_t state) = 0; |
| 50 |
| 47 // 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. |
| 48 virtual void SetupLock() = 0; | 52 virtual void SetupLock() = 0; |
| 49 | 53 |
| 50 // 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 |
| 51 // threads. | 55 // threads. |
| 52 virtual base::Lock* GetLock() = 0; | 56 virtual base::Lock* GetLock() = 0; |
| 53 | 57 |
| 54 // Returns the capabilities of the currently bound 3d context. | 58 // Returns the capabilities of the currently bound 3d context. |
| 55 virtual Capabilities ContextCapabilities() = 0; | 59 virtual Capabilities ContextCapabilities() = 0; |
| 56 | 60 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 85 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; | 89 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
| 86 | 90 |
| 87 protected: | 91 protected: |
| 88 friend class base::RefCountedThreadSafe<ContextProvider>; | 92 friend class base::RefCountedThreadSafe<ContextProvider>; |
| 89 virtual ~ContextProvider() {} | 93 virtual ~ContextProvider() {} |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 } // namespace cc | 96 } // namespace cc |
| 93 | 97 |
| 94 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 98 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
| OLD | NEW |