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

Unified Diff: gpu/command_buffer/service/command_buffer_service.h

Issue 527009: Removing the dependency of command-buffer client on base/task.h. This file in... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/command_buffer_service.h
===================================================================
--- gpu/command_buffer/service/command_buffer_service.h (revision 35821)
+++ gpu/command_buffer/service/command_buffer_service.h (working copy)
@@ -31,7 +31,6 @@
virtual int32 GetGetOffset();
virtual void SetGetOffset(int32 get_offset);
virtual int32 GetPutOffset();
- virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
virtual int32 CreateTransferBuffer(size_t size);
virtual void DestroyTransferBuffer(int32 id);
virtual Buffer GetTransferBuffer(int32 handle);
@@ -42,6 +41,18 @@
virtual bool GetErrorStatus();
virtual void RaiseErrorStatus();
+ // Sets a callback that should be posted on another thread whenever the put
+ // offset is changed. The callback must not return until some progress has
+ // been made (unless the command buffer is empty), i.e. the
+ // get offset must have changed. It need not process the entire command
+ // buffer though. This allows concurrency between the writer and the reader
+ // while giving the writer a means of waiting for the reader to make some
+ // progress before attempting to write more to the command buffer. Avoiding
+ // the use of a synchronization primitive like a condition variable to
+ // synchronize reader and writer reduces the risk of deadlock.
+ // Takes ownership of callback. The callback is invoked on the plugin thread.
+ virtual void SetPutOffsetChangeCallback(Callback0::Type* callback);
+
private:
scoped_ptr< base::SharedMemory> ring_buffer_;
int32 size_;
« no previous file with comments | « gpu/command_buffer/common/command_buffer_mock.h ('k') | gpu/command_buffer/service/command_buffer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698