Chromium Code Reviews| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 | 234 |
| 235 GpuDataManagerImpl* manager = | 235 GpuDataManagerImpl* manager = |
| 236 reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager); | 236 reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager); |
| 237 DCHECK(manager); | 237 DCHECK(manager); |
| 238 | 238 |
| 239 uint32_t displayCount; | 239 uint32_t displayCount; |
| 240 CGGetActiveDisplayList(0, NULL, &displayCount); | 240 CGGetActiveDisplayList(0, NULL, &displayCount); |
| 241 | 241 |
| 242 bool fireGpuSwitch = flags & kCGDisplayAddFlag; | 242 bool fireGpuSwitch = flags & kCGDisplayAddFlag; |
| 243 | 243 |
| 244 if (displayCount != manager->GetDisplayCount()) { | 244 if(displayCount != manager->GetDisplayCount()) { |
|
Ken Russell (switch to Gerrit)
2013/08/29 21:05:05
Please undo this whitespace change.
| |
| 245 manager->SetDisplayCount(displayCount); | 245 manager->SetDisplayCount(displayCount); |
| 246 fireGpuSwitch = true; | 246 fireGpuSwitch = true; |
| 247 } | 247 } |
| 248 | 248 |
| 249 if (fireGpuSwitch) | 249 if (fireGpuSwitch) |
| 250 manager->HandleGpuSwitch(); | 250 manager->HandleGpuSwitch(); |
| 251 } | 251 } |
| 252 #endif // OS_MACOSX | 252 #endif // OS_MACOSX |
| 253 | 253 |
| 254 #if defined(OS_ANDROID) | 254 #if defined(OS_ANDROID) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 // Skia's software rendering is probably more efficient than going through | 369 // Skia's software rendering is probably more efficient than going through |
| 370 // software emulation of the GPU, so use that. | 370 // software emulation of the GPU, so use that. |
| 371 if (feature == gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) | 371 if (feature == gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) |
| 372 return true; | 372 return true; |
| 373 return false; | 373 return false; |
| 374 } | 374 } |
| 375 | 375 |
| 376 return (blacklisted_features_.count(feature) == 1); | 376 return (blacklisted_features_.count(feature) == 1); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool GpuDataManagerImplPrivate::IsDriverBugWorkaroundActive(int feature) const { | |
| 380 return (gpu_driver_bugs_.count(feature) == 1); | |
| 381 } | |
| 382 | |
| 379 size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const { | 383 size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const { |
| 380 if (use_swiftshader_) | 384 if (use_swiftshader_) |
| 381 return 1; | 385 return 1; |
| 382 return blacklisted_features_.size(); | 386 return blacklisted_features_.size(); |
| 383 } | 387 } |
| 384 | 388 |
| 385 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { | 389 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { |
| 386 display_count_ = display_count; | 390 display_count_ = display_count; |
| 387 } | 391 } |
| 388 | 392 |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 810 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D)) | 814 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D)) |
| 811 prefs->flash_3d_enabled = false; | 815 prefs->flash_3d_enabled = false; |
| 812 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D)) { | 816 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D)) { |
| 813 prefs->flash_stage3d_enabled = false; | 817 prefs->flash_stage3d_enabled = false; |
| 814 prefs->flash_stage3d_baseline_enabled = false; | 818 prefs->flash_stage3d_baseline_enabled = false; |
| 815 } | 819 } |
| 816 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE)) | 820 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE)) |
| 817 prefs->flash_stage3d_baseline_enabled = false; | 821 prefs->flash_stage3d_baseline_enabled = false; |
| 818 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) | 822 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) |
| 819 prefs->accelerated_2d_canvas_enabled = false; | 823 prefs->accelerated_2d_canvas_enabled = false; |
| 820 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) | 824 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) || |
| 821 || display_count_ > 1) | 825 (IsDriverBugWorkaroundActive(gpu::DISABLE_MULTIMONITOR_MULTISAMPLING) && |
| 826 display_count_ > 1)) | |
| 822 prefs->gl_multisampling_enabled = false; | 827 prefs->gl_multisampling_enabled = false; |
| 823 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS)) { | 828 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS)) { |
| 824 prefs->accelerated_compositing_for_3d_transforms_enabled = false; | 829 prefs->accelerated_compositing_for_3d_transforms_enabled = false; |
| 825 prefs->accelerated_compositing_for_animation_enabled = false; | 830 prefs->accelerated_compositing_for_animation_enabled = false; |
| 826 } | 831 } |
| 827 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO)) | 832 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO)) |
| 828 prefs->accelerated_compositing_for_video_enabled = false; | 833 prefs->accelerated_compositing_for_video_enabled = false; |
| 829 | 834 |
| 830 // Accelerated video and animation are slower than regular when using | 835 // Accelerated video and animation are slower than regular when using |
| 831 // SwiftShader. 3D CSS may also be too slow to be worthwhile. | 836 // SwiftShader. 3D CSS may also be too slow to be worthwhile. |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 | 1257 |
| 1253 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1258 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
| 1254 gpu_process_accessible_ = false; | 1259 gpu_process_accessible_ = false; |
| 1255 gpu_info_.finalized = true; | 1260 gpu_info_.finalized = true; |
| 1256 complete_gpu_info_already_requested_ = true; | 1261 complete_gpu_info_already_requested_ = true; |
| 1257 // Some observers might be waiting. | 1262 // Some observers might be waiting. |
| 1258 NotifyGpuInfoUpdate(); | 1263 NotifyGpuInfoUpdate(); |
| 1259 } | 1264 } |
| 1260 | 1265 |
| 1261 } // namespace content | 1266 } // namespace content |
| OLD | NEW |