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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // command buffer to the GPU process. | 46 // command buffer to the GPU process. |
47 class CONTENT_EXPORT ContextProviderCommandBuffer | 47 class CONTENT_EXPORT ContextProviderCommandBuffer |
48 : NON_EXPORTED_BASE(public cc::ContextProvider) { | 48 : NON_EXPORTED_BASE(public cc::ContextProvider) { |
49 public: | 49 public: |
50 ContextProviderCommandBuffer( | 50 ContextProviderCommandBuffer( |
51 scoped_refptr<gpu::GpuChannelHost> channel, | 51 scoped_refptr<gpu::GpuChannelHost> channel, |
52 int32_t stream_id, | 52 int32_t stream_id, |
53 gpu::GpuStreamPriority stream_priority, | 53 gpu::GpuStreamPriority stream_priority, |
54 gpu::SurfaceHandle surface_handle, | 54 gpu::SurfaceHandle surface_handle, |
55 const GURL& active_url, | 55 const GURL& active_url, |
56 gfx::GpuPreference gpu_preference, | 56 gl::GpuPreference gpu_preference, |
57 bool automatic_flushes, | 57 bool automatic_flushes, |
58 bool support_locking, | 58 bool support_locking, |
59 const gpu::SharedMemoryLimits& memory_limits, | 59 const gpu::SharedMemoryLimits& memory_limits, |
60 const gpu::gles2::ContextCreationAttribHelper& attributes, | 60 const gpu::gles2::ContextCreationAttribHelper& attributes, |
61 ContextProviderCommandBuffer* shared_context_provider, | 61 ContextProviderCommandBuffer* shared_context_provider, |
62 command_buffer_metrics::ContextType type); | 62 command_buffer_metrics::ContextType type); |
63 | 63 |
64 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 64 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
65 | 65 |
66 // cc::ContextProvider implementation. | 66 // cc::ContextProvider implementation. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 base::ThreadChecker main_thread_checker_; | 102 base::ThreadChecker main_thread_checker_; |
103 base::ThreadChecker context_thread_checker_; | 103 base::ThreadChecker context_thread_checker_; |
104 | 104 |
105 bool bind_succeeded_ = false; | 105 bool bind_succeeded_ = false; |
106 bool bind_failed_ = false; | 106 bool bind_failed_ = false; |
107 | 107 |
108 const int32_t stream_id_; | 108 const int32_t stream_id_; |
109 const gpu::GpuStreamPriority stream_priority_; | 109 const gpu::GpuStreamPriority stream_priority_; |
110 const gpu::SurfaceHandle surface_handle_; | 110 const gpu::SurfaceHandle surface_handle_; |
111 const GURL active_url_; | 111 const GURL active_url_; |
112 const gfx::GpuPreference gpu_preference_; | 112 const gl::GpuPreference gpu_preference_; |
113 const bool automatic_flushes_; | 113 const bool automatic_flushes_; |
114 const bool support_locking_; | 114 const bool support_locking_; |
115 const gpu::SharedMemoryLimits memory_limits_; | 115 const gpu::SharedMemoryLimits memory_limits_; |
116 const gpu::gles2::ContextCreationAttribHelper attributes_; | 116 const gpu::gles2::ContextCreationAttribHelper attributes_; |
117 const command_buffer_metrics::ContextType context_type_; | 117 const command_buffer_metrics::ContextType context_type_; |
118 | 118 |
119 scoped_refptr<SharedProviders> shared_providers_; | 119 scoped_refptr<SharedProviders> shared_providers_; |
120 scoped_refptr<gpu::GpuChannelHost> channel_; | 120 scoped_refptr<gpu::GpuChannelHost> channel_; |
121 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; | 121 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
122 | 122 |
123 base::Lock context_lock_; // Referenced by command_buffer_. | 123 base::Lock context_lock_; // Referenced by command_buffer_. |
124 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 124 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
125 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 125 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
126 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 126 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
127 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; | 127 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; |
128 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; | 128 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
129 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 129 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
130 | 130 |
131 LostContextCallback lost_context_callback_; | 131 LostContextCallback lost_context_callback_; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace content | 134 } // namespace content |
135 | 135 |
136 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 136 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |