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/android/build_info.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 bool is_vivante = vendor.find("vivante") != std::string::npos; | 77 bool is_vivante = vendor.find("vivante") != std::string::npos; |
78 is_vivante |= vendor.find("hisilicon") != std::string::npos; | 78 is_vivante |= vendor.find("hisilicon") != std::string::npos; |
79 | 79 |
80 base::android::BuildInfo* build_info = | 80 base::android::BuildInfo* build_info = |
81 base::android::BuildInfo::GetInstance(); | 81 base::android::BuildInfo::GetInstance(); |
82 std::string model = build_info->model(); | 82 std::string model = build_info->model(); |
83 model = StringToLowerASCII(model); | 83 model = StringToLowerASCII(model); |
84 bool is_nexus7 = model.find("nexus 7") != std::string::npos; | 84 bool is_nexus7 = model.find("nexus 7") != std::string::npos; |
85 bool is_nexus10 = model.find("nexus 10") != std::string::npos; | 85 bool is_nexus10 = model.find("nexus 10") != std::string::npos; |
86 | 86 |
87 // Virtual contexts crash when switching surfaces, but only on SDK 16, | |
88 // so we us full context switching for now. If virtual contexts can | |
89 // avoid some of it's extra surface switches, or Qualcomm gives us | |
90 // a more directed work-around, we can remove this. | |
91 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); | |
92 | |
93 // IMG: avoid context switching perf problems, crashes with share groups | 87 // IMG: avoid context switching perf problems, crashes with share groups |
94 // Mali-T604: http://crbug.com/154715 | 88 // Mali-T604: http://crbug.com/154715 |
95 // QualComm, NVIDIA: Crashes with share groups | 89 // QualComm, NVIDIA: Crashes with share groups |
96 if (is_vivante || is_img || is_mali_t604 || is_nexus7 | 90 if (is_vivante || is_img || is_mali_t604 || is_nexus7 || is_qualcomm) { |
97 || (is_qualcomm && sdk_int != 16)) { | |
98 CommandLine::ForCurrentProcess()->AppendSwitch( | 91 CommandLine::ForCurrentProcess()->AppendSwitch( |
99 switches::kEnableVirtualGLContexts); | 92 switches::kEnableVirtualGLContexts); |
100 } | 93 } |
101 | 94 |
102 gfx::DeviceDisplayInfo info; | 95 gfx::DeviceDisplayInfo info; |
103 int default_tile_size = 256; | 96 int default_tile_size = 256; |
104 | 97 |
105 // For very high resolution displays (eg. Nexus 10), set the default | 98 // For very high resolution displays (eg. Nexus 10), set the default |
106 // tile size to be 512. This should be removed in favour of a generic | 99 // tile size to be 512. This should be removed in favour of a generic |
107 // hueristic that works across all platforms and devices, once that | 100 // hueristic that works across all platforms and devices, once that |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 gpu_info->gl_version_string); | 143 gpu_info->gl_version_string); |
151 return true; | 144 return true; |
152 } | 145 } |
153 | 146 |
154 void MergeGPUInfo(content::GPUInfo* basic_gpu_info, | 147 void MergeGPUInfo(content::GPUInfo* basic_gpu_info, |
155 const content::GPUInfo& context_gpu_info) { | 148 const content::GPUInfo& context_gpu_info) { |
156 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 149 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
157 } | 150 } |
158 | 151 |
159 } // namespace gpu_info_collector | 152 } // namespace gpu_info_collector |
OLD | NEW |