| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/gl_context_osmesa.h" | 5 #include "ui/gl/gl_context_osmesa.h" |
| 6 | 6 |
| 7 #include <GL/osmesa.h> | 7 #include <GL/osmesa.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (!InitializeExtensionBindings()) { | 69 if (!InitializeExtensionBindings()) { |
| 70 ReleaseCurrent(surface); | 70 ReleaseCurrent(surface); |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 | 73 |
| 74 if (!surface->OnMakeCurrent(this)) { | 74 if (!surface->OnMakeCurrent(this)) { |
| 75 LOG(ERROR) << "Could not make current."; | 75 LOG(ERROR) << "Could not make current."; |
| 76 return false; | 76 return false; |
| 77 } | 77 } |
| 78 | 78 |
| 79 SetRealGLApi(); |
| 79 return true; | 80 return true; |
| 80 } | 81 } |
| 81 | 82 |
| 82 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { | 83 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { |
| 83 if (!IsCurrent(surface)) | 84 if (!IsCurrent(surface)) |
| 84 return; | 85 return; |
| 85 | 86 |
| 86 SetCurrent(NULL, NULL); | 87 SetCurrent(NULL, NULL); |
| 87 OSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0); | 88 OSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0); |
| 88 } | 89 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void GLContextOSMesa::SetSwapInterval(int interval) { | 122 void GLContextOSMesa::SetSwapInterval(int interval) { |
| 122 DCHECK(IsCurrent(NULL)); | 123 DCHECK(IsCurrent(NULL)); |
| 123 DLOG(INFO) << "GLContextOSMesa::SetSwapInterval is ignored."; | 124 DLOG(INFO) << "GLContextOSMesa::SetSwapInterval is ignored."; |
| 124 } | 125 } |
| 125 | 126 |
| 126 GLContextOSMesa::~GLContextOSMesa() { | 127 GLContextOSMesa::~GLContextOSMesa() { |
| 127 Destroy(); | 128 Destroy(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace gfx | 131 } // namespace gfx |
| OLD | NEW |