| 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 "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #include "base/win/windows_version.h" | 47 #include "base/win/windows_version.h" |
| 48 #include "content/common/sandbox_win.h" | 48 #include "content/common/sandbox_win.h" |
| 49 #include "sandbox/win/src/sandbox_policy.h" | 49 #include "sandbox/win/src/sandbox_policy.h" |
| 50 #include "ui/gfx/switches.h" | 50 #include "ui/gfx/switches.h" |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 #if defined(USE_OZONE) | 53 #if defined(USE_OZONE) |
| 54 #include "ui/ozone/ozone_switches.h" | 54 #include "ui/ozone/ozone_switches.h" |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 58 #include "ui/gfx/x/x11_switches.h" |
| 59 #endif |
| 60 |
| 57 namespace content { | 61 namespace content { |
| 58 | 62 |
| 59 bool GpuProcessHost::gpu_enabled_ = true; | 63 bool GpuProcessHost::gpu_enabled_ = true; |
| 60 bool GpuProcessHost::hardware_gpu_enabled_ = true; | 64 bool GpuProcessHost::hardware_gpu_enabled_ = true; |
| 61 | 65 |
| 62 namespace { | 66 namespace { |
| 63 | 67 |
| 64 enum GPUProcessLifetimeEvent { | 68 enum GPUProcessLifetimeEvent { |
| 65 LAUNCHED, | 69 LAUNCHED, |
| 66 DIED_FIRST_TIME, | 70 DIED_FIRST_TIME, |
| (...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 947 switches::kVModule, | 951 switches::kVModule, |
| 948 #if defined(OS_MACOSX) | 952 #if defined(OS_MACOSX) |
| 949 switches::kEnableSandboxLogging, | 953 switches::kEnableSandboxLogging, |
| 950 #endif | 954 #endif |
| 951 #if defined(USE_AURA) | 955 #if defined(USE_AURA) |
| 952 switches::kUIPrioritizeInGpuProcess, | 956 switches::kUIPrioritizeInGpuProcess, |
| 953 #endif | 957 #endif |
| 954 #if defined(USE_OZONE) | 958 #if defined(USE_OZONE) |
| 955 switches::kOzonePlatform, | 959 switches::kOzonePlatform, |
| 956 #endif | 960 #endif |
| 961 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 962 switches::kX11Display, |
| 963 #endif |
| 957 }; | 964 }; |
| 958 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 965 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
| 959 arraysize(kSwitchNames)); | 966 arraysize(kSwitchNames)); |
| 960 cmd_line->CopySwitchesFrom( | 967 cmd_line->CopySwitchesFrom( |
| 961 browser_command_line, switches::kGpuSwitches, switches::kNumGpuSwitches); | 968 browser_command_line, switches::kGpuSwitches, switches::kNumGpuSwitches); |
| 962 cmd_line->CopySwitchesFrom( | 969 cmd_line->CopySwitchesFrom( |
| 963 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost, | 970 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost, |
| 964 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches); | 971 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches); |
| 965 | 972 |
| 966 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 973 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1069 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1063 ClientIdToShaderCacheMap::iterator iter = | 1070 ClientIdToShaderCacheMap::iterator iter = |
| 1064 client_id_to_shader_cache_.find(client_id); | 1071 client_id_to_shader_cache_.find(client_id); |
| 1065 // If the cache doesn't exist then this is an off the record profile. | 1072 // If the cache doesn't exist then this is an off the record profile. |
| 1066 if (iter == client_id_to_shader_cache_.end()) | 1073 if (iter == client_id_to_shader_cache_.end()) |
| 1067 return; | 1074 return; |
| 1068 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1075 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1069 } | 1076 } |
| 1070 | 1077 |
| 1071 } // namespace content | 1078 } // namespace content |
| OLD | NEW |