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 gl::GpuPreference gpu_preference, |
56 bool automatic_flushes, | 57 bool automatic_flushes, |
57 bool support_locking, | 58 bool support_locking, |
58 const gpu::SharedMemoryLimits& memory_limits, | 59 const gpu::SharedMemoryLimits& memory_limits, |
59 const gpu::gles2::ContextCreationAttribHelper& attributes, | 60 const gpu::gles2::ContextCreationAttribHelper& attributes, |
60 ContextProviderCommandBuffer* shared_context_provider, | 61 ContextProviderCommandBuffer* shared_context_provider, |
61 command_buffer_metrics::ContextType type); | 62 command_buffer_metrics::ContextType type); |
62 | 63 |
63 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); | 64 gpu::CommandBufferProxyImpl* GetCommandBufferProxy(); |
64 // Gives the GL internal format that should be used for calling CopyTexImage2D | 65 // Gives the GL internal format that should be used for calling CopyTexImage2D |
65 // on the default framebuffer. | 66 // on the default framebuffer. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 base::ThreadChecker main_thread_checker_; | 105 base::ThreadChecker main_thread_checker_; |
105 base::ThreadChecker context_thread_checker_; | 106 base::ThreadChecker context_thread_checker_; |
106 | 107 |
107 bool bind_succeeded_ = false; | 108 bool bind_succeeded_ = false; |
108 bool bind_failed_ = false; | 109 bool bind_failed_ = false; |
109 | 110 |
110 const int32_t stream_id_; | 111 const int32_t stream_id_; |
111 const gpu::GpuStreamPriority stream_priority_; | 112 const gpu::GpuStreamPriority stream_priority_; |
112 const gpu::SurfaceHandle surface_handle_; | 113 const gpu::SurfaceHandle surface_handle_; |
113 const GURL active_url_; | 114 const GURL active_url_; |
| 115 const gl::GpuPreference gpu_preference_; |
114 const bool automatic_flushes_; | 116 const bool automatic_flushes_; |
115 const bool support_locking_; | 117 const bool support_locking_; |
116 const gpu::SharedMemoryLimits memory_limits_; | 118 const gpu::SharedMemoryLimits memory_limits_; |
117 const gpu::gles2::ContextCreationAttribHelper attributes_; | 119 const gpu::gles2::ContextCreationAttribHelper attributes_; |
118 const command_buffer_metrics::ContextType context_type_; | 120 const command_buffer_metrics::ContextType context_type_; |
119 | 121 |
120 scoped_refptr<SharedProviders> shared_providers_; | 122 scoped_refptr<SharedProviders> shared_providers_; |
121 scoped_refptr<gpu::GpuChannelHost> channel_; | 123 scoped_refptr<gpu::GpuChannelHost> channel_; |
122 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; | 124 scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
123 | 125 |
124 base::Lock context_lock_; // Referenced by command_buffer_. | 126 base::Lock context_lock_; // Referenced by command_buffer_. |
125 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; | 127 std::unique_ptr<gpu::CommandBufferProxyImpl> command_buffer_; |
126 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 128 std::unique_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |
127 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; | 129 std::unique_ptr<gpu::TransferBuffer> transfer_buffer_; |
128 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; | 130 std::unique_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; |
129 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; | 131 std::unique_ptr<gpu::gles2::GLES2TraceImplementation> trace_impl_; |
130 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; | 132 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
131 | 133 |
132 LostContextCallback lost_context_callback_; | 134 LostContextCallback lost_context_callback_; |
133 }; | 135 }; |
134 | 136 |
135 } // namespace content | 137 } // namespace content |
136 | 138 |
137 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ | 139 #endif // CONTENT_COMMON_GPU_CLIENT_CONTEXT_PROVIDER_COMMAND_BUFFER_H_ |
OLD | NEW |