| Index: content/browser/gpu/gpu_data_manager_impl_private.cc
|
| diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
| index 45c548c11816b55583851e339c3a8feea1d0dafb..4954d9d3f8f2f75eac80f242f218b4df8392d6d1 100644
|
| --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
|
| +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
|
| @@ -75,12 +75,25 @@ std::string IntSetToString(const std::set<int>& list) {
|
| void DisplayReconfigCallback(CGDirectDisplayID display,
|
| CGDisplayChangeSummaryFlags flags,
|
| void* gpu_data_manager) {
|
| - if (flags & kCGDisplayAddFlag) {
|
| - GpuDataManagerImpl* manager =
|
| - reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager);
|
| - DCHECK(manager);
|
| - manager->HandleGpuSwitch();
|
| + if(flags == kCGDisplayBeginConfigurationFlag)
|
| + return; // This call contains no information about the display change
|
| +
|
| + GpuDataManagerImpl* manager =
|
| + reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager);
|
| + DCHECK(manager);
|
| +
|
| + uint32_t displayCount;
|
| + CGGetActiveDisplayList(0, NULL, &displayCount);
|
| +
|
| + bool fireGpuSwitch = flags & kCGDisplayAddFlag;
|
| +
|
| + if (displayCount != manager->GetDisplayCount()) {
|
| + manager->SetDisplayCount(displayCount);
|
| + fireGpuSwitch = true;
|
| }
|
| +
|
| + if (fireGpuSwitch)
|
| + manager->HandleGpuSwitch();
|
| }
|
| #endif // OS_MACOSX
|
|
|
| @@ -126,6 +139,14 @@ size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const {
|
| return blacklisted_features_.size();
|
| }
|
|
|
| +void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) {
|
| + display_count_ = display_count;
|
| +}
|
| +
|
| +unsigned int GpuDataManagerImplPrivate::GetDisplayCount() const {
|
| + return display_count_;
|
| +}
|
| +
|
| GPUInfo GpuDataManagerImplPrivate::GetGPUInfo() const {
|
| return gpu_info_;
|
| }
|
| @@ -539,7 +560,8 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs(
|
| prefs->flash_stage3d_baseline_enabled = false;
|
| if (IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS))
|
| prefs->accelerated_2d_canvas_enabled = false;
|
| - if (IsFeatureBlacklisted(GPU_FEATURE_TYPE_MULTISAMPLING))
|
| + if (IsFeatureBlacklisted(GPU_FEATURE_TYPE_MULTISAMPLING)
|
| + || display_count_ > 1)
|
| prefs->gl_multisampling_enabled = false;
|
| if (IsFeatureBlacklisted(GPU_FEATURE_TYPE_3D_CSS)) {
|
| prefs->accelerated_compositing_for_3d_transforms_enabled = false;
|
| @@ -687,7 +709,8 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(
|
| update_histograms_(true),
|
| window_count_(0),
|
| domain_blocking_enabled_(true),
|
| - owner_(owner) {
|
| + owner_(owner),
|
| + display_count_(0) {
|
| DCHECK(owner_);
|
| CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) {
|
| @@ -705,6 +728,7 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate(
|
| }
|
|
|
| #if defined(OS_MACOSX)
|
| + CGGetActiveDisplayList (0, NULL, &display_count_);
|
| CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_);
|
| #endif // OS_MACOSX
|
| }
|
|
|