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_surface_osmesa.h" |
| 6 |
| 7 #include <algorithm> |
| 8 |
5 #include "base/logging.h" | 9 #include "base/logging.h" |
6 #include "base/numerics/safe_math.h" | 10 #include "base/numerics/safe_math.h" |
7 #include "third_party/mesa/src/include/GL/osmesa.h" | 11 #include "third_party/mesa/src/include/GL/osmesa.h" |
8 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
9 #include "ui/gl/gl_context.h" | 13 #include "ui/gl/gl_context.h" |
10 #include "ui/gl/gl_surface_osmesa.h" | |
11 #include "ui/gl/scoped_make_current.h" | 14 #include "ui/gl/scoped_make_current.h" |
12 | 15 |
13 namespace gfx { | 16 namespace gfx { |
14 | 17 |
15 GLSurfaceOSMesa::GLSurfaceOSMesa(OSMesaSurfaceFormat format, | 18 GLSurfaceOSMesa::GLSurfaceOSMesa(OSMesaSurfaceFormat format, |
16 const gfx::Size& size) | 19 const gfx::Size& size) |
17 : size_(size) { | 20 : size_(size) { |
18 switch (format) { | 21 switch (format) { |
19 case OSMesaSurfaceFormatBGRA: | 22 case OSMesaSurfaceFormatBGRA: |
20 format_ = OSMESA_BGRA; | 23 format_ = OSMESA_BGRA; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return gfx::SwapResult::SWAP_ACK; | 114 return gfx::SwapResult::SWAP_ACK; |
112 } | 115 } |
113 | 116 |
114 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless() | 117 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless() |
115 : GLSurfaceOSMesa(OSMesaSurfaceFormatBGRA, gfx::Size(1, 1)) { | 118 : GLSurfaceOSMesa(OSMesaSurfaceFormatBGRA, gfx::Size(1, 1)) { |
116 } | 119 } |
117 | 120 |
118 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } | 121 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } |
119 | 122 |
120 } // namespace gfx | 123 } // namespace gfx |
OLD | NEW |