OLD | NEW |
---|---|
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 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 #include "ui/gl/gpu_switching_manager.h" | 35 #include "ui/gl/gpu_switching_manager.h" |
36 #include "webkit/common/webpreferences.h" | 36 #include "webkit/common/webpreferences.h" |
37 | 37 |
38 #if defined(OS_MACOSX) | 38 #if defined(OS_MACOSX) |
39 #include <ApplicationServices/ApplicationServices.h> | 39 #include <ApplicationServices/ApplicationServices.h> |
40 #endif // OS_MACOSX | 40 #endif // OS_MACOSX |
41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
42 #include "base/win/windows_version.h" | 42 #include "base/win/windows_version.h" |
43 #endif // OS_WIN | 43 #endif // OS_WIN |
44 #if defined(OS_ANDROID) | 44 #if defined(OS_ANDROID) |
45 #include "base/android/build_info.h" | |
46 #include "ui/gfx/android/device_display_info.h" | 45 #include "ui/gfx/android/device_display_info.h" |
47 #endif // OS_ANDROID | 46 #endif // OS_ANDROID |
48 | 47 |
49 namespace content { | 48 namespace content { |
50 | 49 |
51 namespace { | 50 namespace { |
52 | 51 |
53 enum GpuFeatureStatus { | 52 enum GpuFeatureStatus { |
54 kGpuFeatureEnabled = 0, | 53 kGpuFeatureEnabled = 0, |
55 kGpuFeatureBlacklisted = 1, | 54 kGpuFeatureBlacklisted = 1, |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 } | 251 } |
253 #endif // OS_MACOSX | 252 #endif // OS_MACOSX |
254 | 253 |
255 #if defined(OS_ANDROID) | 254 #if defined(OS_ANDROID) |
256 void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, | 255 void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, |
257 CommandLine* command_line) { | 256 CommandLine* command_line) { |
258 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); | 257 std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); |
259 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); | 258 std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); |
260 bool is_img = | 259 bool is_img = |
261 gpu_info.gl_vendor.find("Imagination") != std::string::npos; | 260 gpu_info.gl_vendor.find("Imagination") != std::string::npos; |
262 bool is_arm = | |
263 gpu_info.gl_vendor.find("ARM") != std::string::npos; | |
264 bool is_qualcomm = | |
265 gpu_info.gl_vendor.find("Qualcomm") != std::string::npos; | |
266 bool is_broadcom = | |
267 gpu_info.gl_vendor.find("Broadcom") != std::string::npos; | |
268 bool is_mali_t604 = is_arm && | |
269 gpu_info.gl_renderer.find("Mali-T604") != std::string::npos; | |
270 bool is_nvidia = | |
271 gpu_info.gl_vendor.find("NVIDIA") != std::string::npos; | |
272 | |
273 bool is_vivante = | |
274 gpu_info.gl_extensions.find("GL_VIV_shader_binary") != | |
275 std::string::npos; | |
276 | |
277 bool is_nexus7 = | 261 bool is_nexus7 = |
278 gpu_info.machine_model.find("Nexus 7") != std::string::npos; | 262 gpu_info.machine_model.find("Nexus 7") != std::string::npos; |
279 bool is_nexus10 = | 263 bool is_nexus10 = |
280 gpu_info.machine_model.find("Nexus 10") != std::string::npos; | 264 gpu_info.machine_model.find("Nexus 10") != std::string::npos; |
281 | 265 |
282 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); | |
283 | |
284 // IMG: avoid context switching perf problems, crashes with share groups | |
285 // Mali-T604: http://crbug.com/154715 | |
286 // QualComm, NVIDIA: Crashes with share groups | |
287 if (is_vivante || is_img || is_mali_t604 || | |
288 ((is_nvidia || is_qualcomm) && sdk_int < 18) || is_broadcom) { | |
piman
2013/09/06 21:21:50
You're losing the sdk_int < 18 selector in the jso
| |
289 command_line->AppendSwitch(switches::kEnableVirtualGLContexts); | |
290 } | |
291 | |
292 gfx::DeviceDisplayInfo info; | 266 gfx::DeviceDisplayInfo info; |
293 int default_tile_size = 256; | 267 int default_tile_size = 256; |
294 | 268 |
295 // For very high resolution displays (eg. Nexus 10), set the default | 269 // For very high resolution displays (eg. Nexus 10), set the default |
296 // tile size to be 512. This should be removed in favour of a generic | 270 // tile size to be 512. This should be removed in favour of a generic |
297 // hueristic that works across all platforms and devices, once that | 271 // hueristic that works across all platforms and devices, once that |
298 // exists: http://crbug.com/159524. This switches to 512 for screens | 272 // exists: http://crbug.com/159524. This switches to 512 for screens |
299 // containing 40 or more 256x256 tiles, such that 1080p devices do | 273 // containing 40 or more 256x256 tiles, such that 1080p devices do |
300 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) | 274 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) |
301 int numTiles = (info.GetDisplayWidth() * | 275 int numTiles = (info.GetDisplayWidth() * |
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1261 | 1235 |
1262 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1236 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1263 gpu_process_accessible_ = false; | 1237 gpu_process_accessible_ = false; |
1264 gpu_info_.finalized = true; | 1238 gpu_info_.finalized = true; |
1265 complete_gpu_info_already_requested_ = true; | 1239 complete_gpu_info_already_requested_ = true; |
1266 // Some observers might be waiting. | 1240 // Some observers might be waiting. |
1267 NotifyGpuInfoUpdate(); | 1241 NotifyGpuInfoUpdate(); |
1268 } | 1242 } |
1269 | 1243 |
1270 } // namespace content | 1244 } // namespace content |
OLD | NEW |