| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 size.width(), | 60 size.width(), |
| 61 size.height())) { | 61 size.height())) { |
| 62 LOG(ERROR) << "OSMesaMakeCurrent failed."; | 62 LOG(ERROR) << "OSMesaMakeCurrent failed."; |
| 63 Destroy(); | 63 Destroy(); |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 // Row 0 is at the top. | 67 // Row 0 is at the top. |
| 68 OSMesaPixelStore(OSMESA_Y_UP, 0); | 68 OSMesaPixelStore(OSMESA_Y_UP, 0); |
| 69 | 69 |
| 70 surface->OnMakeCurrent(); |
| 70 return true; | 71 return true; |
| 71 } | 72 } |
| 72 | 73 |
| 73 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { | 74 void GLContextOSMesa::ReleaseCurrent(GLSurface* surface) { |
| 74 if (!IsCurrent(surface)) | 75 if (!IsCurrent(surface)) |
| 75 return; | 76 return; |
| 76 | 77 |
| 77 OSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0); | 78 OSMesaMakeCurrent(NULL, NULL, GL_UNSIGNED_BYTE, 0, 0); |
| 78 } | 79 } |
| 79 | 80 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 98 void* GLContextOSMesa::GetHandle() { | 99 void* GLContextOSMesa::GetHandle() { |
| 99 return context_; | 100 return context_; |
| 100 } | 101 } |
| 101 | 102 |
| 102 void GLContextOSMesa::SetSwapInterval(int interval) { | 103 void GLContextOSMesa::SetSwapInterval(int interval) { |
| 103 DCHECK(IsCurrent(NULL)); | 104 DCHECK(IsCurrent(NULL)); |
| 104 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; | 105 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; |
| 105 } | 106 } |
| 106 | 107 |
| 107 } // namespace gfx | 108 } // namespace gfx |
| OLD | NEW |