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 CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 22 matching lines...) Expand all Loading... |
33 namespace content { | 33 namespace content { |
34 | 34 |
35 // Implementation of cc::ContextProvider that provides a | 35 // Implementation of cc::ContextProvider that provides a |
36 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. | 36 // WebGraphicsContext3DCommandBufferImpl context and a GrContext. |
37 class CONTENT_EXPORT ContextProviderCommandBuffer | 37 class CONTENT_EXPORT ContextProviderCommandBuffer |
38 : NON_EXPORTED_BASE(public cc::ContextProvider) { | 38 : NON_EXPORTED_BASE(public cc::ContextProvider) { |
39 public: | 39 public: |
40 ContextProviderCommandBuffer( | 40 ContextProviderCommandBuffer( |
41 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, | 41 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d, |
42 const gpu::SharedMemoryLimits& memory_limits, | 42 const gpu::SharedMemoryLimits& memory_limits, |
| 43 const gpu::gles2::ContextCreationAttribHelper& attributes, |
43 ContextProviderCommandBuffer* shared_context_provider, | 44 ContextProviderCommandBuffer* shared_context_provider, |
44 CommandBufferContextType type); | 45 command_buffer_metrics::ContextType type); |
45 | 46 |
46 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 47 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
47 | 48 |
48 // cc::ContextProvider implementation. | 49 // cc::ContextProvider implementation. |
49 bool BindToCurrentThread() override; | 50 bool BindToCurrentThread() override; |
50 void DetachFromThread() override; | 51 void DetachFromThread() override; |
51 gpu::gles2::GLES2Interface* ContextGL() override; | 52 gpu::gles2::GLES2Interface* ContextGL() override; |
52 gpu::ContextSupport* ContextSupport() override; | 53 gpu::ContextSupport* ContextSupport() override; |
53 class GrContext* GrContext() override; | 54 class GrContext* GrContext() override; |
54 void InvalidateGrContext(uint32_t state) override; | 55 void InvalidateGrContext(uint32_t state) override; |
(...skipping 24 matching lines...) Expand all Loading... |
79 base::ThreadChecker main_thread_checker_; | 80 base::ThreadChecker main_thread_checker_; |
80 base::ThreadChecker context_thread_checker_; | 81 base::ThreadChecker context_thread_checker_; |
81 | 82 |
82 scoped_refptr<SharedProviders> shared_providers_; | 83 scoped_refptr<SharedProviders> shared_providers_; |
83 | 84 |
84 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; | 85 std::unique_ptr<WebGraphicsContext3DCommandBufferImpl> context3d_; |
85 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; | 86 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
86 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 87 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
87 | 88 |
88 gpu::SharedMemoryLimits memory_limits_; | 89 gpu::SharedMemoryLimits memory_limits_; |
89 CommandBufferContextType context_type_; | 90 gpu::gles2::ContextCreationAttribHelper attributes_; |
90 std::string debug_name_; | 91 command_buffer_metrics::ContextType context_type_; |
91 | 92 |
92 LostContextCallback lost_context_callback_; | 93 LostContextCallback lost_context_callback_; |
93 | 94 |
94 base::Lock context_lock_; | 95 base::Lock context_lock_; |
95 | 96 |
96 class LostContextCallbackProxy; | 97 class LostContextCallbackProxy; |
97 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; | 98 std::unique_ptr<LostContextCallbackProxy> lost_context_callback_proxy_; |
98 }; | 99 }; |
99 | 100 |
100 } // namespace content | 101 } // namespace content |
101 | 102 |
102 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 103 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |