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(manager->IsDriverBugWorkaroundActive( |
| 245 gpu::DISABLE_MULTIMONITOR_MULTISAMPLING) && | |
| 246 displayCount != manager->GetDisplayCount()) { | |
|
Ken Russell (switch to Gerrit)
2013/08/29 19:28:00
The workaround check needs to be done below in ord
| |
| 245 manager->SetDisplayCount(displayCount); | 247 manager->SetDisplayCount(displayCount); |
| 246 fireGpuSwitch = true; | 248 fireGpuSwitch = true; |
| 247 } | 249 } |
| 248 | 250 |
| 249 if (fireGpuSwitch) | 251 if (fireGpuSwitch) |
| 250 manager->HandleGpuSwitch(); | 252 manager->HandleGpuSwitch(); |
| 251 } | 253 } |
| 252 #endif // OS_MACOSX | 254 #endif // OS_MACOSX |
| 253 | 255 |
| 254 #if defined(OS_ANDROID) | 256 #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 | 371 // Skia's software rendering is probably more efficient than going through |
| 370 // software emulation of the GPU, so use that. | 372 // software emulation of the GPU, so use that. |
| 371 if (feature == gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) | 373 if (feature == gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) |
| 372 return true; | 374 return true; |
| 373 return false; | 375 return false; |
| 374 } | 376 } |
| 375 | 377 |
| 376 return (blacklisted_features_.count(feature) == 1); | 378 return (blacklisted_features_.count(feature) == 1); |
| 377 } | 379 } |
| 378 | 380 |
| 381 bool GpuDataManagerImplPrivate::IsDriverBugWorkaroundActive(int feature) const { | |
| 382 return (gpu_driver_bugs_.count(feature) == 1); | |
| 383 } | |
| 384 | |
| 379 size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const { | 385 size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const { |
| 380 if (use_swiftshader_) | 386 if (use_swiftshader_) |
| 381 return 1; | 387 return 1; |
| 382 return blacklisted_features_.size(); | 388 return blacklisted_features_.size(); |
| 383 } | 389 } |
| 384 | 390 |
| 385 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { | 391 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { |
| 386 display_count_ = display_count; | 392 display_count_ = display_count; |
| 387 } | 393 } |
| 388 | 394 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 prefs->flash_3d_enabled = false; | 817 prefs->flash_3d_enabled = false; |
| 812 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D)) { | 818 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D)) { |
| 813 prefs->flash_stage3d_enabled = false; | 819 prefs->flash_stage3d_enabled = false; |
| 814 prefs->flash_stage3d_baseline_enabled = false; | 820 prefs->flash_stage3d_baseline_enabled = false; |
| 815 } | 821 } |
| 816 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE)) | 822 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE)) |
| 817 prefs->flash_stage3d_baseline_enabled = false; | 823 prefs->flash_stage3d_baseline_enabled = false; |
| 818 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) | 824 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) |
| 819 prefs->accelerated_2d_canvas_enabled = false; | 825 prefs->accelerated_2d_canvas_enabled = false; |
| 820 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) | 826 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) |
| 821 || display_count_ > 1) | 827 || display_count_ > 1) |
|
Ken Russell (switch to Gerrit)
2013/08/29 19:28:00
The check on the driver bug workaround should be d
| |
| 822 prefs->gl_multisampling_enabled = false; | 828 prefs->gl_multisampling_enabled = false; |
| 823 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS)) { | 829 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS)) { |
| 824 prefs->accelerated_compositing_for_3d_transforms_enabled = false; | 830 prefs->accelerated_compositing_for_3d_transforms_enabled = false; |
| 825 prefs->accelerated_compositing_for_animation_enabled = false; | 831 prefs->accelerated_compositing_for_animation_enabled = false; |
| 826 } | 832 } |
| 827 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO)) | 833 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO)) |
| 828 prefs->accelerated_compositing_for_video_enabled = false; | 834 prefs->accelerated_compositing_for_video_enabled = false; |
| 829 | 835 |
| 830 // Accelerated video and animation are slower than regular when using | 836 // Accelerated video and animation are slower than regular when using |
| 831 // SwiftShader. 3D CSS may also be too slow to be worthwhile. | 837 // 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 | 1258 |
| 1253 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1259 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
| 1254 gpu_process_accessible_ = false; | 1260 gpu_process_accessible_ = false; |
| 1255 gpu_info_.finalized = true; | 1261 gpu_info_.finalized = true; |
| 1256 complete_gpu_info_already_requested_ = true; | 1262 complete_gpu_info_already_requested_ = true; |
| 1257 // Some observers might be waiting. | 1263 // Some observers might be waiting. |
| 1258 NotifyGpuInfoUpdate(); | 1264 NotifyGpuInfoUpdate(); |
| 1259 } | 1265 } |
| 1260 | 1266 |
| 1261 } // namespace content | 1267 } // namespace content |
| OLD | NEW |