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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 rt += ","; | 222 rt += ","; |
223 rt += base::IntToString(*it); | 223 rt += base::IntToString(*it); |
224 } | 224 } |
225 return rt; | 225 return rt; |
226 } | 226 } |
227 | 227 |
228 #if defined(OS_MACOSX) | 228 #if defined(OS_MACOSX) |
229 void DisplayReconfigCallback(CGDirectDisplayID display, | 229 void DisplayReconfigCallback(CGDirectDisplayID display, |
230 CGDisplayChangeSummaryFlags flags, | 230 CGDisplayChangeSummaryFlags flags, |
231 void* gpu_data_manager) { | 231 void* gpu_data_manager) { |
232 if(flags == kCGDisplayBeginConfigurationFlag) | 232 if (flags == kCGDisplayBeginConfigurationFlag) |
233 return; // This call contains no information about the display change | 233 return; // This call contains no information about the display change |
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; |
(...skipping 126 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 |