| 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/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 size.width(), | 75 size.width(), |
| 76 size.height())) { | 76 size.height())) { |
| 77 LOG(ERROR) << "OSMesaMakeCurrent failed."; | 77 LOG(ERROR) << "OSMesaMakeCurrent failed."; |
| 78 Destroy(); | 78 Destroy(); |
| 79 return false; | 79 return false; |
| 80 } | 80 } |
| 81 // Track that we're no longer in a released state to workaround a mesa issue. | 81 // Track that we're no longer in a released state to workaround a mesa issue. |
| 82 is_released_ = false; | 82 is_released_ = false; |
| 83 | 83 |
| 84 // Set this as soon as the context is current, since we might call into GL. | 84 // Set this as soon as the context is current, since we might call into GL. |
| 85 SetRealGLApi(); | 85 BindGLApi(); |
| 86 | 86 |
| 87 // Row 0 is at the top. | 87 // Row 0 is at the top. |
| 88 OSMesaPixelStore(OSMESA_Y_UP, 0); | 88 OSMesaPixelStore(OSMESA_Y_UP, 0); |
| 89 | 89 |
| 90 SetCurrent(surface); | 90 SetCurrent(surface); |
| 91 InitializeDynamicBindings(); | 91 InitializeDynamicBindings(); |
| 92 | 92 |
| 93 if (!surface->OnMakeCurrent(this)) { | 93 if (!surface->OnMakeCurrent(this)) { |
| 94 LOG(ERROR) << "Could not make current."; | 94 LOG(ERROR) << "Could not make current."; |
| 95 return false; | 95 return false; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 void GLContextOSMesa::OnSetSwapInterval(int interval) { | 148 void GLContextOSMesa::OnSetSwapInterval(int interval) { |
| 149 DCHECK(IsCurrent(nullptr)); | 149 DCHECK(IsCurrent(nullptr)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 GLContextOSMesa::~GLContextOSMesa() { | 152 GLContextOSMesa::~GLContextOSMesa() { |
| 153 Destroy(); | 153 Destroy(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace gl | 156 } // namespace gl |
| OLD | NEW |