| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <GL/osmesa.h> | 5 #include <GL/osmesa.h> |
| 6 | 6 |
| 7 #include "ui/gfx/gl/gl_context_osmesa.h" | 7 #include "ui/gfx/gl/gl_context_osmesa.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/gfx/gl/gl_bindings.h" | 10 #include "ui/gfx/gl/gl_bindings.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 size.height())) { | 63 size.height())) { |
| 64 LOG(ERROR) << "OSMesaMakeCurrent failed."; | 64 LOG(ERROR) << "OSMesaMakeCurrent failed."; |
| 65 Destroy(); | 65 Destroy(); |
| 66 return false; | 66 return false; |
| 67 } | 67 } |
| 68 | 68 |
| 69 // Row 0 is at the top. | 69 // Row 0 is at the top. |
| 70 OSMesaPixelStore(OSMESA_Y_UP, 0); | 70 OSMesaPixelStore(OSMESA_Y_UP, 0); |
| 71 | 71 |
| 72 SetCurrent(this, surface); | 72 SetCurrent(this, surface); |
| 73 if (!InitializeExtensionBindings()) { |
| 74 ReleaseCurrent(surface); |
| 75 return false; |
| 76 } |
| 77 |
| 73 if (!surface->OnMakeCurrent(this)) { | 78 if (!surface->OnMakeCurrent(this)) { |
| 74 LOG(ERROR) << "Could not make current."; | 79 LOG(ERROR) << "Could not make current."; |
| 75 return false; | 80 return false; |
| 76 } | 81 } |
| 77 | 82 |
| 78 return true; | 83 return true; |
| 79 } | 84 } |
| 80 | 85 |
| 81 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { | 86 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { |
| 82 if (!IsCurrent(surface)) | 87 if (!IsCurrent(surface)) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void* GLContextOSMesa::GetHandle() { | 121 void* GLContextOSMesa::GetHandle() { |
| 117 return context_; | 122 return context_; |
| 118 } | 123 } |
| 119 | 124 |
| 120 void GLContextOSMesa::SetSwapInterval(int interval) { | 125 void GLContextOSMesa::SetSwapInterval(int interval) { |
| 121 DCHECK(IsCurrent(NULL)); | 126 DCHECK(IsCurrent(NULL)); |
| 122 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; | 127 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; |
| 123 } | 128 } |
| 124 | 129 |
| 125 } // namespace gfx | 130 } // namespace gfx |
| OLD | NEW |