Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.h

Issue 1331843005: Implemented new fence syncs which replaces the old sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improved commented out sample mojo code Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_GPU_COMMAND_BUFFER_STUB_H_ 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 void OnEnsureBackbuffer(); 202 void OnEnsureBackbuffer();
203 203
204 void OnRetireSyncPoint(uint32 sync_point); 204 void OnRetireSyncPoint(uint32 sync_point);
205 bool OnWaitSyncPoint(uint32 sync_point); 205 bool OnWaitSyncPoint(uint32 sync_point);
206 void OnWaitSyncPointCompleted(uint32 sync_point); 206 void OnWaitSyncPointCompleted(uint32 sync_point);
207 void OnSignalSyncPoint(uint32 sync_point, uint32 id); 207 void OnSignalSyncPoint(uint32 sync_point, uint32 id);
208 void OnSignalSyncPointAck(uint32 id); 208 void OnSignalSyncPointAck(uint32 id);
209 void OnSignalQuery(uint32 query, uint32 id); 209 void OnSignalQuery(uint32 query, uint32 id);
210 210
211 void OnFenceSyncRelease(uint32_t release);
212 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id,
213 uint64_t command_buffer_id,
214 uint32_t release);
215 void OnWaitFenceSyncCompleted(gpu::CommandBufferNamespace namespace_id,
216 uint64_t command_buffer_id,
217 uint32_t release);
218
211 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); 219 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback);
212 220
213 void OnCreateImage(int32 id, 221 void OnCreateImage(int32 id,
214 gfx::GpuMemoryBufferHandle handle, 222 gfx::GpuMemoryBufferHandle handle,
215 gfx::Size size, 223 gfx::Size size,
216 gfx::BufferFormat format, 224 gfx::BufferFormat format,
217 uint32 internalformat); 225 uint32 internalformat);
218 void OnDestroyImage(int32 id); 226 void OnDestroyImage(int32 id);
219 void OnCreateStreamTexture(uint32 texture_id, 227 void OnCreateStreamTexture(uint32 texture_id,
220 int32 stream_id, 228 int32 stream_id,
(...skipping 13 matching lines...) Expand all
234 void PerformWork(); 242 void PerformWork();
235 243
236 // Schedule processing of delayed work. This updates the time at which 244 // Schedule processing of delayed work. This updates the time at which
237 // delayed work should be processed. |process_delayed_work_time_| is 245 // delayed work should be processed. |process_delayed_work_time_| is
238 // updated to current time + delay. Call this after processing some amount 246 // updated to current time + delay. Call this after processing some amount
239 // of delayed work. 247 // of delayed work.
240 void ScheduleDelayedWork(base::TimeDelta delay); 248 void ScheduleDelayedWork(base::TimeDelta delay);
241 249
242 bool CheckContextLost(); 250 bool CheckContextLost();
243 void CheckCompleteWaits(); 251 void CheckCompleteWaits();
244 void PullTextureUpdates(uint32 sync_point); 252 void PullTextureUpdates(gpu::CommandBufferNamespace namespace_id,
253 uint64_t command_buffer_id,
254 uint32_t release);
255
245 256
246 // The lifetime of objects of this class is managed by a GpuChannel. The 257 // The lifetime of objects of this class is managed by a GpuChannel. The
247 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they 258 // GpuChannels destroy all the GpuCommandBufferStubs that they own when they
248 // are destroyed. So a raw pointer is safe. 259 // are destroyed. So a raw pointer is safe.
249 GpuChannel* channel_; 260 GpuChannel* channel_;
250 261
251 // Task runner for main thread. 262 // Task runner for main thread.
252 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 263 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
253 264
254 // The group of contexts that share namespaces with this context. 265 // The group of contexts that share namespaces with this context.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 size_t total_gpu_memory_; 313 size_t total_gpu_memory_;
303 scoped_ptr<WaitForCommandState> wait_for_token_; 314 scoped_ptr<WaitForCommandState> wait_for_token_;
304 scoped_ptr<WaitForCommandState> wait_for_get_offset_; 315 scoped_ptr<WaitForCommandState> wait_for_get_offset_;
305 316
306 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); 317 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub);
307 }; 318 };
308 319
309 } // namespace content 320 } // namespace content
310 321
311 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ 322 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698