summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:28:43 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 23:28:43 +0000
commitcd189bdbe4ad339765549b41530b59c51973d2cf (patch)
treeebb322b7c0004526cf77f0ac44df5734015e9cab /chrome/plugin
parentd1015f1c5bc276109b62280694ec180e62ae909f (diff)
downloadchromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.zip
chromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.tar.gz
chromium_src-cd189bdbe4ad339765549b41530b59c51973d2cf.tar.bz2
Implemented async flushes for Pepper 3D.
Added waitForProgress field to NPDeviceContext3D to select between a flush (that pushes more work to the GPU process and waits for at least some of it to have been completed) and getting the current state as quickly as possible. The previous method of checking to see if the put offset had advanced was incorrect. TEST=trybots BUG=none Review URL: http://codereview.chromium.org/561058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/command_buffer_stub.cc48
-rw-r--r--chrome/plugin/command_buffer_stub.h2
2 files changed, 32 insertions, 18 deletions
diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc
index b019b1f..9e80b14 100644
--- a/chrome/plugin/command_buffer_stub.cc
+++ b/chrome/plugin/command_buffer_stub.cc
@@ -25,6 +25,26 @@ CommandBufferStub::~CommandBufferStub() {
channel_->RemoveRoute(route_id_);
}
+void CommandBufferStub::OnMessageReceived(const IPC::Message& message) {
+ IPC_BEGIN_MESSAGE_MAP(CommandBufferStub, message)
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_Initialize, OnInitialize);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_GetState, OnGetState);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_AsyncGetState, OnAsyncGetState);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_Flush, OnFlush);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_AsyncFlush, OnAsyncFlush);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_CreateTransferBuffer,
+ OnCreateTransferBuffer);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_DestroyTransferBuffer,
+ OnDestroyTransferBuffer);
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_GetTransferBuffer,
+ OnGetTransferBuffer);
+#if defined(OS_MACOSX)
+ IPC_MESSAGE_HANDLER(CommandBufferMsg_SetWindowSize, OnSetWindowSize);
+#endif
+ IPC_MESSAGE_UNHANDLED_ERROR()
+ IPC_END_MESSAGE_MAP()
+}
+
void CommandBufferStub::OnChannelError() {
NOTREACHED() << "CommandBufferService::OnChannelError called";
}
@@ -81,11 +101,21 @@ void CommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) {
*state = command_buffer_->GetState();
}
+void CommandBufferStub::OnAsyncGetState() {
+ gpu::CommandBuffer::State state = command_buffer_->GetState();
+ Send(new CommandBufferMsg_UpdateState(route_id_, state));
+}
+
void CommandBufferStub::OnFlush(int32 put_offset,
gpu::CommandBuffer::State* state) {
*state = command_buffer_->Flush(put_offset);
}
+void CommandBufferStub::OnAsyncFlush(int32 put_offset) {
+ gpu::CommandBuffer::State state = command_buffer_->Flush(put_offset);
+ Send(new CommandBufferMsg_UpdateState(route_id_, state));
+}
+
void CommandBufferStub::OnCreateTransferBuffer(int32 size, int32* id) {
*id = command_buffer_->CreateTransferBuffer(size);
}
@@ -133,21 +163,3 @@ void CommandBufferStub::SwapBuffersCallback() {
window_));
}
#endif
-
-void CommandBufferStub::OnMessageReceived(const IPC::Message& msg) {
- IPC_BEGIN_MESSAGE_MAP(CommandBufferStub, msg)
- IPC_MESSAGE_HANDLER(CommandBufferMsg_Initialize, OnInitialize);
- 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);
-#if defined(OS_MACOSX)
- IPC_MESSAGE_HANDLER(CommandBufferMsg_SetWindowSize, OnSetWindowSize);
-#endif
- IPC_MESSAGE_UNHANDLED_ERROR()
- IPC_END_MESSAGE_MAP()
-}
diff --git a/chrome/plugin/command_buffer_stub.h b/chrome/plugin/command_buffer_stub.h
index 7759392..539e241 100644
--- a/chrome/plugin/command_buffer_stub.h
+++ b/chrome/plugin/command_buffer_stub.h
@@ -41,7 +41,9 @@ class CommandBufferStub : public IPC::Channel::Listener,
// Message handlers:
void OnInitialize(int32 size, base::SharedMemoryHandle* ring_buffer);
void OnGetState(gpu::CommandBuffer::State* state);
+ void OnAsyncGetState();
void OnFlush(int32 put_offset, gpu::CommandBuffer::State* state);
+ void OnAsyncFlush(int32 put_offset);
void OnCreateTransferBuffer(int32 size, int32* id);
void OnDestroyTransferBuffer(int32 id);
void OnGetTransferBuffer(int32 id,