| 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 |
| 13 class GrContext; | 13 class GrContext; |
| 14 | 14 |
| 15 namespace blink { class WebGraphicsContext3D; } | |
| 16 namespace gpu { | 15 namespace gpu { |
| 17 class ContextSupport; | 16 class ContextSupport; |
| 18 namespace gles2 { class GLES2Interface; } | 17 namespace gles2 { class GLES2Interface; } |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace cc { | 20 namespace cc { |
| 22 struct ManagedMemoryPolicy; | 21 struct ManagedMemoryPolicy; |
| 23 | 22 |
| 24 class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> { | 23 class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> { |
| 25 public: | 24 public: |
| 26 // Bind the 3d context to the current thread. This should be called before | 25 // Bind the 3d context to the current thread. This should be called before |
| 27 // accessing the contexts. Calling it more than once should have no effect. | 26 // accessing the contexts. Calling it more than once should have no effect. |
| 28 // Once this function has been called, the class should only be accessed | 27 // Once this function has been called, the class should only be accessed |
| 29 // from the same thread. | 28 // from the same thread. |
| 30 virtual bool BindToCurrentThread() = 0; | 29 virtual bool BindToCurrentThread() = 0; |
| 31 | 30 |
| 32 virtual blink::WebGraphicsContext3D* Context3d() = 0; | |
| 33 virtual gpu::gles2::GLES2Interface* ContextGL() = 0; | 31 virtual gpu::gles2::GLES2Interface* ContextGL() = 0; |
| 34 virtual gpu::ContextSupport* ContextSupport() = 0; | 32 virtual gpu::ContextSupport* ContextSupport() = 0; |
| 35 virtual class GrContext* GrContext() = 0; | 33 virtual class GrContext* GrContext() = 0; |
| 36 virtual void MakeGrContextCurrent() = 0; | 34 virtual void MakeGrContextCurrent() = 0; |
| 37 | 35 |
| 38 struct Capabilities { | 36 struct Capabilities { |
| 39 bool egl_image_external : 1; | 37 bool egl_image_external : 1; |
| 40 bool fast_npot_mo8_textures : 1; | 38 bool fast_npot_mo8_textures : 1; |
| 41 bool iosurface : 1; | 39 bool iosurface : 1; |
| 42 bool map_image : 1; | 40 bool map_image : 1; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; | 84 const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0; |
| 87 | 85 |
| 88 protected: | 86 protected: |
| 89 friend class base::RefCountedThreadSafe<ContextProvider>; | 87 friend class base::RefCountedThreadSafe<ContextProvider>; |
| 90 virtual ~ContextProvider() {} | 88 virtual ~ContextProvider() {} |
| 91 }; | 89 }; |
| 92 | 90 |
| 93 } // namespace cc | 91 } // namespace cc |
| 94 | 92 |
| 95 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ | 93 #endif // CC_OUTPUT_CONTEXT_PROVIDER_H_ |
| OLD | NEW |