Chromium Code Reviews| Index: ui/gl/gl_gl_api_implementation.cc |
| diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc |
| index 1d6fcb15d0a57485bd0c12bc5618f53d1d85ed04..1a0d7b78dbe935d6fc8a3a0e397d5a2d580db612 100644 |
| --- a/ui/gl/gl_gl_api_implementation.cc |
| +++ b/ui/gl/gl_gl_api_implementation.cc |
| @@ -540,7 +540,7 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) { |
| // MakeCurrent 'lite' path that avoids potentially expensive MakeCurrent() |
| // calls if the GLSurface uses the same underlying surface or renders to |
| // an FBO. |
| - if (switched_contexts || !current_surface || |
| + if (switched_contexts || !current_surface || !surface || |
|
ericrk
2015/07/13 21:15:33
This is a bit weird as IsCurrent(surface) always r
|
| !virtual_context->IsCurrent(surface)) { |
| if (!real_context_->MakeCurrent(surface)) { |
| return false; |
| @@ -581,7 +581,7 @@ bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) { |
| SetGLApi(this); |
| virtual_context->SetCurrent(surface); |
| - if (!surface->OnMakeCurrent(virtual_context)) { |
| + if (surface && !surface->OnMakeCurrent(virtual_context)) { |
| LOG(ERROR) << "Could not make GLSurface current."; |
| return false; |
| } |