| Index: ui/gl/gl_context_cgl.cc
|
| diff --git a/ui/gl/gl_context_cgl.cc b/ui/gl/gl_context_cgl.cc
|
| index 10f854aaccda3836fed6a53d2fc7bcda4d8be666..277780a3b244713610f0c6552550ef886a3faaa6 100644
|
| --- a/ui/gl/gl_context_cgl.cc
|
| +++ b/ui/gl/gl_context_cgl.cc
|
| @@ -136,7 +136,7 @@ void GLContextCGL::Destroy() {
|
| }
|
| }
|
|
|
| -bool GLContextCGL::MakeCurrent(GLSurface* surface) {
|
| +bool GLContextCGL::ForceGpuSwitchIfNeeded() {
|
| DCHECK(context_);
|
|
|
| // The call to CGLSetVirtualScreen can hang on some AMD drivers
|
| @@ -174,6 +174,14 @@ bool GLContextCGL::MakeCurrent(GLSurface* surface) {
|
| renderer_id_ = renderer_id;
|
| }
|
| }
|
| + return true;
|
| +}
|
| +
|
| +bool GLContextCGL::MakeCurrent(GLSurface* surface) {
|
| + DCHECK(context_);
|
| +
|
| + if (!ForceGpuSwitchIfNeeded())
|
| + return false;
|
|
|
| if (IsCurrent(surface))
|
| return true;
|
|
|