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/gpu/gpu_info_collector.h" | 5 #include "content/gpu/gpu_info_collector.h" |
6 | 6 |
7 #include "base/android/build_info.h" | |
7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
10 #include "base/string_piece.h" | 11 #include "base/string_piece.h" |
11 #include "base/string_split.h" | 12 #include "base/string_split.h" |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 return false; | 60 return false; |
60 | 61 |
61 std::string vendor(StringToLowerASCII(gpu_info->gl_vendor)); | 62 std::string vendor(StringToLowerASCII(gpu_info->gl_vendor)); |
62 std::string renderer(StringToLowerASCII(gpu_info->gl_renderer)); | 63 std::string renderer(StringToLowerASCII(gpu_info->gl_renderer)); |
63 bool is_img = vendor.find("imagination") != std::string::npos; | 64 bool is_img = vendor.find("imagination") != std::string::npos; |
64 bool is_arm = vendor.find("arm") != std::string::npos; | 65 bool is_arm = vendor.find("arm") != std::string::npos; |
65 bool is_qualcomm = vendor.find("qualcomm") != std::string::npos; | 66 bool is_qualcomm = vendor.find("qualcomm") != std::string::npos; |
66 bool is_nvidia = vendor.find("nvidia") != std::string::npos; | 67 bool is_nvidia = vendor.find("nvidia") != std::string::npos; |
67 bool is_mali_t604 = is_arm && renderer.find("mali-t604") != std::string::npos; | 68 bool is_mali_t604 = is_arm && renderer.find("mali-t604") != std::string::npos; |
68 | 69 |
70 bool sdk_17_or_greater = | |
71 base::android::BuildInfo::GetInstance()->sdk_int() >= 17; | |
klobag.chromium
2013/02/05 22:28:49
I assume we already have this at this stage.
| |
72 | |
69 // IMG: avoid context switching perf problems, crashes with share groups | 73 // IMG: avoid context switching perf problems, crashes with share groups |
70 // Mali-T604: http://crbug.com/154715 | 74 // Mali-T604: http://crbug.com/154715 |
71 // QualComm, NVIDIA: Crashes with share groups | 75 // QualComm, NVIDIA: Crashes with share groups |
72 if (is_img || is_mali_t604 || is_qualcomm || is_nvidia) { | 76 if (is_img || is_mali_t604 || is_qualcomm || |
77 (is_nvidia && sdk_17_or_greater)) { | |
73 CommandLine::ForCurrentProcess()->AppendSwitch( | 78 CommandLine::ForCurrentProcess()->AppendSwitch( |
74 switches::kEnableVirtualGLContexts); | 79 switches::kEnableVirtualGLContexts); |
75 } | 80 } |
76 | 81 |
77 int default_tile_size = 256; | 82 int default_tile_size = 256; |
78 | 83 |
79 // IMG: Fast async texture uploads only work with non-power-of-two, | 84 // IMG: Fast async texture uploads only work with non-power-of-two, |
80 // but still multiple-of-eight sizes. | 85 // but still multiple-of-eight sizes. |
81 // http://crbug.com/168099 | 86 // http://crbug.com/168099 |
82 if (is_img) | 87 if (is_img) |
(...skipping 22 matching lines...) Expand all Loading... | |
105 gpu_info->gl_version_string); | 110 gpu_info->gl_version_string); |
106 return true; | 111 return true; |
107 } | 112 } |
108 | 113 |
109 void MergeGPUInfo(content::GPUInfo* basic_gpu_info, | 114 void MergeGPUInfo(content::GPUInfo* basic_gpu_info, |
110 const content::GPUInfo& context_gpu_info) { | 115 const content::GPUInfo& context_gpu_info) { |
111 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 116 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
112 } | 117 } |
113 | 118 |
114 } // namespace gpu_info_collector | 119 } // namespace gpu_info_collector |
OLD | NEW |