summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/command_buffer_stub.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 22:02:36 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 22:02:36 +0000
commitc77ea36637f9494c048f6c8035f3cf8a389da93d (patch)
treef1feccf837765ba30c4f46e11b8f7b0b996a5cbd /chrome/plugin/command_buffer_stub.cc
parent23fc99cca22572abe60eced18b90b5693c2f64f7 (diff)
downloadchromium_src-c77ea36637f9494c048f6c8035f3cf8a389da93d.zip
chromium_src-c77ea36637f9494c048f6c8035f3cf8a389da93d.tar.gz
chromium_src-c77ea36637f9494c048f6c8035f3cf8a389da93d.tar.bz2
Redesigned CommandBuffer and NPDevice3D interfaces.
All status is now in the Device3D context. It can be retreived with fewer IPC messages. It can be now be accessed off the main plugin thread, which is necessary to run OpenGL in another thread. TEST=none BUG=none Review URL: http://codereview.chromium.org/555020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37545 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/command_buffer_stub.cc')
-rw-r--r--chrome/plugin/command_buffer_stub.cc33
1 files changed, 7 insertions, 26 deletions
diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc
index 4a9dd5c..4b062e8 100644
--- a/chrome/plugin/command_buffer_stub.cc
+++ b/chrome/plugin/command_buffer_stub.cc
@@ -69,16 +69,13 @@ void CommandBufferStub::OnInitialize(int32 size,
base::CloseProcessHandle(peer_handle);
}
-void CommandBufferStub::OnSyncOffsets(int32 put_offset, int32* get_offset) {
- *get_offset = command_buffer_->SyncOffsets(put_offset);
+void CommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) {
+ *state = command_buffer_->GetState();
}
-void CommandBufferStub::OnGetGetOffset(int32* get_offset) {
- *get_offset = command_buffer_->GetGetOffset();
-}
-
-void CommandBufferStub::OnGetPutOffset(int32* put_offset) {
- *put_offset = command_buffer_->GetPutOffset();
+void CommandBufferStub::OnFlush(int32 put_offset,
+ gpu::CommandBuffer::State* state) {
+ *state = command_buffer_->Flush(put_offset);
}
void CommandBufferStub::OnCreateTransferBuffer(int32 size, int32* id) {
@@ -111,33 +108,17 @@ void CommandBufferStub::OnGetTransferBuffer(
base::CloseProcessHandle(peer_handle);
}
-void CommandBufferStub::OnGetToken(int32* token) {
- *token = command_buffer_->GetToken();
-}
-
-void CommandBufferStub::OnResetParseError(int32* parse_error) {
- *parse_error = command_buffer_->ResetParseError();
-}
-
-void CommandBufferStub::OnGetErrorStatus(bool* error_status) {
- *error_status = command_buffer_->GetErrorStatus();
-}
-
void CommandBufferStub::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(CommandBufferStub, msg)
IPC_MESSAGE_HANDLER(CommandBufferMsg_Initialize, OnInitialize);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_SyncOffsets, OnSyncOffsets);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_GetGetOffset, OnGetGetOffset);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_GetPutOffset, OnGetPutOffset);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_GetState, OnGetState);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_Flush, OnFlush);
IPC_MESSAGE_HANDLER(CommandBufferMsg_CreateTransferBuffer,
OnCreateTransferBuffer);
IPC_MESSAGE_HANDLER(CommandBufferMsg_DestroyTransferBuffer,
OnDestroyTransferBuffer);
IPC_MESSAGE_HANDLER(CommandBufferMsg_GetTransferBuffer,
OnGetTransferBuffer);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_GetToken, OnGetToken);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_ResetParseError, OnResetParseError);
- IPC_MESSAGE_HANDLER(CommandBufferMsg_GetErrorStatus, OnGetErrorStatus);
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
}