summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 22:13:33 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 22:13:33 +0000
commitf1cdbe1764afa6d75313ae5fe7026fd0e278b835 (patch)
tree47a9dce16a3f4c650f51b089162008a0d2693bac
parent30f27bd8e4cbdf88562b40b8d74fd8e660706264 (diff)
downloadchromium_src-f1cdbe1764afa6d75313ae5fe7026fd0e278b835.zip
chromium_src-f1cdbe1764afa6d75313ae5fe7026fd0e278b835.tar.gz
chromium_src-f1cdbe1764afa6d75313ae5fe7026fd0e278b835.tar.bz2
Reland 100801 - 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. Review URL: http://codereview.chromium.org/7876010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100978 0039d316-1c4b-4281-b951-d872f2087c98
-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();
}