Fix for jankiness in some accelerated 2D canvas demos: If there is already a...

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
parent e1e54963
...@@ -1582,6 +1582,7 @@ _FUNCTION_INFO = { ...@@ -1582,6 +1582,7 @@ _FUNCTION_INFO = {
'GLsizei stride, GLuint offset', 'GLsizei stride, GLuint offset',
}, },
'CopyTextureToParentTextureCHROMIUM': { 'CopyTextureToParentTextureCHROMIUM': {
'impl_func': False,
'decoder_func': 'DoCopyTextureToParentTextureCHROMIUM', 'decoder_func': 'DoCopyTextureToParentTextureCHROMIUM',
'unit_test': False, 'unit_test': False,
'extension': True, 'extension': True,
...@@ -5324,7 +5325,7 @@ class GLGenerator(object): ...@@ -5324,7 +5325,7 @@ class GLGenerator(object):
else: else:
arg = context_arg arg = context_arg
file.Write("%s %s(%s) {\n" % (func.return_type, func.name, arg)) file.Write("%s %s(%s) {\n" % (func.return_type, func.name, arg))
file.Write(""" scoped_refptr<PPB_Context3D_Impl> context = file.Write(""" scoped_refptr<PPB_Context3D_Impl> context =
Resource::GetAs<PPB_Context3D_Impl>(context_id); Resource::GetAs<PPB_Context3D_Impl>(context_id);
""") """)
......
...@@ -689,6 +689,19 @@ void GLES2Implementation::SwapBuffers() { ...@@ -689,6 +689,19 @@ void GLES2Implementation::SwapBuffers() {
Flush(); 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( void GLES2Implementation::GenSharedIdsCHROMIUM(
GLuint namespace_id, GLuint id_offset, GLsizei n, GLuint* ids) { GLuint namespace_id, GLuint id_offset, GLsizei n, GLuint* ids) {
GLint* id_buffer = transfer_buffer_.AllocTyped<GLint>(n); GLint* id_buffer = transfer_buffer_.AllocTyped<GLint>(n);
......
...@@ -879,10 +879,7 @@ void* MapTexSubImage2DCHROMIUM( ...@@ -879,10 +879,7 @@ void* MapTexSubImage2DCHROMIUM(
void UnmapTexSubImage2DCHROMIUM(const void* mem); void UnmapTexSubImage2DCHROMIUM(const void* mem);
void CopyTextureToParentTextureCHROMIUM( void CopyTextureToParentTextureCHROMIUM(
GLuint client_child_id, GLuint client_parent_id) { GLuint client_child_id, GLuint client_parent_id);
helper_->CopyTextureToParentTextureCHROMIUM(
client_child_id, client_parent_id);
}
void ResizeCHROMIUM(GLuint width, GLuint height) { void ResizeCHROMIUM(GLuint width, GLuint height) {
helper_->ResizeCHROMIUM(width, height); helper_->ResizeCHROMIUM(width, height);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment