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 const char kEnableGPUClientLogging[] = "enable-gpu-client-logging"; 30 31 // Turns on calling TRACE for every GL call. 32 const char kEnableGPUServiceTracing[] = "enable-gpu-service-tracing"; 33 34 // Select which implementation of GL the GPU process should use. Options are: 35 // desktop: whatever desktop OpenGL the user has installed (Linux and Mac 36 // default). 37 // egl: whatever EGL / GLES2 the user has installed (Windows default - actually 38 // ANGLE). 39 // osmesa: The OSMesa software renderer. 40 const char kUseGL[] = "use-gl"; 41 42 const char kSwiftShaderPath[] = "swiftshader-path"; 43 44 // Inform Chrome that a GPU context will not be lost in power saving mode, 45 // screen saving mode, etc. Note that this flag does not ensure that a GPU 46 // context will never be lost in any situations, say, a GPU reset. 47 const char kGpuNoContextLost[] = "gpu-no-context-lost"; 48 49 // Add a delay in milliseconds to the gpu swap buffer completion signal. 50 // Simulates a slow GPU. 51 const char kGpuSwapDelay[] = "gpu-swap-delay"; 52 53 // Indicates whether the dual GPU switching is supported or not. 54 const char kSupportsDualGpus[] = "supports-dual-gpus"; 55 56 // Overwrite the default GPU automatic switching behavior to force on 57 // integrated GPU or discrete GPU. 58 const char kGpuSwitching[] = "gpu-switching"; 59 60 const char kGpuSwitchingOptionNameForceIntegrated[] = "force_integrated"; 61 const char kGpuSwitchingOptionNameForceDiscrete[] = "force_discrete"; 62 const char kGpuSwitchingOptionNameAutomatic[] = "automatic"; 63 64 // Flag used for Linux tests: for desktop GL bindings, try to load this GL 65 // library first, but fall back to regular library if loading fails. 66 const char kTestGLLib[] = "test-gl-lib"; 67 68 // This is the list of switches passed from this file that are passed from the 69 // GpuProcessHost to the GPU Process. Add your switch to this list if you need 70 // to read it in the GPU process, else don't add it. 71 const char* kGLSwitchesCopiedFromGpuProcessHost[] = { 72 kDisableGpuVsync, 73 kDisableD3D11, 74 kEnableGPUServiceLogging, 75 kEnableGPUServiceTracing, 76 kGpuNoContextLost, 77 kGpuSwitching, 78 }; 79 const int kGLSwitchesCopiedFromGpuProcessHostNumSwitches = 80 arraysize(kGLSwitchesCopiedFromGpuProcessHost); 81 82 } // namespace switches 83 84