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