diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 23:43:15 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 23:43:15 +0000 |
commit | 7d5b8d1da5cda4a2fbd071430f7030596c3c7365 (patch) | |
tree | 99b82372e1436bcaca5dcc5ba625ad28da0460da /chrome | |
parent | 08a3cacedb78fd367b166dad5fdf7dfb01d36bfb (diff) | |
download | chromium_src-7d5b8d1da5cda4a2fbd071430f7030596c3c7365.zip chromium_src-7d5b8d1da5cda4a2fbd071430f7030596c3c7365.tar.gz chromium_src-7d5b8d1da5cda4a2fbd071430f7030596c3c7365.tar.bz2 |
Make CommandBuffer::Flush asynchronous, and add CommandBuffer::FlushSync with former semantics.
Also force a flush when the buffer is getting full.
BUG=none
TEST=gpu_unittests, some webgl content, some 3d css content, pepper flash
Review URL: http://codereview.chromium.org/6316002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/gpu/gpu_command_buffer_stub.cc | 4 | ||||
-rw-r--r-- | chrome/plugin/command_buffer_stub.cc | 4 | ||||
-rw-r--r-- | chrome/renderer/command_buffer_proxy.cc | 6 | ||||
-rw-r--r-- | chrome/renderer/command_buffer_proxy.h | 3 | ||||
-rw-r--r-- | chrome/renderer/webplugin_delegate_pepper.cc | 2 |
5 files changed, 12 insertions, 7 deletions
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc index b51695d..930f6f5 100644 --- a/chrome/gpu/gpu_command_buffer_stub.cc +++ b/chrome/gpu/gpu_command_buffer_stub.cc @@ -290,11 +290,11 @@ void GpuCommandBufferStub::OnFlush(int32 put_offset, if (channel_->IsRenderViewGone(render_view_id_)) processor_->DidDestroySurface(); #endif - *state = command_buffer_->Flush(put_offset); + *state = command_buffer_->FlushSync(put_offset); } void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset) { - gpu::CommandBuffer::State state = command_buffer_->Flush(put_offset); + gpu::CommandBuffer::State state = command_buffer_->FlushSync(put_offset); Send(new GpuCommandBufferMsg_UpdateState(route_id_, state)); } diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc index de9bbdb..2ef657a 100644 --- a/chrome/plugin/command_buffer_stub.cc +++ b/chrome/plugin/command_buffer_stub.cc @@ -140,11 +140,11 @@ void CommandBufferStub::OnAsyncGetState() { void CommandBufferStub::OnFlush(int32 put_offset, gpu::CommandBuffer::State* state) { - *state = command_buffer_->Flush(put_offset); + *state = command_buffer_->FlushSync(put_offset); } void CommandBufferStub::OnAsyncFlush(int32 put_offset) { - gpu::CommandBuffer::State state = command_buffer_->Flush(put_offset); + gpu::CommandBuffer::State state = command_buffer_->FlushSync(put_offset); Send(new GpuCommandBufferMsg_UpdateState(route_id_, state)); } diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc index 21eee90..3112031 100644 --- a/chrome/renderer/command_buffer_proxy.cc +++ b/chrome/renderer/command_buffer_proxy.cc @@ -94,7 +94,11 @@ gpu::CommandBuffer::State CommandBufferProxy::GetState() { return last_state_; } -gpu::CommandBuffer::State CommandBufferProxy::Flush(int32 put_offset) { +void CommandBufferProxy::Flush(int32 put_offset) { + AsyncFlush(put_offset, NULL); +} + +gpu::CommandBuffer::State CommandBufferProxy::FlushSync(int32 put_offset) { // Send will flag state with lost context if IPC fails. if (last_state_.error == gpu::error::kNoError) { Send(new GpuCommandBufferMsg_Flush(route_id_, diff --git a/chrome/renderer/command_buffer_proxy.h b/chrome/renderer/command_buffer_proxy.h index 6f3688f..3e7c50c 100644 --- a/chrome/renderer/command_buffer_proxy.h +++ b/chrome/renderer/command_buffer_proxy.h @@ -47,7 +47,8 @@ class CommandBufferProxy : public gpu::CommandBuffer, virtual bool Initialize(int32 size); virtual gpu::Buffer GetRingBuffer(); virtual State GetState(); - virtual State Flush(int32 put_offset); + virtual void Flush(int32 put_offset); + virtual State FlushSync(int32 put_offset); virtual void SetGetOffset(int32 get_offset); virtual int32 CreateTransferBuffer(size_t size); virtual void DestroyTransferBuffer(int32 id); diff --git a/chrome/renderer/webplugin_delegate_pepper.cc b/chrome/renderer/webplugin_delegate_pepper.cc index 633c30b..4d1ae54 100644 --- a/chrome/renderer/webplugin_delegate_pepper.cc +++ b/chrome/renderer/webplugin_delegate_pepper.cc @@ -779,7 +779,7 @@ NPError WebPluginDelegatePepper::Device3DFlushContext( callback, user_data)); } else { - state = command_buffer_->Flush(context->putOffset); + state = command_buffer_->FlushSync(context->putOffset); Synchronize3DContext(context, state); } } else { |