| 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 OSMesaPixelStore(OSMESA_Y_UP, 0); | 69 OSMesaPixelStore(OSMESA_Y_UP, 0); |
| 70 | 70 |
| 71 SetCurrent(surface); | 71 SetCurrent(surface); |
| 72 if (!InitializeExtensionBindings()) { | 72 if (!InitializeExtensionBindings()) { |
| 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 ReleaseCurrent(surface); |
| 79 return false; | 80 return false; |
| 80 } | 81 } |
| 81 | 82 |
| 82 return true; | 83 return true; |
| 83 } | 84 } |
| 84 | 85 |
| 85 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { | 86 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { |
| 86 if (!IsCurrent(surface)) | 87 if (!IsCurrent(surface)) |
| 87 return; | 88 return; |
| 88 | 89 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 124 |
| 124 void GLContextOSMesa::SetSwapInterval(int interval) { | 125 void GLContextOSMesa::SetSwapInterval(int interval) { |
| 125 DCHECK(IsCurrent(NULL)); | 126 DCHECK(IsCurrent(NULL)); |
| 126 } | 127 } |
| 127 | 128 |
| 128 GLContextOSMesa::~GLContextOSMesa() { | 129 GLContextOSMesa::~GLContextOSMesa() { |
| 129 Destroy(); | 130 Destroy(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 } // namespace gfx | 133 } // namespace gfx |
| OLD | NEW |