From cd189bdbe4ad339765549b41530b59c51973d2cf Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Tue, 9 Feb 2010 23:28:43 +0000 Subject: 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 --- gpu/pgl/command_buffer_pepper.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gpu/pgl') diff --git a/gpu/pgl/command_buffer_pepper.cc b/gpu/pgl/command_buffer_pepper.cc index 0c77d1e..f3f0aff 100644 --- a/gpu/pgl/command_buffer_pepper.cc +++ b/gpu/pgl/command_buffer_pepper.cc @@ -41,13 +41,18 @@ Buffer CommandBufferPepper::GetRingBuffer() { } CommandBuffer::State CommandBufferPepper::GetState() { + context_->waitForProgress = false; + if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) context_->error = NPDeviceContext3DError_GenericError; + context_->waitForProgress = true; + return ConvertState(); } CommandBuffer::State CommandBufferPepper::Flush(int32 put_offset) { + context_->waitForProgress = true; context_->putOffset = put_offset; if (NPERR_NO_ERROR != device_->flushContext(npp_, context_, NULL, NULL)) -- cgit v1.1