OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 // a new GLSurface. | 77 // a new GLSurface. |
78 bool Initialize(scoped_refptr<gfx::GLSurface> surface, | 78 bool Initialize(scoped_refptr<gfx::GLSurface> surface, |
79 bool is_offscreen, | 79 bool is_offscreen, |
80 gfx::AcceleratedWidget window, | 80 gfx::AcceleratedWidget window, |
81 const gfx::Size& size, | 81 const gfx::Size& size, |
82 const std::vector<int32>& attribs, | 82 const std::vector<int32>& attribs, |
83 gfx::GpuPreference gpu_preference, | 83 gfx::GpuPreference gpu_preference, |
84 const base::Closure& context_lost_callback, | 84 const base::Closure& context_lost_callback, |
85 InProcessCommandBuffer* share_group, | 85 InProcessCommandBuffer* share_group, |
86 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 86 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
87 ImageFactory* image_factory); | 87 ImageFactory* image_factory, |
88 const gfx::SurfaceConfiguration requested_configuration); | |
qsr
2015/06/09 11:02:52
You can pass this by reference:
const gfx::Surface
iansf
2015/06/09 17:23:24
Done.
| |
88 void Destroy(); | 89 void Destroy(); |
89 | 90 |
90 // CommandBuffer implementation: | 91 // CommandBuffer implementation: |
91 bool Initialize() override; | 92 bool Initialize() override; |
92 State GetLastState() override; | 93 State GetLastState() override; |
93 int32 GetLastToken() override; | 94 int32 GetLastToken() override; |
94 void Flush(int32 put_offset) override; | 95 void Flush(int32 put_offset) override; |
95 void OrderingBarrier(int32 put_offset) override; | 96 void OrderingBarrier(int32 put_offset) override; |
96 void WaitForTokenInRange(int32 start, int32 end) override; | 97 void WaitForTokenInRange(int32 start, int32 end) override; |
97 void WaitForGetOffsetInRange(int32 start, int32 end) override; | 98 void WaitForGetOffsetInRange(int32 start, int32 end) override; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 private: | 162 private: |
162 struct InitializeOnGpuThreadParams { | 163 struct InitializeOnGpuThreadParams { |
163 bool is_offscreen; | 164 bool is_offscreen; |
164 gfx::AcceleratedWidget window; | 165 gfx::AcceleratedWidget window; |
165 const gfx::Size& size; | 166 const gfx::Size& size; |
166 const std::vector<int32>& attribs; | 167 const std::vector<int32>& attribs; |
167 gfx::GpuPreference gpu_preference; | 168 gfx::GpuPreference gpu_preference; |
168 gpu::Capabilities* capabilities; // Ouptut. | 169 gpu::Capabilities* capabilities; // Ouptut. |
169 InProcessCommandBuffer* context_group; | 170 InProcessCommandBuffer* context_group; |
170 ImageFactory* image_factory; | 171 ImageFactory* image_factory; |
172 gfx::SurfaceConfiguration requested_configuration; | |
171 | 173 |
172 InitializeOnGpuThreadParams(bool is_offscreen, | 174 InitializeOnGpuThreadParams( |
173 gfx::AcceleratedWidget window, | 175 bool is_offscreen, |
174 const gfx::Size& size, | 176 gfx::AcceleratedWidget window, |
175 const std::vector<int32>& attribs, | 177 const gfx::Size& size, |
176 gfx::GpuPreference gpu_preference, | 178 const std::vector<int32>& attribs, |
177 gpu::Capabilities* capabilities, | 179 gfx::GpuPreference gpu_preference, |
178 InProcessCommandBuffer* share_group, | 180 gpu::Capabilities* capabilities, |
179 ImageFactory* image_factory) | 181 InProcessCommandBuffer* share_group, |
182 ImageFactory* image_factory, | |
183 gfx::SurfaceConfiguration requested_configuration) | |
180 : is_offscreen(is_offscreen), | 184 : is_offscreen(is_offscreen), |
181 window(window), | 185 window(window), |
182 size(size), | 186 size(size), |
183 attribs(attribs), | 187 attribs(attribs), |
184 gpu_preference(gpu_preference), | 188 gpu_preference(gpu_preference), |
185 capabilities(capabilities), | 189 capabilities(capabilities), |
186 context_group(share_group), | 190 context_group(share_group), |
187 image_factory(image_factory) {} | 191 image_factory(image_factory), |
192 requested_configuration(requested_configuration) {} | |
188 }; | 193 }; |
189 | 194 |
190 bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params); | 195 bool InitializeOnGpuThread(const InitializeOnGpuThreadParams& params); |
191 bool DestroyOnGpuThread(); | 196 bool DestroyOnGpuThread(); |
192 void FlushOnGpuThread(int32 put_offset); | 197 void FlushOnGpuThread(int32 put_offset); |
193 void ScheduleIdleWorkOnGpuThread(); | 198 void ScheduleIdleWorkOnGpuThread(); |
194 uint32 CreateStreamTextureOnGpuThread(uint32 client_texture_id); | 199 uint32 CreateStreamTextureOnGpuThread(uint32 client_texture_id); |
195 bool MakeCurrent(); | 200 bool MakeCurrent(); |
196 base::Closure WrapCallback(const base::Closure& callback); | 201 base::Closure WrapCallback(const base::Closure& callback); |
197 State GetStateFast(); | 202 State GetStateFast(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
255 | 260 |
256 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; | 261 base::WeakPtr<InProcessCommandBuffer> gpu_thread_weak_ptr_; |
257 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; | 262 base::WeakPtrFactory<InProcessCommandBuffer> gpu_thread_weak_ptr_factory_; |
258 | 263 |
259 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); | 264 DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
260 }; | 265 }; |
261 | 266 |
262 } // namespace gpu | 267 } // namespace gpu |
263 | 268 |
264 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ | 269 #endif // GPU_COMMAND_BUFFER_SERVICE_IN_PROCESS_COMMAND_BUFFER_H_ |
OLD | NEW |