summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 01:11:51 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-20 01:11:51 +0000
commit1d4ea84edf96367e3e8d7278f8e1b9f913f290b0 (patch)
tree068ccc98005de448c2fe3135e33e8dc268758705 /webkit
parent7dea88fd2340d36442020166c1aec0be431607e1 (diff)
downloadchromium_src-1d4ea84edf96367e3e8d7278f8e1b9f913f290b0.zip
chromium_src-1d4ea84edf96367e3e8d7278f8e1b9f913f290b0.tar.gz
chromium_src-1d4ea84edf96367e3e8d7278f8e1b9f913f290b0.tar.bz2
Revert 93066 - Execute all GL commands up to the put offset reported by a each flush.This means glFlush is a barrier that prevents reordering of GL commands issued on different command buffers. I used it to replace latches for synchronizing the rendering of WebGL canvas and Pepper 3D with the accelerated compositor. The primary advantage is it is more robust than latches and there is no possibility of deadlock. It should also be possible for WebGL and Pepper 3D to use it whereas exposing SetLatch and WaitLatch would be dangerous.The calls to SetLatch and WaitLatch are still in webkit but they are no-ops. SetLatch and WaitLatch are completely removed elsewhere.I changed CommandBuffer::FlushSync to Finish to reflect the new semantics. Going forward, I will add a synchronous CommandBuffer::WaitForToken and WaitForAvailableEntries, which should eliminate the need to call Finish unless glFinish is called by the client. The Pepper interface is unchanged because I don't want to break binary compatibility.I fixed a bug where the last read token in CmdBufferHelper was stale after receiving a ReportState IPC. That was causing a redundant synchronous flush in the client side SwapBuffers throttling.I removed Yield because it does not make sense with the new semantics. There is no round robin scheduling.Tested with WebGL on Windows and Mac and checked that 72672 did not regress.
Review URL: http://codereview.chromium.org/7253052 TBR=apatrick@chromium.org Review URL: http://codereview.chromium.org/7458010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index f633323..5e91359 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -78,7 +78,7 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> {
~GLInProcessContext();
- void PumpCommands();
+ void PumpCommands(bool sync);
// Create a GLInProcessContext that renders directly to a view. The view and
// the associated window must not be destroyed until the returned
@@ -384,10 +384,10 @@ void GLInProcessContext::ResizeOffscreen(const gfx::Size& size) {
}
}
-void GLInProcessContext::PumpCommands() {
+void GLInProcessContext::PumpCommands(bool /* sync */) {
::gpu::CommandBuffer::State state;
do {
- gpu_scheduler_->PutChanged();
+ gpu_scheduler_->PutChanged(true);
MessageLoop::current()->RunAllPending();
state = command_buffer_->GetState();
} while (state.get_offset != state.put_offset);
@@ -577,9 +577,7 @@ bool GLInProcessContext::Initialize(bool onscreen,
if (!command_buffer_->Initialize(kCommandBufferSize))
return false;
- gpu_scheduler_ = GpuScheduler::Create(command_buffer_.get(),
- NULL,
- NULL);
+ gpu_scheduler_ = new GpuScheduler(command_buffer_.get(), NULL, NULL);
if (onscreen) {
if (render_surface == gfx::kNullPluginWindow) {
@@ -1078,11 +1076,19 @@ void WebGraphicsContext3DInProcessCommandBufferImpl::
void WebGraphicsContext3DInProcessCommandBufferImpl::waitLatchCHROMIUM(
WGC3Duint latch_id)
{
+ // TODO(gmam): See if we can comment this in.
+ // ClearContext();
+ gl_->WaitLatchCHROMIUM(latch_id);
}
void WebGraphicsContext3DInProcessCommandBufferImpl::setLatchCHROMIUM(
WGC3Duint latch_id)
{
+ // TODO(gmam): See if we can comment this in.
+ // ClearContext();
+ gl_->SetLatchCHROMIUM(latch_id);
+ // required to ensure set command is sent to GPU process
+ gl_->Flush();
}
void WebGraphicsContext3DInProcessCommandBufferImpl::