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

Side by Side Diff: ui/gl/gl_implementation_x11.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_implementation_win.cc ('k') | ui/gl/gl_mock.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 <vector> 5 #include <vector>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
11 #include "build/build_config.h" 11 #include "build/build_config.h"
12 #include "ui/gl/gl_bindings.h" 12 #include "ui/gl/gl_bindings.h"
13 #include "ui/gl/gl_context_stub_with_extensions.h" 13 #include "ui/gl/gl_context_stub_with_extensions.h"
14 #include "ui/gl/gl_egl_api_implementation.h" 14 #include "ui/gl/gl_egl_api_implementation.h"
15 #include "ui/gl/gl_gl_api_implementation.h" 15 #include "ui/gl/gl_gl_api_implementation.h"
16 #include "ui/gl/gl_glx_api_implementation.h" 16 #include "ui/gl/gl_glx_api_implementation.h"
17 #include "ui/gl/gl_implementation.h" 17 #include "ui/gl/gl_implementation.h"
18 #include "ui/gl/gl_implementation_osmesa.h" 18 #include "ui/gl/gl_implementation_osmesa.h"
19 #include "ui/gl/gl_osmesa_api_implementation.h" 19 #include "ui/gl/gl_osmesa_api_implementation.h"
20 #include "ui/gl/gl_switches.h" 20 #include "ui/gl/gl_switches.h"
21 21
22 namespace gfx { 22 namespace gl {
23 namespace { 23 namespace {
24 24
25 // TODO(piman): it should be Desktop GL marshalling from double to float. Today 25 // TODO(piman): it should be Desktop GL marshalling from double to float. Today
26 // on native GLES, we do float->double->float. 26 // on native GLES, we do float->double->float.
27 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) { 27 void GL_BINDING_CALL MarshalClearDepthToClearDepthf(GLclampd depth) {
28 glClearDepthf(static_cast<GLclampf>(depth)); 28 glClearDepthf(static_cast<GLclampf>(depth));
29 } 29 }
30 30
31 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, 31 void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near,
32 GLclampd z_far) { 32 GLclampd z_far) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 SetGLGetProcAddressProc(get_proc_address); 141 SetGLGetProcAddressProc(get_proc_address);
142 AddGLNativeLibrary(egl_library); 142 AddGLNativeLibrary(egl_library);
143 AddGLNativeLibrary(gles_library); 143 AddGLNativeLibrary(gles_library);
144 SetGLImplementation(kGLImplementationEGLGLES2); 144 SetGLImplementation(kGLImplementationEGLGLES2);
145 145
146 InitializeStaticGLBindingsGL(); 146 InitializeStaticGLBindingsGL();
147 InitializeStaticGLBindingsEGL(); 147 InitializeStaticGLBindingsEGL();
148 148
149 // These two functions take single precision float rather than double 149 // These two functions take single precision float rather than double
150 // precision float parameters in GLES. 150 // precision float parameters in GLES.
151 ::gfx::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf; 151 ::gl::g_driver_gl.fn.glClearDepthFn = MarshalClearDepthToClearDepthf;
152 ::gfx::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef; 152 ::gl::g_driver_gl.fn.glDepthRangeFn = MarshalDepthRangeToDepthRangef;
153 break; 153 break;
154 } 154 }
155 case kGLImplementationMockGL: { 155 case kGLImplementationMockGL: {
156 SetGLImplementation(kGLImplementationMockGL); 156 SetGLImplementation(kGLImplementationMockGL);
157 InitializeStaticGLBindingsGL(); 157 InitializeStaticGLBindingsGL();
158 break; 158 break;
159 } 159 }
160 default: 160 default:
161 return false; 161 return false;
162 } 162 }
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 case kGLImplementationDesktopGL: 211 case kGLImplementationDesktopGL:
212 return GetGLWindowSystemBindingInfoGLX(info); 212 return GetGLWindowSystemBindingInfoGLX(info);
213 case kGLImplementationEGLGLES2: 213 case kGLImplementationEGLGLES2:
214 return GetGLWindowSystemBindingInfoEGL(info); 214 return GetGLWindowSystemBindingInfoEGL(info);
215 default: 215 default:
216 return false; 216 return false;
217 } 217 }
218 return false; 218 return false;
219 } 219 }
220 220
221 } // namespace gfx 221 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_implementation_win.cc ('k') | ui/gl/gl_mock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698