Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ui / gl / gl_switches.cc
blobdc217ef94056266325ac393f1da7dd886f053c9a
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
3 // found in the LICENSE file.
5 #include "ui/gl/gl_switches.h"
6 #include "base/basictypes.h"
8 namespace gfx {
10 const char kGLImplementationDesktopName[] = "desktop";
11 const char kGLImplementationOSMesaName[] = "osmesa";
12 const char kGLImplementationAppleName[] = "apple";
13 const char kGLImplementationEGLName[] = "egl";
14 const char kGLImplementationSwiftShaderName[] = "swiftshader";
15 const char kGLImplementationMockName[] = "mock";
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";
24 } // namespace gfx
26 namespace switches {
28 // Disables use of D3D11.
29 const char kDisableD3D11[] = "disable-d3d11";
31 // Stop the GPU from synchronizing on the vsync before presenting.
32 // We can select from the options below:
33 // beginframe : Next frame can start without any delay on cc::scheduler.
34 // gpu : Disable gpu vsync.
35 // default: Set both flags.
36 const char kDisableGpuVsync[] = "disable-gpu-vsync";
38 // Turns on GPU logging (debug build only).
39 const char kEnableGPUServiceLogging[] = "enable-gpu-service-logging";
41 // Turns on calling TRACE for every GL call.
42 const char kEnableGPUServiceTracing[] = "enable-gpu-service-tracing";
44 // Select which ANGLE backend to use. Options are:
45 // default: Attempts several ANGLE renderers until one successfully
46 // initializes, varying ES support by platform.
47 // d3d9: Legacy D3D9 renderer, ES2 only.
48 // d3d11: D3D11 renderer, ES2 and ES3.
49 // warp: D3D11 renderer using software rasterization, ES2 and ES3.
50 // gl: Desktop GL renderer, ES2 and ES3.
51 // gles: GLES renderer, ES2 and ES3.
52 const char kUseANGLE[] = "use-angle";
54 // Select which implementation of GL the GPU process should use. Options are:
55 // desktop: whatever desktop OpenGL the user has installed (Linux and Mac
56 // default).
57 // egl: whatever EGL / GLES2 the user has installed (Windows default - actually
58 // ANGLE).
59 // osmesa: The OSMesa software renderer.
60 const char kUseGL[] = "use-gl";
62 const char kSwiftShaderPath[] = "swiftshader-path";
64 // Inform Chrome that a GPU context will not be lost in power saving mode,
65 // screen saving mode, etc. Note that this flag does not ensure that a GPU
66 // context will never be lost in any situations, say, a GPU reset.
67 const char kGpuNoContextLost[] = "gpu-no-context-lost";
69 // Indicates whether the dual GPU switching is supported or not.
70 const char kSupportsDualGpus[] = "supports-dual-gpus";
72 // Flag used for Linux tests: for desktop GL bindings, try to load this GL
73 // library first, but fall back to regular library if loading fails.
74 const char kTestGLLib[] = "test-gl-lib";
76 // Use hardware gpu, if available, for tests.
77 const char kUseGpuInTests[] = "use-gpu-in-tests";
79 // Enable OpenGL ES 3 APIs without proper service side validation.
80 const char kEnableUnsafeES3APIs[] = "enable-unsafe-es3-apis";
82 // Disables GL drawing operations which produce pixel output. With this
83 // the GL output will not be correct but tests will run faster.
84 const char kDisableGLDrawingForTests[] = "disable-gl-drawing-for-tests";
86 // Forces the use of OSMesa instead of hardware gpu.
87 const char kOverrideUseGLWithOSMesaForTests[] =
88 "override-use-gl-with-osmesa-for-tests";
90 // Disables specified comma separated GL Extensions if found.
91 const char kDisableGLExtensions[] = "disable-gl-extensions";
93 // This is the list of switches passed from this file that are passed from the
94 // GpuProcessHost to the GPU Process. Add your switch to this list if you need
95 // to read it in the GPU process, else don't add it.
96 const char* kGLSwitchesCopiedFromGpuProcessHost[] = {
97 kDisableGpuVsync,
98 kDisableD3D11,
99 kEnableGPUServiceLogging,
100 kEnableGPUServiceTracing,
101 kEnableUnsafeES3APIs,
102 kGpuNoContextLost,
103 kDisableGLDrawingForTests,
104 kOverrideUseGLWithOSMesaForTests,
105 kUseANGLE,
107 const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches =
108 arraysize(kGLSwitchesCopiedFromGpuProcessHost);
110 } // namespace switches