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/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // supported. | 25 // supported. |
26 DCHECK(!attribs.webgl_compatibility_context && | 26 DCHECK(!attribs.webgl_compatibility_context && |
27 attribs.bind_generates_resource); | 27 attribs.bind_generates_resource); |
28 | 28 |
29 DCHECK(!context_); | 29 DCHECK(!context_); |
30 | 30 |
31 OSMesaContext share_handle = static_cast<OSMesaContext>( | 31 OSMesaContext share_handle = static_cast<OSMesaContext>( |
32 share_group() ? share_group()->GetHandle() : nullptr); | 32 share_group() ? share_group()->GetHandle() : nullptr); |
33 | 33 |
34 GLuint format = 0; | 34 GLuint format = 0; |
35 switch (compatible_surface->GetFormat()) { | 35 switch (compatible_surface->GetFormat().GetPixelLayout()) { |
36 case GLSurface::SURFACE_OSMESA_BGRA: | 36 case GLSurfaceFormat::PIXEL_LAYOUT_BGRA: |
37 format = OSMESA_BGRA; | 37 format = OSMESA_BGRA; |
38 break; | 38 break; |
39 case GLSurface::SURFACE_OSMESA_RGBA: | 39 case GLSurfaceFormat::PIXEL_LAYOUT_RGBA: |
40 format = OSMESA_RGBA; | 40 format = OSMESA_RGBA; |
41 break; | 41 break; |
42 default: | 42 default: |
43 NOTREACHED(); | 43 NOTREACHED(); |
44 return false; | 44 return false; |
45 } | 45 } |
46 context_ = OSMesaCreateContextExt(format, | 46 context_ = OSMesaCreateContextExt(format, |
47 0, // depth bits | 47 0, // depth bits |
48 0, // stencil bits | 48 0, // stencil bits |
49 0, // accum bits | 49 0, // accum bits |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 void GLContextOSMesa::OnSetSwapInterval(int interval) { | 148 void GLContextOSMesa::OnSetSwapInterval(int interval) { |
149 DCHECK(IsCurrent(nullptr)); | 149 DCHECK(IsCurrent(nullptr)); |
150 } | 150 } |
151 | 151 |
152 GLContextOSMesa::~GLContextOSMesa() { | 152 GLContextOSMesa::~GLContextOSMesa() { |
153 Destroy(); | 153 Destroy(); |
154 } | 154 } |
155 | 155 |
156 } // namespace gl | 156 } // namespace gl |
OLD | NEW |