| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 bool GLContextOSMesa::Initialize(GLSurface* compatible_surface) { | 24 bool GLContextOSMesa::Initialize(GLSurface* compatible_surface) { |
| 25 DCHECK(!context_); | 25 DCHECK(!context_); |
| 26 | 26 |
| 27 OSMesaContext share_handle = static_cast<OSMesaContext>( | 27 OSMesaContext share_handle = static_cast<OSMesaContext>( |
| 28 share_group() ? share_group()->GetHandle() : NULL); | 28 share_group() ? share_group()->GetHandle() : NULL); |
| 29 | 29 |
| 30 GLuint format = | 30 GLuint format = |
| 31 static_cast<GLSurfaceOSMesa*>(compatible_surface)->GetFormat(); | 31 static_cast<GLSurfaceOSMesa*>(compatible_surface)->GetFormat(); |
| 32 context_ = OSMesaCreateContextExt(format, | 32 context_ = OSMesaCreateContextExt(format, |
| 33 24, // depth bits | 33 0, // depth bits |
| 34 8, // stencil bits | 34 0, // stencil bits |
| 35 0, // accum bits | 35 0, // accum bits |
| 36 share_handle); | 36 share_handle); |
| 37 if (!context_) { | 37 if (!context_) { |
| 38 LOG(ERROR) << "OSMesaCreateContextExt failed."; | 38 LOG(ERROR) << "OSMesaCreateContextExt failed."; |
| 39 return false; | 39 return false; |
| 40 } | 40 } |
| 41 | 41 |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void* GLContextOSMesa::GetHandle() { | 99 void* GLContextOSMesa::GetHandle() { |
| 100 return context_; | 100 return context_; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void GLContextOSMesa::SetSwapInterval(int interval) { | 103 void GLContextOSMesa::SetSwapInterval(int interval) { |
| 104 DCHECK(IsCurrent(NULL)); | 104 DCHECK(IsCurrent(NULL)); |
| 105 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; | 105 LOG(WARNING) << "GLContextOSMesa::SetSwapInterval is ignored."; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace gfx | 108 } // namespace gfx |
| OLD | NEW |