diff options
author | kaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 14:52:34 +0000 |
---|---|---|
committer | kaanb@chromium.org <kaanb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-26 14:52:34 +0000 |
commit | e5100697a5dd81442a62be763b4e46fa4d4267c4 (patch) | |
tree | 25f0e7ae473354f001ae8b6c22a85455e73a424c /ui/gl/gl_image_egl.cc | |
parent | 48878097c79f472be47c9c518bd07041762af6c1 (diff) | |
download | chromium_src-e5100697a5dd81442a62be763b4e46fa4d4267c4.zip chromium_src-e5100697a5dd81442a62be763b4e46fa4d4267c4.tar.gz chromium_src-e5100697a5dd81442a62be763b4e46fa4d4267c4.tar.bz2 |
Call glTexImage2D() on a 1x1 pixel instead of a 0x0 NULL pixel.
Calling glTexImage2D() on a 0x0 pixel with a NULL buffer doesn't cause the storage on the texture to get redefined and as such the previously bound GpuMemoryBuffer remains bound to the texture. This causes undefined behavior (such as hangs) when we try to map the bound buffer.
glTexImage2D() with a 1x1 pixel works as expected and unbinds the buffer from the texture as documented here:
http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image.txt
BUG=264096
Review URL: https://chromiumcodereview.appspot.com/20245002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_image_egl.cc')
-rw-r--r-- | ui/gl/gl_image_egl.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/gl/gl_image_egl.cc b/ui/gl/gl_image_egl.cc index c62971d..dbbd979 100644 --- a/ui/gl/gl_image_egl.cc +++ b/ui/gl/gl_image_egl.cc @@ -75,8 +75,16 @@ void GLImageEGL::Destroy() { } void GLImageEGL::ReleaseTexImage() { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, - NULL); + char zero[4] = { 0, }; + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGBA, + 1, + 1, + 0, + GL_RGBA, + GL_UNSIGNED_BYTE, + &zero); } } // namespace gfx |