| 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 "content/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 bool GpuProcessHost::hardware_gpu_enabled_ = true; | 101 bool GpuProcessHost::hardware_gpu_enabled_ = true; |
| 102 int GpuProcessHost::gpu_crash_count_ = 0; | 102 int GpuProcessHost::gpu_crash_count_ = 0; |
| 103 int GpuProcessHost::gpu_recent_crash_count_ = 0; | 103 int GpuProcessHost::gpu_recent_crash_count_ = 0; |
| 104 bool GpuProcessHost::crashed_before_ = false; | 104 bool GpuProcessHost::crashed_before_ = false; |
| 105 int GpuProcessHost::swiftshader_crash_count_ = 0; | 105 int GpuProcessHost::swiftshader_crash_count_ = 0; |
| 106 | 106 |
| 107 namespace { | 107 namespace { |
| 108 | 108 |
| 109 // Command-line switches to propagate to the GPU process. | 109 // Command-line switches to propagate to the GPU process. |
| 110 static const char* const kSwitchNames[] = { | 110 static const char* const kSwitchNames[] = { |
| 111 switches::kDisableAcceleratedVideoDecode, | 111 switches::kDisableAcceleratedVideoDecode, |
| 112 switches::kDisableBreakpad, | 112 switches::kDisableBreakpad, |
| 113 switches::kDisableGpuSandbox, | 113 switches::kDisableGpuSandbox, |
| 114 switches::kDisableGpuWatchdog, | 114 switches::kDisableGpuWatchdog, |
| 115 switches::kDisableGLExtensions, | 115 switches::kDisableGLExtensions, |
| 116 switches::kDisableLogging, | 116 switches::kDisableLogging, |
| 117 switches::kDisableSeccompFilterSandbox, | 117 switches::kDisableSeccompFilterSandbox, |
| 118 #if defined(ENABLE_WEBRTC) | 118 #if defined(ENABLE_WEBRTC) |
| 119 switches::kDisableWebRtcHWEncoding, | 119 switches::kDisableWebRtcHWEncoding, |
| 120 #endif | 120 #endif |
| 121 #if defined(OS_WIN) | 121 #if defined(OS_WIN) |
| 122 switches::kEnableAcceleratedVpxDecode, | 122 switches::kEnableAcceleratedVpxDecode, |
| 123 switches::kEnableMFH264Encoding, | 123 switches::kEnableMFH264Encoding, |
| 124 #endif | 124 #endif |
| 125 switches::kEnableHeapProfiling, | 125 switches::kEnableHeapProfiling, |
| 126 switches::kEnableLogging, | 126 switches::kEnableLogging, |
| 127 #if defined(OS_CHROMEOS) | 127 #if defined(OS_CHROMEOS) |
| 128 switches::kDisableVaapiAcceleratedVideoEncode, | 128 switches::kDisableVaapiAcceleratedVideoEncode, |
| 129 #endif | 129 #endif |
| 130 switches::kGpuDriverBugWorkarounds, | 130 switches::kGpuDriverBugWorkarounds, |
| 131 switches::kGpuStartupDialog, | 131 switches::kGpuStartupDialog, |
| 132 switches::kGpuSandboxAllowSysVShm, | 132 switches::kGpuSandboxAllowSysVShm, |
| 133 switches::kGpuSandboxFailuresFatal, | 133 switches::kGpuSandboxFailuresFatal, |
| 134 switches::kGpuSandboxStartEarly, | 134 switches::kGpuSandboxStartEarly, |
| 135 switches::kLoggingLevel, | 135 switches::kLoggingLevel, |
| 136 switches::kEnableLowEndDeviceMode, | 136 switches::kEnableLowEndDeviceMode, |
| 137 switches::kDisableLowEndDeviceMode, | 137 switches::kDisableLowEndDeviceMode, |
| 138 switches::kEnableMemoryBenchmarking, | 138 switches::kEnableMemoryBenchmarking, |
| 139 switches::kNoSandbox, | 139 switches::kNoSandbox, |
| 140 switches::kProfilerTiming, | 140 switches::kProfilerTiming, |
| 141 switches::kTestGLLib, | 141 switches::kTestGLLib, |
| 142 switches::kTraceConfigFile, | 142 switches::kTraceConfigFile, |
| 143 switches::kTraceStartup, | 143 switches::kTraceStartup, |
| 144 switches::kTraceToConsole, | 144 switches::kTraceToConsole, |
| 145 switches::kV, | 145 switches::kUseGpuInTests, |
| 146 switches::kVModule, | 146 switches::kV, |
| 147 switches::kVModule, |
| 147 #if defined(OS_MACOSX) | 148 #if defined(OS_MACOSX) |
| 148 switches::kDisableRemoteCoreAnimation, | 149 switches::kDisableRemoteCoreAnimation, |
| 149 switches::kEnableSandboxLogging, | 150 switches::kEnableSandboxLogging, |
| 150 switches::kShowMacOverlayBorders, | 151 switches::kShowMacOverlayBorders, |
| 151 #endif | 152 #endif |
| 152 #if defined(USE_OZONE) | 153 #if defined(USE_OZONE) |
| 153 switches::kOzonePlatform, | 154 switches::kOzonePlatform, |
| 154 #endif | 155 #endif |
| 155 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 156 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 156 switches::kWindowDepth, | 157 switches::kWindowDepth, |
| 157 switches::kX11Display, | 158 switches::kX11Display, |
| 158 switches::kX11VisualID, | 159 switches::kX11VisualID, |
| 159 #endif | 160 #endif |
| 160 switches::kGpuTestingGLVendor, | 161 switches::kGpuTestingGLVendor, |
| 161 switches::kGpuTestingGLRenderer, | 162 switches::kGpuTestingGLRenderer, |
| 162 switches::kGpuTestingGLVersion, | 163 switches::kGpuTestingGLVersion, |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 enum GPUProcessLifetimeEvent { | 166 enum GPUProcessLifetimeEvent { |
| 166 LAUNCHED, | 167 LAUNCHED, |
| 167 DIED_FIRST_TIME, | 168 DIED_FIRST_TIME, |
| 168 DIED_SECOND_TIME, | 169 DIED_SECOND_TIME, |
| 169 DIED_THIRD_TIME, | 170 DIED_THIRD_TIME, |
| 170 DIED_FOURTH_TIME, | 171 DIED_FOURTH_TIME, |
| 171 GPU_PROCESS_LIFETIME_EVENT_MAX = 100 | 172 GPU_PROCESS_LIFETIME_EVENT_MAX = 100 |
| 172 }; | 173 }; |
| (...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1190 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1190 ClientIdToShaderCacheMap::iterator iter = | 1191 ClientIdToShaderCacheMap::iterator iter = |
| 1191 client_id_to_shader_cache_.find(client_id); | 1192 client_id_to_shader_cache_.find(client_id); |
| 1192 // If the cache doesn't exist then this is an off the record profile. | 1193 // If the cache doesn't exist then this is an off the record profile. |
| 1193 if (iter == client_id_to_shader_cache_.end()) | 1194 if (iter == client_id_to_shader_cache_.end()) |
| 1194 return; | 1195 return; |
| 1195 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1196 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1196 } | 1197 } |
| 1197 | 1198 |
| 1198 } // namespace content | 1199 } // namespace content |
| OLD | NEW |