| 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" | |
| 11 #include "gpu/command_buffer/common/capabilities.h" | 10 #include "gpu/command_buffer/common/capabilities.h" |
| 12 | 11 |
| 13 class GrContext; | 12 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; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 34 virtual void DetachFromThread() {} | 33 virtual void DetachFromThread() {} |
| 35 | 34 |
| 36 virtual gpu::gles2::GLES2Interface* ContextGL() = 0; | 35 virtual gpu::gles2::GLES2Interface* ContextGL() = 0; |
| 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 Capabilities(); |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 // Sets up a lock so this context can be used from multiple threads. | 46 // Sets up a lock so this context can be used from multiple threads. |
| 48 virtual void SetupLock() = 0; | 47 virtual void SetupLock() = 0; |
| 49 | 48 |
| 50 // Returns the lock that should be held if using this context from multiple | 49 // Returns the lock that should be held if using this context from multiple |
| 51 // threads. | 50 // threads. |
| 52 virtual base::Lock* GetLock() = 0; | 51 virtual base::Lock* GetLock() = 0; |
| 53 | 52 |
| 54 // Returns the capabilities of the currently bound 3d context. | 53 // Returns the capabilities of the currently bound 3d context. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 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 |