Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(680)

Side by Side Diff: ui/gl/gl_surface_osmesa.cc

Issue 1998723002: Move code in ui/gl/* from gfx:: to gl:: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_surface_osmesa.h ('k') | ui/gl/gl_surface_overlay.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 5 #include "ui/gl/gl_surface_osmesa.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/numerics/safe_math.h" 10 #include "base/numerics/safe_math.h"
11 #include "third_party/mesa/src/include/GL/osmesa.h" 11 #include "third_party/mesa/src/include/GL/osmesa.h"
12 #include "ui/gl/gl_bindings.h" 12 #include "ui/gl/gl_bindings.h"
13 #include "ui/gl/gl_context.h" 13 #include "ui/gl/gl_context.h"
14 #include "ui/gl/scoped_make_current.h" 14 #include "ui/gl/scoped_make_current.h"
15 15
16 namespace gfx { 16 namespace gl {
17 17
18 GLSurfaceOSMesa::GLSurfaceOSMesa(GLSurface::Format format, 18 GLSurfaceOSMesa::GLSurfaceOSMesa(GLSurface::Format format,
19 const gfx::Size& size) 19 const gfx::Size& size)
20 : size_(size), 20 : size_(size),
21 format_(format) { 21 format_(format) {
22 // Implementations of OSMesa surface do not support having a 0 size. In such 22 // Implementations of OSMesa surface do not support having a 0 size. In such
23 // cases use a (1, 1) surface. 23 // cases use a (1, 1) surface.
24 if (size_.GetArea() == 0) 24 if (size_.GetArea() == 0)
25 size_.SetSize(1, 1); 25 size_.SetSize(1, 1);
26 } 26 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 gfx::SwapResult GLSurfaceOSMesaHeadless::SwapBuffers() { 108 gfx::SwapResult GLSurfaceOSMesaHeadless::SwapBuffers() {
109 return gfx::SwapResult::SWAP_ACK; 109 return gfx::SwapResult::SWAP_ACK;
110 } 110 }
111 111
112 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless() 112 GLSurfaceOSMesaHeadless::GLSurfaceOSMesaHeadless()
113 : GLSurfaceOSMesa(SURFACE_OSMESA_BGRA, gfx::Size(1, 1)) { 113 : GLSurfaceOSMesa(SURFACE_OSMESA_BGRA, gfx::Size(1, 1)) {
114 } 114 }
115 115
116 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); } 116 GLSurfaceOSMesaHeadless::~GLSurfaceOSMesaHeadless() { Destroy(); }
117 117
118 } // namespace gfx 118 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_osmesa.h ('k') | ui/gl/gl_surface_overlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698