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