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" |
45 #include "ui/gfx/android/device_display_info.h" | 46 #include "ui/gfx/android/device_display_info.h" |
46 #endif // OS_ANDROID | 47 #endif // OS_ANDROID |
47 | 48 |
48 namespace content { | 49 namespace content { |
49 | 50 |
50 namespace { | 51 namespace { |
51 | 52 |
52 enum GpuFeatureStatus { | 53 enum GpuFeatureStatus { |
53 kGpuFeatureEnabled = 0, | 54 kGpuFeatureEnabled = 0, |
54 kGpuFeatureBlacklisted = 1, | 55 kGpuFeatureBlacklisted = 1, |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 | 272 |
272 bool is_vivante = | 273 bool is_vivante = |
273 gpu_info.gl_extensions.find("GL_VIV_shader_binary") != | 274 gpu_info.gl_extensions.find("GL_VIV_shader_binary") != |
274 std::string::npos; | 275 std::string::npos; |
275 | 276 |
276 bool is_nexus7 = | 277 bool is_nexus7 = |
277 gpu_info.machine_model.find("Nexus 7") != std::string::npos; | 278 gpu_info.machine_model.find("Nexus 7") != std::string::npos; |
278 bool is_nexus10 = | 279 bool is_nexus10 = |
279 gpu_info.machine_model.find("Nexus 10") != std::string::npos; | 280 gpu_info.machine_model.find("Nexus 10") != std::string::npos; |
280 | 281 |
| 282 int sdk_int = base::android::BuildInfo::GetInstance()->sdk_int(); |
| 283 |
281 // IMG: avoid context switching perf problems, crashes with share groups | 284 // IMG: avoid context switching perf problems, crashes with share groups |
282 // Mali-T604: http://crbug.com/154715 | 285 // Mali-T604: http://crbug.com/154715 |
283 // QualComm, NVIDIA: Crashes with share groups | 286 // QualComm, NVIDIA: Crashes with share groups |
284 if (is_vivante || is_img || is_mali_t604 || is_nvidia || is_qualcomm || | 287 if (is_vivante || is_img || is_mali_t604 || |
285 is_broadcom) | 288 ((is_nvidia || is_qualcomm) && sdk_int < 18) || is_broadcom) { |
286 command_line->AppendSwitch(switches::kEnableVirtualGLContexts); | 289 command_line->AppendSwitch(switches::kEnableVirtualGLContexts); |
| 290 } |
287 | 291 |
288 gfx::DeviceDisplayInfo info; | 292 gfx::DeviceDisplayInfo info; |
289 int default_tile_size = 256; | 293 int default_tile_size = 256; |
290 | 294 |
291 // For very high resolution displays (eg. Nexus 10), set the default | 295 // For very high resolution displays (eg. Nexus 10), set the default |
292 // tile size to be 512. This should be removed in favour of a generic | 296 // tile size to be 512. This should be removed in favour of a generic |
293 // hueristic that works across all platforms and devices, once that | 297 // hueristic that works across all platforms and devices, once that |
294 // exists: http://crbug.com/159524. This switches to 512 for screens | 298 // exists: http://crbug.com/159524. This switches to 512 for screens |
295 // containing 40 or more 256x256 tiles, such that 1080p devices do | 299 // containing 40 or more 256x256 tiles, such that 1080p devices do |
296 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) | 300 // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1244 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1241 gpu_process_accessible_ = false; | 1245 gpu_process_accessible_ = false; |
1242 gpu_info_.finalized = true; | 1246 gpu_info_.finalized = true; |
1243 complete_gpu_info_already_requested_ = true; | 1247 complete_gpu_info_already_requested_ = true; |
1244 // Some observers might be waiting. | 1248 // Some observers might be waiting. |
1245 NotifyGpuInfoUpdate(); | 1249 NotifyGpuInfoUpdate(); |
1246 } | 1250 } |
1247 | 1251 |
1248 } // namespace content | 1252 } // namespace content |
1249 | 1253 |
OLD | NEW |