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

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

Issue 15094006: Change gpu blacklists from json resource to const string. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_data_manager_impl_private.h" 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h"
6 6
7 #if defined(OS_MACOSX) 7 #if defined(OS_MACOSX)
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #endif // OS_MACOSX 9 #endif // OS_MACOSX
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/metrics/field_trial.h" 15 #include "base/metrics/field_trial.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/stringprintf.h" 17 #include "base/stringprintf.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_piece.h"
20 #include "base/sys_info.h" 19 #include "base/sys_info.h"
21 #include "base/version.h" 20 #include "base/version.h"
21 #include "content/browser/gpu/gpu_control_list_jsons.h"
22 #include "content/browser/gpu/gpu_process_host.h" 22 #include "content/browser/gpu/gpu_process_host.h"
23 #include "content/browser/gpu/gpu_util.h" 23 #include "content/browser/gpu/gpu_util.h"
24 #include "content/common/gpu/gpu_messages.h" 24 #include "content/common/gpu/gpu_messages.h"
25 #include "content/gpu/gpu_info_collector.h" 25 #include "content/gpu/gpu_info_collector.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/gpu_data_manager_observer.h" 27 #include "content/public/browser/gpu_data_manager_observer.h"
28 #include "content/public/common/content_client.h" 28 #include "content/public/common/content_client.h"
29 #include "content/public/common/content_constants.h" 29 #include "content/public/common/content_constants.h"
30 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
31 #include "content/public/common/gpu_feature_type.h" 31 #include "content/public/common/gpu_feature_type.h"
32 #include "gpu/command_buffer/service/gpu_switches.h" 32 #include "gpu/command_buffer/service/gpu_switches.h"
33 #include "grit/content_resources.h"
34 #include "ui/base/ui_base_switches.h" 33 #include "ui/base/ui_base_switches.h"
35 #include "ui/gl/gl_implementation.h" 34 #include "ui/gl/gl_implementation.h"
36 #include "ui/gl/gl_switches.h" 35 #include "ui/gl/gl_switches.h"
37 #include "ui/gl/gpu_switching_manager.h" 36 #include "ui/gl/gpu_switching_manager.h"
38 #include "webkit/glue/webpreferences.h" 37 #include "webkit/glue/webpreferences.h"
39 #include "webkit/plugins/plugin_switches.h" 38 #include "webkit/plugins/plugin_switches.h"
40 39
41 #if defined(OS_WIN) 40 #if defined(OS_WIN)
42 #include "base/win/windows_version.h" 41 #include "base/win/windows_version.h"
43 #endif 42 #endif
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 311 }
313 #if defined(ARCH_CPU_X86_FAMILY) 312 #if defined(ARCH_CPU_X86_FAMILY)
314 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id) 313 if (!gpu_info.gpu.vendor_id || !gpu_info.gpu.device_id)
315 gpu_info.finalized = true; 314 gpu_info.finalized = true;
316 #endif 315 #endif
317 316
318 std::string gpu_blacklist_string; 317 std::string gpu_blacklist_string;
319 std::string gpu_switching_list_string; 318 std::string gpu_switching_list_string;
320 std::string gpu_driver_bug_list_string; 319 std::string gpu_driver_bug_list_string;
321 if (!command_line->HasSwitch(switches::kIgnoreGpuBlacklist)) { 320 if (!command_line->HasSwitch(switches::kIgnoreGpuBlacklist)) {
322 const base::StringPiece gpu_blacklist_json = 321 gpu_blacklist_string = kSoftwareRenderingListJson;
323 GetContentClient()->GetDataResource( 322 gpu_switching_list_string = kGpuSwitchingListJson;
324 IDR_GPU_BLACKLIST, ui::SCALE_FACTOR_NONE);
325 gpu_blacklist_string = gpu_blacklist_json.as_string();
326 const base::StringPiece gpu_switching_list_json =
327 GetContentClient()->GetDataResource(
328 IDR_GPU_SWITCHING_LIST, ui::SCALE_FACTOR_NONE);
329 gpu_switching_list_string = gpu_switching_list_json.as_string();
330 } 323 }
331 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { 324 if (!command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) {
332 const base::StringPiece gpu_driver_bug_list_json = 325 gpu_driver_bug_list_string = kGpuDriverBugListJson;
333 GetContentClient()->GetDataResource(
334 IDR_GPU_DRIVER_BUG_LIST, ui::SCALE_FACTOR_NONE);
335 gpu_driver_bug_list_string = gpu_driver_bug_list_json.as_string();
336 } 326 }
337 InitializeImpl(gpu_blacklist_string, 327 InitializeImpl(gpu_blacklist_string,
338 gpu_switching_list_string, 328 gpu_switching_list_string,
339 gpu_driver_bug_list_string, 329 gpu_driver_bug_list_string,
340 gpu_info); 330 gpu_info);
341 // We pass down the list to GPU command buffer through commandline 331 // We pass down the list to GPU command buffer through commandline
342 // switches at GPU process launch. However, in situations where we don't 332 // switches at GPU process launch. However, in situations where we don't
343 // have a GPU process, we append the browser process commandline. 333 // have a GPU process, we append the browser process commandline.
344 if (command_line->HasSwitch(switches::kSingleProcess) || 334 if (command_line->HasSwitch(switches::kSingleProcess) ||
345 command_line->HasSwitch(switches::kInProcessGPU)) { 335 command_line->HasSwitch(switches::kInProcessGPU)) {
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 int render_process_id, 906 int render_process_id,
917 int render_view_id, 907 int render_view_id,
918 ThreeDAPIType requester) { 908 ThreeDAPIType requester) {
919 GpuDataManagerImpl::UnlockedSession session(owner_); 909 GpuDataManagerImpl::UnlockedSession session(owner_);
920 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs, 910 observer_list_->Notify(&GpuDataManagerObserver::DidBlock3DAPIs,
921 url, render_process_id, render_view_id, requester); 911 url, render_process_id, render_view_id, requester);
922 } 912 }
923 913
924 } // namespace content 914 } // namespace content
925 915
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_control_list_jsons.h ('k') | content/browser/gpu/gpu_driver_bug_list.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698