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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 return false; | 62 return false; |
63 } | 63 } |
64 | 64 |
65 // Set this as soon as the context is current, since we might call into GL. | 65 // Set this as soon as the context is current, since we might call into GL. |
66 SetRealGLApi(); | 66 SetRealGLApi(); |
67 | 67 |
68 // Row 0 is at the top. | 68 // Row 0 is at the top. |
69 OSMesaPixelStore(OSMESA_Y_UP, 0); | 69 OSMesaPixelStore(OSMESA_Y_UP, 0); |
70 | 70 |
71 SetCurrent(surface); | 71 SetCurrent(surface); |
72 if (!InitializeExtensionBindings()) { | 72 if (!InitializeDynamicBindings()) { |
73 ReleaseCurrent(surface); | 73 ReleaseCurrent(surface); |
74 return false; | 74 return false; |
75 } | 75 } |
76 | 76 |
77 if (!surface->OnMakeCurrent(this)) { | 77 if (!surface->OnMakeCurrent(this)) { |
78 LOG(ERROR) << "Could not make current."; | 78 LOG(ERROR) << "Could not make current."; |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
82 return true; | 82 return true; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 123 |
124 void GLContextOSMesa::SetSwapInterval(int interval) { | 124 void GLContextOSMesa::SetSwapInterval(int interval) { |
125 DCHECK(IsCurrent(NULL)); | 125 DCHECK(IsCurrent(NULL)); |
126 } | 126 } |
127 | 127 |
128 GLContextOSMesa::~GLContextOSMesa() { | 128 GLContextOSMesa::~GLContextOSMesa() { |
129 Destroy(); | 129 Destroy(); |
130 } | 130 } |
131 | 131 |
132 } // namespace gfx | 132 } // namespace gfx |
OLD | NEW |