Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 2671773003: Copy GPU workaround flags from browser to GPU process (Closed)
Patch Set: fix test on certain systems Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/gpu_process_integration_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "content/public/common/content_client.h" 50 #include "content/public/common/content_client.h"
51 #include "content/public/common/content_switches.h" 51 #include "content/public/common/content_switches.h"
52 #include "content/public/common/mojo_channel_switches.h" 52 #include "content/public/common/mojo_channel_switches.h"
53 #include "content/public/common/result_codes.h" 53 #include "content/public/common/result_codes.h"
54 #include "content/public/common/sandbox_type.h" 54 #include "content/public/common/sandbox_type.h"
55 #include "content/public/common/sandboxed_process_launcher_delegate.h" 55 #include "content/public/common/sandboxed_process_launcher_delegate.h"
56 #include "content/public/common/service_manager_connection.h" 56 #include "content/public/common/service_manager_connection.h"
57 #include "content/public/common/service_names.mojom.h" 57 #include "content/public/common/service_names.mojom.h"
58 #include "gpu/command_buffer/service/gpu_preferences.h" 58 #include "gpu/command_buffer/service/gpu_preferences.h"
59 #include "gpu/command_buffer/service/gpu_switches.h" 59 #include "gpu/command_buffer/service/gpu_switches.h"
60 #include "gpu/config/gpu_driver_bug_list.h"
60 #include "gpu/ipc/host/shader_disk_cache.h" 61 #include "gpu/ipc/host/shader_disk_cache.h"
61 #include "gpu/ipc/service/switches.h" 62 #include "gpu/ipc/service/switches.h"
62 #include "ipc/ipc_channel_handle.h" 63 #include "ipc/ipc_channel_handle.h"
63 #include "ipc/message_filter.h" 64 #include "ipc/message_filter.h"
64 #include "media/base/media_switches.h" 65 #include "media/base/media_switches.h"
65 #include "media/media_features.h" 66 #include "media/media_features.h"
66 #include "mojo/edk/embedder/embedder.h" 67 #include "mojo/edk/embedder/embedder.h"
67 #include "services/service_manager/public/cpp/connection.h" 68 #include "services/service_manager/public/cpp/connection.h"
68 #include "services/service_manager/public/cpp/interface_provider.h" 69 #include "services/service_manager/public/cpp/interface_provider.h"
69 #include "services/service_manager/runner/common/client_util.h" 70 #include "services/service_manager/runner/common/client_util.h"
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 // TODO(penghuang): Replace all GPU related switches with GpuPreferences. 1050 // TODO(penghuang): Replace all GPU related switches with GpuPreferences.
1050 // https://crbug.com/590825 1051 // https://crbug.com/590825
1051 // If you want a browser command-line switch passed to the GPU process 1052 // If you want a browser command-line switch passed to the GPU process
1052 // you need to add it to |kSwitchNames| at the beginning of this file. 1053 // you need to add it to |kSwitchNames| at the beginning of this file.
1053 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames, 1054 cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
1054 arraysize(kSwitchNames)); 1055 arraysize(kSwitchNames));
1055 cmd_line->CopySwitchesFrom( 1056 cmd_line->CopySwitchesFrom(
1056 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost, 1057 browser_command_line, switches::kGLSwitchesCopiedFromGpuProcessHost,
1057 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches); 1058 switches::kGLSwitchesCopiedFromGpuProcessHostNumSwitches);
1058 1059
1060 std::vector<const char*> gpu_workarounds;
1061 gpu::GpuDriverBugList::AppendAllWorkarounds(&gpu_workarounds);
1062 cmd_line->CopySwitchesFrom(browser_command_line,
1063 gpu_workarounds.data(), gpu_workarounds.size());
1064
1059 GetContentClient()->browser()->AppendExtraCommandLineSwitches( 1065 GetContentClient()->browser()->AppendExtraCommandLineSwitches(
1060 cmd_line.get(), process_->GetData().id); 1066 cmd_line.get(), process_->GetData().id);
1061 1067
1062 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line.get(), 1068 GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line.get(),
1063 gpu_preferences); 1069 gpu_preferences);
1064 if (cmd_line->HasSwitch(switches::kUseGL)) { 1070 if (cmd_line->HasSwitch(switches::kUseGL)) {
1065 swiftshader_rendering_ = 1071 swiftshader_rendering_ =
1066 (cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader"); 1072 (cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
1067 } 1073 }
1068 1074
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); 1242 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader");
1237 ClientIdToShaderCacheMap::iterator iter = 1243 ClientIdToShaderCacheMap::iterator iter =
1238 client_id_to_shader_cache_.find(client_id); 1244 client_id_to_shader_cache_.find(client_id);
1239 // If the cache doesn't exist then this is an off the record profile. 1245 // If the cache doesn't exist then this is an off the record profile.
1240 if (iter == client_id_to_shader_cache_.end()) 1246 if (iter == client_id_to_shader_cache_.end())
1241 return; 1247 return;
1242 iter->second->Cache(GetShaderPrefixKey(shader) + ":" + key, shader); 1248 iter->second->Cache(GetShaderPrefixKey(shader) + ":" + key, shader);
1243 } 1249 }
1244 1250
1245 } // namespace content 1251 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/test/gpu/gpu_tests/gpu_process_integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698