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