Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / gl / gl_switches.cc
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.
4
5 #include "ui/gl/gl_switches.h"
6 #include "base/basictypes.h"
7
8 namespace gfx {
9
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";
16
17 }  // namespace gfx
18
19 namespace switches {
20
21 // Disables use of D3D11.
22 const char kDisableD3D11[]                  = "disable-d3d11";
23
24 // Stop the GPU from synchronizing on the vsync before presenting.
25 const char kDisableGpuVsync[]               = "disable-gpu-vsync";
26
27 // Turns on GPU logging (debug build only).
28 const char kEnableGPUServiceLogging[]       = "enable-gpu-service-logging";
29
30 // Turns on calling TRACE for every GL call.
31 const char kEnableGPUServiceTracing[]       = "enable-gpu-service-tracing";
32
33 // Select which implementation of GL the GPU process should use. Options are:
34 //  desktop: whatever desktop OpenGL the user has installed (Linux and Mac
35 //           default).
36 //  egl: whatever EGL / GLES2 the user has installed (Windows default - actually
37 //       ANGLE).
38 //  osmesa: The OSMesa software renderer.
39 const char kUseGL[]                         = "use-gl";
40
41 const char kSwiftShaderPath[]               = "swiftshader-path";
42
43 // 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
45 // context will never be lost in any situations, say, a GPU reset.
46 const char kGpuNoContextLost[]              = "gpu-no-context-lost";
47
48 // Indicates whether the dual GPU switching is supported or not.
49 const char kSupportsDualGpus[]              = "supports-dual-gpus";
50
51 // 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.
53 const char kTestGLLib[]                     = "test-gl-lib";
54
55 // Use hardware gpu, if available, for tests.
56 const char kUseGpuInTests[] = "use-gpu-in-tests";
57
58 // On Windows only: use the WARP software rasterizer in the GPU process.
59 const char kUseWarp[] = "use-warp";
60
61 // Disables GL drawing operations which produce pixel output. With this
62 // the GL output will not be correct but tests will run faster.
63 const char kDisableGLDrawingForTests[] = "disable-gl-drawing-for-tests";
64
65 // Forces the use of OSMesa instead of hardware gpu.
66 const char kOverrideUseGLWithOSMesaForTests[] =
67     "override-use-gl-with-osmesa-for-tests";
68
69 // This is the list of switches passed from this file that are passed from the
70 // GpuProcessHost to the GPU Process. Add your switch to this list if you need
71 // to read it in the GPU process, else don't add it.
72 const char* kGLSwitchesCopiedFromGpuProcessHost[] = {
73   kDisableGpuVsync,
74   kDisableD3D11,
75   kEnableGPUServiceLogging,
76   kEnableGPUServiceTracing,
77   kGpuNoContextLost,
78   kDisableGLDrawingForTests,
79   kOverrideUseGLWithOSMesaForTests,
80   kUseWarp
81 };
82 const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches =
83     arraysize(kGLSwitchesCopiedFromGpuProcessHost);
84
85 }  // namespace switches
86