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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Track that we're no longer in a released state to workaround a mesa issue. | 76 // Track that we're no longer in a released state to workaround a mesa issue. |
77 is_released_ = false; | 77 is_released_ = false; |
78 | 78 |
79 // Set this as soon as the context is current, since we might call into GL. | 79 // Set this as soon as the context is current, since we might call into GL. |
80 SetRealGLApi(); | 80 SetRealGLApi(); |
81 | 81 |
82 // Row 0 is at the top. | 82 // Row 0 is at the top. |
83 OSMesaPixelStore(OSMESA_Y_UP, 0); | 83 OSMesaPixelStore(OSMESA_Y_UP, 0); |
84 | 84 |
85 SetCurrent(surface); | 85 SetCurrent(surface); |
86 if (!InitializeDynamicBindings()) { | 86 InitializeDynamicBindings(); |
87 return false; | |
88 } | |
89 | 87 |
90 if (!surface->OnMakeCurrent(this)) { | 88 if (!surface->OnMakeCurrent(this)) { |
91 LOG(ERROR) << "Could not make current."; | 89 LOG(ERROR) << "Could not make current."; |
92 return false; | 90 return false; |
93 } | 91 } |
94 | 92 |
95 release_current.Cancel(); | 93 release_current.Cancel(); |
96 return true; | 94 return true; |
97 } | 95 } |
98 | 96 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 142 |
145 void GLContextOSMesa::OnSetSwapInterval(int interval) { | 143 void GLContextOSMesa::OnSetSwapInterval(int interval) { |
146 DCHECK(IsCurrent(nullptr)); | 144 DCHECK(IsCurrent(nullptr)); |
147 } | 145 } |
148 | 146 |
149 GLContextOSMesa::~GLContextOSMesa() { | 147 GLContextOSMesa::~GLContextOSMesa() { |
150 Destroy(); | 148 Destroy(); |
151 } | 149 } |
152 | 150 |
153 } // namespace gl | 151 } // namespace gl |
OLD | NEW |