diff options
author | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 21:32:21 +0000 |
---|---|---|
committer | kbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 21:32:21 +0000 |
commit | 07fe701db7541e0b0c57658165e6eef601774a1a (patch) | |
tree | 34e0a5c5266f13d97afadcb1c54b3d1055170da0 /ui | |
parent | ec7be0a8648508960007da8f53e2f9007da7a7ed (diff) | |
download | chromium_src-07fe701db7541e0b0c57658165e6eef601774a1a.zip chromium_src-07fe701db7541e0b0c57658165e6eef601774a1a.tar.gz chromium_src-07fe701db7541e0b0c57658165e6eef601774a1a.tar.bz2 |
Changed assertion about current OpenGL context to work in the face of
third-party libraries using OpenGL.
BUG=98491
TEST=ran G+ hangout (no assertion failure, but crashed for other reasons), WebGL demos
Review URL: http://codereview.chromium.org/8081004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/gl_context_cgl.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_egl.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_glx.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_osmesa.cc | 5 | ||||
-rw-r--r-- | ui/gfx/gl/gl_context_wgl.cc | 5 |
5 files changed, 20 insertions, 5 deletions
diff --git a/ui/gfx/gl/gl_context_cgl.cc b/ui/gfx/gl/gl_context_cgl.cc index 6e5defa..005af00 100644 --- a/ui/gfx/gl/gl_context_cgl.cc +++ b/ui/gfx/gl/gl_context_cgl.cc @@ -81,7 +81,10 @@ void GLContextCGL::ReleaseCurrent(GLSurface* surface) { bool GLContextCGL::IsCurrent(GLSurface* surface) { bool native_context_is_current = CGLGetCurrentContext() == context_; - DCHECK(native_context_is_current == (GetCurrent() == this)); + // If our context is current then our notion of which GLContext is + // current must be correct. On the other hand, third-party code + // using OpenGL might change the current context. + DCHECK(!native_context_is_current || (GetCurrent() == this)); if (!native_context_is_current) return false; diff --git a/ui/gfx/gl/gl_context_egl.cc b/ui/gfx/gl/gl_context_egl.cc index cde22d2..a86c0d7 100644 --- a/ui/gfx/gl/gl_context_egl.cc +++ b/ui/gfx/gl/gl_context_egl.cc @@ -116,7 +116,10 @@ bool GLContextEGL::IsCurrent(GLSurface* surface) { bool native_context_is_current = context_ == eglGetCurrentContext(); - DCHECK(native_context_is_current == (GetCurrent() == this)); + // If our context is current then our notion of which GLContext is + // current must be correct. On the other hand, third-party code + // using OpenGL might change the current context. + DCHECK(!native_context_is_current || (GetCurrent() == this)); if (!native_context_is_current) return false; diff --git a/ui/gfx/gl/gl_context_glx.cc b/ui/gfx/gl/gl_context_glx.cc index a23f1a9..8e6cc06 100644 --- a/ui/gfx/gl/gl_context_glx.cc +++ b/ui/gfx/gl/gl_context_glx.cc @@ -192,7 +192,10 @@ bool GLContextGLX::IsCurrent(GLSurface* surface) { bool native_context_is_current = glXGetCurrentContext() == static_cast<GLXContext>(context_); - DCHECK(native_context_is_current == (GetCurrent() == this)); + // If our context is current then our notion of which GLContext is + // current must be correct. On the other hand, third-party code + // using OpenGL might change the current context. + DCHECK(!native_context_is_current || (GetCurrent() == this)); if (!native_context_is_current) return false; diff --git a/ui/gfx/gl/gl_context_osmesa.cc b/ui/gfx/gl/gl_context_osmesa.cc index 4e145ac..e35d645 100644 --- a/ui/gfx/gl/gl_context_osmesa.cc +++ b/ui/gfx/gl/gl_context_osmesa.cc @@ -87,7 +87,10 @@ bool GLContextOSMesa::IsCurrent(GLSurface* surface) { bool native_context_is_current = context_ == OSMesaGetCurrentContext(); - DCHECK(native_context_is_current == (GetCurrent() == this)); + // If our context is current then our notion of which GLContext is + // current must be correct. On the other hand, third-party code + // using OpenGL might change the current context. + DCHECK(!native_context_is_current || (GetCurrent() == this)); if (!native_context_is_current) return false; diff --git a/ui/gfx/gl/gl_context_wgl.cc b/ui/gfx/gl/gl_context_wgl.cc index 487f950..f096ca6 100644 --- a/ui/gfx/gl/gl_context_wgl.cc +++ b/ui/gfx/gl/gl_context_wgl.cc @@ -99,7 +99,10 @@ bool GLContextWGL::IsCurrent(GLSurface* surface) { bool native_context_is_current = wglGetCurrentContext() == context_; - DCHECK(native_context_is_current == (GetCurrent() == this)); + // If our context is current then our notion of which GLContext is + // current must be correct. On the other hand, third-party code + // using OpenGL might change the current context. + DCHECK(!native_context_is_current || (GetCurrent() == this)); if (!native_context_is_current) return false; |