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_switches.h" | 5 #include "ui/gl/gl_switches.h" |
6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
7 | 7 |
8 namespace gfx { | 8 namespace gfx { |
9 | 9 |
10 const char kGLImplementationDesktopName[] = "desktop"; | 10 const char kGLImplementationDesktopName[] = "desktop"; |
11 const char kGLImplementationOSMesaName[] = "osmesa"; | 11 const char kGLImplementationOSMesaName[] = "osmesa"; |
12 const char kGLImplementationAppleName[] = "apple"; | 12 const char kGLImplementationAppleName[] = "apple"; |
13 const char kGLImplementationEGLName[] = "egl"; | 13 const char kGLImplementationEGLName[] = "egl"; |
14 const char kGLImplementationSwiftShaderName[] = "swiftshader"; | 14 const char kGLImplementationSwiftShaderName[] = "swiftshader"; |
15 const char kGLImplementationMockName[] = "mock"; | 15 const char kGLImplementationMockName[] = "mock"; |
16 | 16 |
17 const char kANGLEImplementationDefaultName[] = "default"; | |
18 const char kANGLEImplementationD3D9Name[] = "d3d9"; | |
19 const char kANGLEImplementationD3D11Name[] = "d3d11"; | |
20 const char kANGLEImplementationWARPName[] = "warp"; | |
21 const char kANGLEImplementationOpenGLName[] = "gl"; | |
22 const char kANGLEImplementationOpenGLESName[] = "gles"; | |
23 | |
17 } // namespace gfx | 24 } // namespace gfx |
18 | 25 |
19 namespace switches { | 26 namespace switches { |
20 | 27 |
21 // Disables use of D3D11. | 28 // Disables use of D3D11. |
22 const char kDisableD3D11[] = "disable-d3d11"; | 29 const char kDisableD3D11[] = "disable-d3d11"; |
23 | 30 |
24 // Stop the GPU from synchronizing on the vsync before presenting. | 31 // Stop the GPU from synchronizing on the vsync before presenting. |
25 const char kDisableGpuVsync[] = "disable-gpu-vsync"; | 32 const char kDisableGpuVsync[] = "disable-gpu-vsync"; |
26 | 33 |
27 // Turns on GPU logging (debug build only). | 34 // Turns on GPU logging (debug build only). |
28 const char kEnableGPUServiceLogging[] = "enable-gpu-service-logging"; | 35 const char kEnableGPUServiceLogging[] = "enable-gpu-service-logging"; |
29 | 36 |
30 // Turns on calling TRACE for every GL call. | 37 // Turns on calling TRACE for every GL call. |
31 const char kEnableGPUServiceTracing[] = "enable-gpu-service-tracing"; | 38 const char kEnableGPUServiceTracing[] = "enable-gpu-service-tracing"; |
32 | 39 |
40 // Select which ANGLE backend to use. Options are: | |
41 // default: Attempts several ANGLE renderers until one successfully | |
42 // initializes, varying ES support by platform. | |
43 // d3d9: Legacy D3D9 renderer, ES2 only. | |
44 // d3d11: D3D11 renderer, ES2 and ES3. | |
45 // warp: D3D11 renderer using software rasterization, ES2 and ES3. | |
46 // gl: Desktop GL renderer, ES2 and ES3. | |
47 // gles: GLES renderer, ES2 and ES3. | |
48 const char kUseANGLE[] = "use-angle"; | |
49 | |
33 // Select which implementation of GL the GPU process should use. Options are: | 50 // Select which implementation of GL the GPU process should use. Options are: |
34 // desktop: whatever desktop OpenGL the user has installed (Linux and Mac | 51 // desktop: whatever desktop OpenGL the user has installed (Linux and Mac |
35 // default). | 52 // default). |
36 // egl: whatever EGL / GLES2 the user has installed (Windows default - actually | 53 // egl: whatever EGL / GLES2 the user has installed (Windows default - actually |
37 // ANGLE). | 54 // ANGLE). |
38 // osmesa: The OSMesa software renderer. | 55 // osmesa: The OSMesa software renderer. |
39 const char kUseGL[] = "use-gl"; | 56 const char kUseGL[] = "use-gl"; |
40 | 57 |
41 const char kSwiftShaderPath[] = "swiftshader-path"; | 58 const char kSwiftShaderPath[] = "swiftshader-path"; |
42 | 59 |
43 // Inform Chrome that a GPU context will not be lost in power saving mode, | 60 // Inform Chrome that a GPU context will not be lost in power saving mode, |
44 // screen saving mode, etc. Note that this flag does not ensure that a GPU | 61 // screen saving mode, etc. Note that this flag does not ensure that a GPU |
45 // context will never be lost in any situations, say, a GPU reset. | 62 // context will never be lost in any situations, say, a GPU reset. |
46 const char kGpuNoContextLost[] = "gpu-no-context-lost"; | 63 const char kGpuNoContextLost[] = "gpu-no-context-lost"; |
47 | 64 |
48 // Indicates whether the dual GPU switching is supported or not. | 65 // Indicates whether the dual GPU switching is supported or not. |
49 const char kSupportsDualGpus[] = "supports-dual-gpus"; | 66 const char kSupportsDualGpus[] = "supports-dual-gpus"; |
50 | 67 |
51 // Flag used for Linux tests: for desktop GL bindings, try to load this GL | 68 // Flag used for Linux tests: for desktop GL bindings, try to load this GL |
52 // library first, but fall back to regular library if loading fails. | 69 // library first, but fall back to regular library if loading fails. |
53 const char kTestGLLib[] = "test-gl-lib"; | 70 const char kTestGLLib[] = "test-gl-lib"; |
54 | 71 |
55 // Use hardware gpu, if available, for tests. | 72 // Use hardware gpu, if available, for tests. |
56 const char kUseGpuInTests[] = "use-gpu-in-tests"; | 73 const char kUseGpuInTests[] = "use-gpu-in-tests"; |
57 | 74 |
58 // On Windows only: use the WARP software rasterizer in the GPU process. | |
59 const char kUseWarp[] = "use-warp"; | |
Jamie Madill
2015/05/07 18:53:13
you might want to check with someone about disabli
| |
60 | |
61 // Enable OpenGL ES 3 APIs without proper service side validation. | 75 // Enable OpenGL ES 3 APIs without proper service side validation. |
62 const char kEnableUnsafeES3APIs[] = "enable-unsafe-es3-apis"; | 76 const char kEnableUnsafeES3APIs[] = "enable-unsafe-es3-apis"; |
63 | 77 |
64 // Disables GL drawing operations which produce pixel output. With this | 78 // Disables GL drawing operations which produce pixel output. With this |
65 // the GL output will not be correct but tests will run faster. | 79 // the GL output will not be correct but tests will run faster. |
66 const char kDisableGLDrawingForTests[] = "disable-gl-drawing-for-tests"; | 80 const char kDisableGLDrawingForTests[] = "disable-gl-drawing-for-tests"; |
67 | 81 |
68 // Forces the use of OSMesa instead of hardware gpu. | 82 // Forces the use of OSMesa instead of hardware gpu. |
69 const char kOverrideUseGLWithOSMesaForTests[] = | 83 const char kOverrideUseGLWithOSMesaForTests[] = |
70 "override-use-gl-with-osmesa-for-tests"; | 84 "override-use-gl-with-osmesa-for-tests"; |
71 | 85 |
72 // This is the list of switches passed from this file that are passed from the | 86 // This is the list of switches passed from this file that are passed from the |
73 // GpuProcessHost to the GPU Process. Add your switch to this list if you need | 87 // GpuProcessHost to the GPU Process. Add your switch to this list if you need |
74 // to read it in the GPU process, else don't add it. | 88 // to read it in the GPU process, else don't add it. |
75 const char* kGLSwitchesCopiedFromGpuProcessHost[] = { | 89 const char* kGLSwitchesCopiedFromGpuProcessHost[] = { |
76 kDisableGpuVsync, | 90 kDisableGpuVsync, |
77 kDisableD3D11, | 91 kDisableD3D11, |
78 kEnableGPUServiceLogging, | 92 kEnableGPUServiceLogging, |
79 kEnableGPUServiceTracing, | 93 kEnableGPUServiceTracing, |
80 kEnableUnsafeES3APIs, | 94 kEnableUnsafeES3APIs, |
81 kGpuNoContextLost, | 95 kGpuNoContextLost, |
82 kDisableGLDrawingForTests, | 96 kDisableGLDrawingForTests, |
83 kOverrideUseGLWithOSMesaForTests, | 97 kOverrideUseGLWithOSMesaForTests, |
84 kUseWarp, | 98 kUseANGLE, |
85 }; | 99 }; |
86 const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches = | 100 const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches = |
87 arraysize(kGLSwitchesCopiedFromGpuProcessHost); | 101 arraysize(kGLSwitchesCopiedFromGpuProcessHost); |
88 | 102 |
89 } // namespace switches | 103 } // namespace switches |
90 | 104 |
OLD | NEW |