diff options
author | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 01:27:01 +0000 |
---|---|---|
committer | kbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-06 01:27:01 +0000 |
commit | 6c9b1913dddd4a3f208b427af9a81ee1013bedc3 (patch) | |
tree | 33dff505e5c98409c439cc3e65ad98b01da05ac4 | |
parent | 7de3a31e108df3e256a95ffa1abadc9d61abf13a (diff) | |
download | chromium_src-6c9b1913dddd4a3f208b427af9a81ee1013bedc3.zip chromium_src-6c9b1913dddd4a3f208b427af9a81ee1013bedc3.tar.gz chromium_src-6c9b1913dddd4a3f208b427af9a81ee1013bedc3.tar.bz2 |
Merged and tested r84353 from trunk:
Thanks to piman, added necessary glFlush to the IOSurface code path on
the Mac. This was the root cause of the delay in transmission of
rendering results from the GPU process to the browser process.
Undid the changes from the fix for Issue 80602; they are no longer
needed.
Reran various test cases on Mac; no regressions.
BUG=81740
TEST=none
TBR=apatrick,piman
Review URL: http://codereview.chromium.org/6932062
git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84379 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler.h | 7 | ||||
-rw-r--r-- | ui/gfx/surface/accelerated_surface_mac.cc | 3 |
3 files changed, 9 insertions, 5 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 2790ea1..4c4b534c 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -298,6 +298,8 @@ void GpuCommandBufferStub::SwapBuffersCallback() { params.swap_buffers_count = scheduler_->swap_buffers_count(); gpu_channel_manager->Send( new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params)); + + scheduler_->SetScheduled(false); } void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( @@ -305,7 +307,7 @@ void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( scheduler_->set_acknowledged_swap_buffers_count(swap_buffers_count); // Wake up the GpuScheduler to start doing work again. - scheduler_->ScheduleProcessCommands(); + scheduler_->SetScheduled(true); } #endif // defined(OS_MACOSX) diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h index 2bc67a1..04784a7 100644 --- a/gpu/command_buffer/service/gpu_scheduler.h +++ b/gpu/command_buffer/service/gpu_scheduler.h @@ -127,10 +127,6 @@ class GpuScheduler : public CommandBufferEngine { // Get the GLES2Decoder associated with this scheduler. gles2::GLES2Decoder* decoder() const { return decoder_.get(); } - // Helper which causes a call to ProcessCommands to be scheduled later. - // TODO(apatrick): figure out a way to make this private again. - void ScheduleProcessCommands(); - protected: // Perform common initialization. Takes ownership of GLContext. bool InitializeCommon( @@ -144,6 +140,9 @@ class GpuScheduler : public CommandBufferEngine { private: + // Helper which causes a call to ProcessCommands to be scheduled later. + void ScheduleProcessCommands(); + // Called via a callback just before we are supposed to call the // user's swap buffers callback. virtual void WillSwapBuffers(); diff --git a/ui/gfx/surface/accelerated_surface_mac.cc b/ui/gfx/surface/accelerated_surface_mac.cc index 4007c03..43c6890 100644 --- a/ui/gfx/surface/accelerated_surface_mac.cc +++ b/ui/gfx/surface/accelerated_surface_mac.cc @@ -87,6 +87,9 @@ void AcceleratedSurface::SwapBuffers() { 0, 0, surface_size_.width(), surface_size_.height()); glBindTexture(target, current_texture); + // This flush is absolutely essential -- it guarantees that the + // rendering results are seen by the other process. + glFlush(); } } else if (transport_dib_.get() != NULL) { // Pre-Mac OS X 10.6, fetch the rendered image from the current frame |