| 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 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 cmd_line->CopySwitchesFrom( | 1032 cmd_line->CopySwitchesFrom( |
| 1033 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost, | 1033 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost, |
| 1034 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches); | 1034 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches); |
| 1035 | 1035 |
| 1036 GetContentClient()->browser()->AppendExtraCommandLineSwitches( | 1036 GetContentClient()->browser()->AppendExtraCommandLineSwitches( |
| 1037 cmd_line.get(), process_->GetData().id); | 1037 cmd_line.get(), process_->GetData().id); |
| 1038 | 1038 |
| 1039 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line.get(), | 1039 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line.get(), |
| 1040 gpu_preferences); | 1040 gpu_preferences); |
| 1041 if (cmd_line->HasSwitch(switches::kUseGL)) { | 1041 if (cmd_line->HasSwitch(switches::kUseGL)) { |
| 1042 swiftshader_rendering_ = | 1042 swiftshader_rendering_ = (cmd_line->GetSwitchValueASCII(switches::kUseGL) == |
| 1043 (cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); | 1043 gl::kGLImplementationSwiftShaderForWebGLName); |
| 1044 } | 1044 } |
| 1045 | 1045 |
| 1046 bool current_gpu_type_enabled = | 1046 bool current_gpu_type_enabled = |
| 1047 swiftshader_rendering_ ? gpu_enabled_ : hardware_gpu_enabled_; | 1047 swiftshader_rendering_ ? gpu_enabled_ : hardware_gpu_enabled_; |
| 1048 if (!current_gpu_type_enabled) { | 1048 if (!current_gpu_type_enabled) { |
| 1049 SendOutstandingReplies(); | 1049 SendOutstandingReplies(); |
| 1050 return false; | 1050 return false; |
| 1051 } | 1051 } |
| 1052 | 1052 |
| 1053 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessSoftwareRendering", | 1053 UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessSoftwareRendering", |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 GetShaderCacheFactorySingleton()->Get(client_id); | 1196 GetShaderCacheFactorySingleton()->Get(client_id); |
| 1197 if (!cache.get()) | 1197 if (!cache.get()) |
| 1198 return; | 1198 return; |
| 1199 | 1199 |
| 1200 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); | 1200 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); |
| 1201 | 1201 |
| 1202 client_id_to_shader_cache_[client_id] = cache; | 1202 client_id_to_shader_cache_[client_id] = cache; |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 } // namespace content | 1205 } // namespace content |
| OLD | NEW |