Chromium Code Reviews| Index: ui/gl/gl_context_egl.cc |
| diff --git a/ui/gl/gl_context_egl.cc b/ui/gl/gl_context_egl.cc |
| index 2554f8c5b1d029277e541ab78a2f1ed1680a94b1..60ceece6109ddf0ec27b163cb60c41a4ae6d0eb4 100644 |
| --- a/ui/gl/gl_context_egl.cc |
| +++ b/ui/gl/gl_context_egl.cc |
| @@ -29,7 +29,8 @@ GLContextEGL::GLContextEGL(GLShareGroup* share_group) |
| context_(NULL), |
| display_(NULL), |
| config_(NULL), |
| - unbind_fbo_on_makecurrent_(false) { |
| + unbind_fbo_on_makecurrent_(false), |
| + is_surfaceless_context_(false) { |
| } |
| bool GLContextEGL::Initialize( |
| @@ -74,6 +75,8 @@ bool GLContextEGL::Initialize( |
| return false; |
| } |
| + is_surfaceless_context_ = compatible_surface->IsSurfaceless(); |
| + |
| return true; |
| } |
| @@ -125,6 +128,7 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) { |
| return false; |
| } |
| + is_surfaceless_context_ = surface->IsSurfaceless(); |
| release_current.Cancel(); |
| return true; |
| } |
| @@ -174,6 +178,12 @@ void* GLContextEGL::GetHandle() { |
| void GLContextEGL::SetSwapInterval(int interval) { |
| DCHECK(IsCurrent(NULL)); |
| + |
| + // This is a surfaceless context. eglSwapInterval doesn't take any effect in |
| + // this case and will just return EGL_BAD_SURFACE. |
| + if (is_surfaceless_context_) |
|
piman
2014/11/03 19:43:13
Rather than stashing a bool, you can simply use GL
kalyank
2014/11/03 20:04:53
Didn't realize that, thanks. Will do that.
kalyank
2014/11/03 20:46:11
Done.
|
| + return; |
| + |
| if (!eglSwapInterval(display_, interval)) { |
| LOG(ERROR) << "eglSwapInterval failed with error " |
| << GetLastEGLErrorString(); |