diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 23:14:01 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 23:14:01 +0000 |
commit | ef637e981ce9f6f7989e586cd0518734f7743c6d (patch) | |
tree | 187b73ac688dba21d2cf45978a9a56eefb18c2f0 /gpu/command_buffer | |
parent | e1e54963f069665835a19ddee5609e91cc3a199c (diff) | |
download | chromium_src-ef637e981ce9f6f7989e586cd0518734f7743c6d.zip chromium_src-ef637e981ce9f6f7989e586cd0518734f7743c6d.tar.gz chromium_src-ef637e981ce9f6f7989e586cd0518734f7743c6d.tar.bz2 |
Fix for jankiness in some accelerated 2D canvas demos: If there is already a pending call to CopyTextureToParentTextureCHROMIUM, the second will block until the first is consumed (same fix as was done to SwapBuffers for WebGL). [Patch by gman; I just typed. :)]
BUG=68735
TEST=see bug
Review URL: http://codereview.chromium.org/6373013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72713 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rwxr-xr-x | gpu/command_buffer/build_gles2_cmd_buffer.py | 3 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 13 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation_autogen.h | 5 |
3 files changed, 16 insertions, 5 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index a34035f..522be5e 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py @@ -1582,6 +1582,7 @@ _FUNCTION_INFO = { 'GLsizei stride, GLuint offset', }, 'CopyTextureToParentTextureCHROMIUM': { + 'impl_func': False, 'decoder_func': 'DoCopyTextureToParentTextureCHROMIUM', 'unit_test': False, 'extension': True, @@ -5324,7 +5325,7 @@ class GLGenerator(object): else: arg = context_arg file.Write("%s %s(%s) {\n" % (func.return_type, func.name, arg)) - + file.Write(""" scoped_refptr<PPB_Context3D_Impl> context = Resource::GetAs<PPB_Context3D_Impl>(context_id); """) diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index aa7f69d..77dee21 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -689,6 +689,19 @@ void GLES2Implementation::SwapBuffers() { Flush(); } +void GLES2Implementation::CopyTextureToParentTextureCHROMIUM( + GLuint client_child_id, GLuint client_parent_id) { + // Wait if this would add too many CopyTextureToParentTexture's + if (swap_buffers_tokens_.size() == kMaxSwapBuffers) { + helper_->WaitForToken(swap_buffers_tokens_.front()); + swap_buffers_tokens_.pop(); + } + helper_->CopyTextureToParentTextureCHROMIUM(client_child_id, + client_parent_id); + swap_buffers_tokens_.push(helper_->InsertToken()); + Flush(); +} + void GLES2Implementation::GenSharedIdsCHROMIUM( GLuint namespace_id, GLuint id_offset, GLsizei n, GLuint* ids) { GLint* id_buffer = transfer_buffer_.AllocTyped<GLint>(n); diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index bb22143..0b27f6c 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -879,10 +879,7 @@ void* MapTexSubImage2DCHROMIUM( void UnmapTexSubImage2DCHROMIUM(const void* mem); void CopyTextureToParentTextureCHROMIUM( - GLuint client_child_id, GLuint client_parent_id) { - helper_->CopyTextureToParentTextureCHROMIUM( - client_child_id, client_parent_id); -} + GLuint client_child_id, GLuint client_parent_id); void ResizeCHROMIUM(GLuint width, GLuint height) { helper_->ResizeCHROMIUM(width, height); |