summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 23:19:14 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 23:19:14 +0000
commitf397980a5c6cedfa6b867a47ee40c5c09f4baaf7 (patch)
tree7feb58d55c7c1b7882a63f4945a2acf75f63b30e /gpu/command_buffer/client
parentf5aeff3d9497f6d04cc20e04a26f4bdd6094dec2 (diff)
downloadchromium_src-f397980a5c6cedfa6b867a47ee40c5c09f4baaf7.zip
chromium_src-f397980a5c6cedfa6b867a47ee40c5c09f4baaf7.tar.gz
chromium_src-f397980a5c6cedfa6b867a47ee40c5c09f4baaf7.tar.bz2
Ensure that compositor does not block the renderer process by issuing too many SwapBuffers.
This might have regressed with r84372. It caused there to be one additional token queued in the swap buffers token queue than before. BUG=95649 Review URL: http://codereview.chromium.org/7867053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 956ac62..29db8d3 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -964,8 +964,9 @@ void GLES2Implementation::SwapBuffers() {
swap_buffers_tokens_.push(helper_->InsertToken());
helper_->SwapBuffers();
helper_->CommandBufferHelper::Flush();
- // Wait if we added too many swap buffers.
- if (swap_buffers_tokens_.size() > kMaxSwapBuffers) {
+ // Wait if we added too many swap buffers. Add 1 to kMaxSwapBuffers to
+ // compensate for TODO above.
+ if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) {
helper_->WaitForToken(swap_buffers_tokens_.front());
swap_buffers_tokens_.pop();
}