diff options
Diffstat (limited to 'chromium/content/browser/gpu/gpu_data_manager_impl_private.cc')
-rw-r--r-- | chromium/content/browser/gpu/gpu_data_manager_impl_private.cc | 322 |
1 files changed, 136 insertions, 186 deletions
diff --git a/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc b/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc index a9dfa8c8f50..2c5b91e0142 100644 --- a/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/chromium/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -145,29 +145,20 @@ void UpdateStats(const gpu::GPUInfo& gpu_info, const gpu::GpuFeatureType kGpuFeatures[] = { gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, - gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, - gpu::GPU_FEATURE_TYPE_WEBGL, - gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING - }; + gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, gpu::GPU_FEATURE_TYPE_WEBGL}; const std::string kGpuBlacklistFeatureHistogramNames[] = { "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", - "GPU.BlacklistFeatureTestResults.AcceleratedCompositing", - "GPU.BlacklistFeatureTestResults.Webgl", - "GPU.BlacklistFeatureTestResults.TextureSharing" - }; + "GPU.BlacklistFeatureTestResults.GpuCompositing", + "GPU.BlacklistFeatureTestResults.Webgl", }; const bool kGpuFeatureUserFlags[] = { command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), - command_line.HasSwitch(switches::kDisableAcceleratedCompositing), - command_line.HasSwitch(switches::kDisableExperimentalWebGL), - command_line.HasSwitch(switches::kDisableImageTransportSurface) - }; + command_line.HasSwitch(switches::kDisableGpu), + command_line.HasSwitch(switches::kDisableExperimentalWebGL), }; #if defined(OS_WIN) const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", - "GPU.BlacklistFeatureTestResultsWindows.AcceleratedCompositing", - "GPU.BlacklistFeatureTestResultsWindows.Webgl", - "GPU.BlacklistFeatureTestResultsWindows.TextureSharing" - }; + "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", + "GPU.BlacklistFeatureTestResultsWindows.Webgl", }; #endif const size_t kNumFeatures = sizeof(kGpuFeatures) / sizeof(gpu::GpuFeatureType); @@ -221,42 +212,82 @@ void DisplayReconfigCallback(CGDirectDisplayID display, reinterpret_cast<GpuDataManagerImpl*>(gpu_data_manager); DCHECK(manager); + // Display change. + bool display_changed = false; uint32_t displayCount; CGGetActiveDisplayList(0, NULL, &displayCount); - - bool fireGpuSwitch = flags & kCGDisplayAddFlag; - if (displayCount != manager->GetDisplayCount()) { manager->SetDisplayCount(displayCount); - fireGpuSwitch = true; + display_changed = true; + } + + // Gpu change. + bool gpu_changed = false; + if (flags & kCGDisplayAddFlag) { + uint32 vendor_id, device_id; + if (gpu::CollectGpuID(&vendor_id, &device_id) == gpu::kGpuIDSuccess) { + gpu_changed = manager->UpdateActiveGpu(vendor_id, device_id); + } } - if (fireGpuSwitch) + if (display_changed || gpu_changed) manager->HandleGpuSwitch(); } #endif // OS_MACOSX #if defined(OS_ANDROID) void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, - CommandLine* command_line) { + CommandLine* command_line, + std::set<int>* workarounds) { std::string vendor(StringToLowerASCII(gpu_info.gl_vendor)); std::string renderer(StringToLowerASCII(gpu_info.gl_renderer)); + std::string version(StringToLowerASCII(gpu_info.gl_version)); + bool is_img = gpu_info.gl_vendor.find("Imagination") != std::string::npos; gfx::DeviceDisplayInfo info; int default_tile_size = 256; - // For very high resolution displays (eg. Nexus 10), set the default - // tile size to be 512. This should be removed in favour of a generic - // hueristic that works across all platforms and devices, once that - // exists: http://crbug.com/159524. This switches to 512 for screens - // containing 40 or more 256x256 tiles, such that 1080p devices do - // not use 512x512 tiles (eg. 1920x1280 requires 37.5 tiles) - int numTiles = (info.GetDisplayWidth() * - info.GetDisplayHeight()) / (256 * 256); - if (numTiles >= 40) - default_tile_size = 512; + // TODO(epenner): Now that this is somewhat generic, maybe we can + // unify this for all platforms (http://crbug.com/159524) + + bool real_size_supported = true; + int display_width = info.GetPhysicalDisplayWidth(); + int display_height = info.GetPhysicalDisplayHeight(); + if (display_width == 0 || display_height == 0) { + real_size_supported = false; + display_width = info.GetDisplayWidth(); + display_height = info.GetDisplayHeight(); + } + + int portrait_width = std::min(display_width, display_height); + int landscape_width = std::max(display_width, display_height); + + if (real_size_supported) { + // Maximum HD dimensions should be 768x1280 + // Maximum FHD dimensions should be 1200x1920 + if (portrait_width > 768 || landscape_width > 1280) + default_tile_size = 384; + if (portrait_width > 1200 || landscape_width > 1920) + default_tile_size = 512; + + // Adjust for some resolutions that barely straddle an extra + // tile when in portrait mode. This helps worst case scroll/raster + // by not needing a full extra tile for each row. + if (default_tile_size == 256 && portrait_width == 768) + default_tile_size += 32; + if (default_tile_size == 384 && portrait_width == 1200) + default_tile_size += 32; + } else { + // We don't know the exact resolution due to screen controls etc. + // So this just estimates the values above using tile counts. + int numTiles = (display_width * display_height) / (256 * 256); + if (numTiles > 16) + default_tile_size = 384; + if (numTiles >= 40) + default_tile_size = 512; + } // IMG: Fast async texture uploads only work with non-power-of-two, // but still multiple-of-eight sizes. @@ -279,21 +310,6 @@ void ApplyAndroidWorkarounds(const gpu::GPUInfo& gpu_info, } #endif // OS_ANDROID -// Overwrite force gpu workaround if a commandline switch exists. -void AdjustGpuSwitchingOption(std::set<int>* workarounds) { - DCHECK(workarounds); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - std::string option = command_line.GetSwitchValueASCII( - switches::kGpuSwitching); - if (option == switches::kGpuSwitchingOptionNameForceDiscrete) { - workarounds->erase(gpu::FORCE_INTEGRATED_GPU); - workarounds->insert(gpu::FORCE_DISCRETE_GPU); - } else if (option == switches::kGpuSwitchingOptionNameForceIntegrated) { - workarounds->erase(gpu::FORCE_DISCRETE_GPU); - workarounds->insert(gpu::FORCE_INTEGRATED_GPU); - } -} - // Block all domains' use of 3D APIs for this many milliseconds if // approaching a threshold where system stability might be compromised. const int64 kBlockAllDomainsMs = 10000; @@ -322,9 +338,6 @@ void GpuDataManagerImplPrivate::InitializeForTesting( } bool GpuDataManagerImplPrivate::IsFeatureBlacklisted(int feature) const { - if (CommandLine::ForCurrentProcess()->HasSwitch("chrome-frame") && - feature == gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING) - return false; #if defined(OS_CHROMEOS) if (feature == gpu::GPU_FEATURE_TYPE_PANEL_FITTING && CommandLine::ForCurrentProcess()->HasSwitch( @@ -506,14 +519,14 @@ void GpuDataManagerImplPrivate::SetGLStrings(const std::string& gl_vendor, // situation where GPU process collected GL strings before this call. if (!gpu_info_.gl_vendor.empty() || !gpu_info_.gl_renderer.empty() || - !gpu_info_.gl_version_string.empty()) + !gpu_info_.gl_version.empty()) return; gpu::GPUInfo gpu_info = gpu_info_; gpu_info.gl_vendor = gl_vendor; gpu_info.gl_renderer = gl_renderer; - gpu_info.gl_version_string = gl_version; + gpu_info.gl_version = gl_version; gpu::CollectDriverInfoGL(&gpu_info); @@ -529,7 +542,7 @@ void GpuDataManagerImplPrivate::GetGLStrings(std::string* gl_vendor, *gl_vendor = gpu_info_.gl_vendor; *gl_renderer = gpu_info_.gl_renderer; - *gl_version = gpu_info_.gl_version_string; + *gl_version = gpu_info_.gl_version; } void GpuDataManagerImplPrivate::Initialize() { @@ -581,16 +594,7 @@ void GpuDataManagerImplPrivate::Initialize() { gpu_info); } -void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { - // No further update of gpu_info if falling back to SwiftShader. - if (use_swiftshader_) - return; - - gpu::MergeGPUInfo(&gpu_info_, gpu_info); - gpu::DetermineActiveGPU(&gpu_info_); - complete_gpu_info_already_requested_ = - complete_gpu_info_already_requested_ || gpu_info_.finalized; - +void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() { GetContentClient()->SetGpuInfo(gpu_info_); if (gpu_blacklist_) { @@ -605,12 +609,25 @@ void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( gpu::GpuControlList::kOsAny, std::string(), gpu_info_); } - AdjustGpuSwitchingOption(&gpu_driver_bugs_); + gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( + &gpu_driver_bugs_, *CommandLine::ForCurrentProcess()); // We have to update GpuFeatureType before notify all the observers. NotifyGpuInfoUpdate(); } +void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { + // No further update of gpu_info if falling back to SwiftShader. + if (use_swiftshader_) + return; + + gpu::MergeGPUInfo(&gpu_info_, gpu_info); + complete_gpu_info_already_requested_ = + complete_gpu_info_already_requested_ || gpu_info_.finalized; + + UpdateGpuInfoHelper(); +} + void GpuDataManagerImplPrivate::UpdateVideoMemoryUsageStats( const GPUVideoMemoryUsageStats& video_memory_usage_stats) { GpuDataManagerImpl::UnlockedSession session(owner_); @@ -622,13 +639,6 @@ void GpuDataManagerImplPrivate::AppendRendererCommandLine( CommandLine* command_line) const { DCHECK(command_line); - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL)) { - if (!command_line->HasSwitch(switches::kDisablePepper3d)) - command_line->AppendSwitch(switches::kDisablePepper3d); - } - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) && - !command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) - command_line->AppendSwitch(switches::kDisableAcceleratedCompositing); if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && !command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode)) command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode); @@ -638,15 +648,9 @@ void GpuDataManagerImplPrivate::AppendRendererCommandLine( command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); #endif - if (use_software_compositor_ && - !command_line->HasSwitch(switches::kEnableSoftwareCompositing)) - command_line->AppendSwitch(switches::kEnableSoftwareCompositing); - #if defined(USE_AURA) - if (!CanUseGpuBrowserCompositor()) { + if (!CanUseGpuBrowserCompositor()) command_line->AppendSwitch(switches::kDisableGpuCompositing); - command_line->AppendSwitch(switches::kDisablePepper3d); - } #endif } @@ -654,20 +658,11 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( CommandLine* command_line) const { DCHECK(command_line); - bool reduce_sandbox = false; - std::string use_gl = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kUseGL); base::FilePath swiftshader_path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( switches::kSwiftShaderPath); - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) && - !command_line->HasSwitch(switches::kDisableGLMultisampling)) { - command_line->AppendSwitch(switches::kDisableGLMultisampling); - } - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING)) { - command_line->AppendSwitch(switches::kDisableImageTransportSurface); - } if (gpu_driver_bugs_.find(gpu::DISABLE_D3D11) != gpu_driver_bugs_.end()) command_line->AppendSwitch(switches::kDisableD3D11); if (use_swiftshader_) { @@ -675,11 +670,10 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( if (swiftshader_path.empty()) swiftshader_path = swiftshader_path_; } else if ((IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL) || - IsFeatureBlacklisted( - gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || + IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING) || IsFeatureBlacklisted( gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) && - (use_gl == "any")) { + (use_gl == "any")) { command_line->AppendSwitchASCII( switches::kUseGL, gfx::kGLImplementationOSMesaName); } else if (!use_gl.empty()) { @@ -711,24 +705,6 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine( } #endif -#if defined(OS_WIN) - // DisplayLink 7.1 and earlier can cause the GPU process to crash on startup. - // http://crbug.com/177611 - // Thinkpad USB Port Replicator driver causes GPU process to crash when the - // sandbox is enabled. http://crbug.com/181665. - if ((gpu_info_.display_link_version.IsValid() - && gpu_info_.display_link_version.IsOlderThan("7.2")) || - gpu_info_.lenovo_dcute) { - reduce_sandbox = true; - } -#endif - - if (gpu_info_.optimus) - reduce_sandbox = true; - - if (reduce_sandbox) - command_line->AppendSwitch(switches::kReduceGpuSandbox); - // Pass GPU and driver information to GPU process. We try to avoid full GPU // info collection at GPU process startup, but we need gpu vendor_id, // device_id, driver_vendor, driver_version for deciding whether we need to @@ -751,9 +727,7 @@ void GpuDataManagerImplPrivate::AppendPluginCommandLine( // TODO(jbauman): Add proper blacklist support for core animation plugins so // special-casing this video card won't be necessary. See // http://crbug.com/134015 - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableAcceleratedCompositing)) { + if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) { if (!command_line->HasSwitch( switches::kDisableCoreAnimationPlugins)) command_line->AppendSwitch( @@ -766,10 +740,10 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs( WebPreferences* prefs) const { DCHECK(prefs); - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING)) - prefs->accelerated_compositing_enabled = false; - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL)) + if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL)) { prefs->experimental_webgl_enabled = false; + prefs->pepper_3d_enabled = false; + } if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH3D)) prefs->flash_3d_enabled = false; if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FLASH_STAGE3D)) { @@ -780,38 +754,23 @@ void GpuDataManagerImplPrivate::UpdateRendererWebPrefs( prefs->flash_stage3d_baseline_enabled = false; if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)) prefs->accelerated_2d_canvas_enabled = false; - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_MULTISAMPLING) || + if (IsDriverBugWorkaroundActive(gpu::DISABLE_MULTISAMPLING) || (IsDriverBugWorkaroundActive(gpu::DISABLE_MULTIMONITOR_MULTISAMPLING) && display_count_ > 1)) prefs->gl_multisampling_enabled = false; - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_3D_CSS)) { - prefs->accelerated_compositing_for_3d_transforms_enabled = false; - prefs->accelerated_compositing_for_animation_enabled = false; - } - if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO)) - prefs->accelerated_compositing_for_video_enabled = false; - - // Accelerated video and animation are slower than regular when using - // SwiftShader. 3D CSS may also be too slow to be worthwhile. - if (ShouldUseSwiftShader()) { - prefs->accelerated_compositing_for_video_enabled = false; - prefs->accelerated_compositing_for_animation_enabled = false; - prefs->accelerated_compositing_for_3d_transforms_enabled = false; - prefs->accelerated_compositing_for_plugins_enabled = false; - } - - if (use_software_compositor_) { - prefs->force_compositing_mode = true; - prefs->accelerated_compositing_enabled = true; - prefs->accelerated_compositing_for_3d_transforms_enabled = true; - prefs->accelerated_compositing_for_plugins_enabled = true; - prefs->accelerated_compositing_for_video_enabled = true; - } #if defined(USE_AURA) - if (!CanUseGpuBrowserCompositor()) + if (!CanUseGpuBrowserCompositor()) { prefs->accelerated_2d_canvas_enabled = false; + prefs->pepper_3d_enabled = false; + } #endif + + if (!IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableAcceleratedVideoDecode)) { + prefs->pepper_accelerated_video_decode_enabled = true; + } } void GpuDataManagerImplPrivate::DisableHardwareAcceleration() { @@ -839,7 +798,9 @@ std::string GpuDataManagerImplPrivate::GetDriverBugListVersion() const { void GpuDataManagerImplPrivate::GetBlacklistReasons( base::ListValue* reasons) const { if (gpu_blacklist_) - gpu_blacklist_->GetReasons(reasons); + gpu_blacklist_->GetReasons(reasons, "disabledFeatures"); + if (gpu_driver_bug_list_) + gpu_driver_bug_list_->GetReasons(reasons, "workarounds"); } void GpuDataManagerImplPrivate::GetDriverBugWorkarounds( @@ -894,24 +855,40 @@ void GpuDataManagerImplPrivate::HandleGpuSwitch() { observer_list_->Notify(&GpuDataManagerObserver::OnGpuSwitching); } -#if defined(OS_WIN) -bool GpuDataManagerImplPrivate::IsUsingAcceleratedSurface() const { - if (base::win::GetVersion() < base::win::VERSION_VISTA) - return false; - - if (use_swiftshader_) - return false; - CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kDisableImageTransportSurface)) - return false; - return !IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING); +bool GpuDataManagerImplPrivate::UpdateActiveGpu( + uint32 vendor_id, uint32 device_id) { + if (gpu_info_.gpu.vendor_id == vendor_id && + gpu_info_.gpu.device_id == device_id) { + // The primary GPU is active. + if (gpu_info_.gpu.active) + return false; + gpu_info_.gpu.active = true; + for (size_t ii = 0; ii < gpu_info_.secondary_gpus.size(); ++ii) + gpu_info_.secondary_gpus[ii].active = false; + } else { + // A secondary GPU is active. + for (size_t ii = 0; ii < gpu_info_.secondary_gpus.size(); ++ii) { + if (gpu_info_.secondary_gpus[ii].vendor_id == vendor_id && + gpu_info_.secondary_gpus[ii].device_id == device_id) { + if (gpu_info_.secondary_gpus[ii].active) + return false; + gpu_info_.secondary_gpus[ii].active = true; + } else { + gpu_info_.secondary_gpus[ii].active = false; + } + } + gpu_info_.gpu.active = false; + } + UpdateGpuInfoHelper(); + return true; } -#endif bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const { - return !ShouldUseSwiftShader() && - !IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) && - !IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE); + if (ShouldUseSwiftShader()) + return false; + if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING)) + return false; + return true; } void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( @@ -960,22 +937,11 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate( owner_(owner), display_count_(0), gpu_process_accessible_(true), - use_software_compositor_(false), finalized_(false) { DCHECK(owner_); CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { - command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); - command_line->AppendSwitch(switches::kDisableAcceleratedLayers); - } if (command_line->HasSwitch(switches::kDisableGpu)) DisableHardwareAcceleration(); - if (command_line->HasSwitch(switches::kEnableSoftwareCompositing)) - use_software_compositor_ = true; - //TODO(jbauman): enable for Chrome OS and Linux -#if defined(USE_AURA) && !defined(OS_CHROMEOS) - use_software_compositor_ = true; -#endif #if defined(OS_MACOSX) CGGetActiveDisplayList (0, NULL, &display_count_); @@ -1024,36 +990,20 @@ void GpuDataManagerImplPrivate::InitializeImpl( UpdateGpuSwitchingManager(gpu_info); UpdatePreliminaryBlacklistedFeatures(); - CommandLine* command_line = CommandLine::ForCurrentProcess(); - // We pass down the list to GPU command buffer through commandline - // switches at GPU process launch. However, in situations where we don't - // have a GPU process, we append the browser process commandline. - if (command_line->HasSwitch(switches::kSingleProcess) || - command_line->HasSwitch(switches::kInProcessGPU)) { - if (!gpu_driver_bugs_.empty()) { - command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, - IntSetToString(gpu_driver_bugs_)); - } - } #if defined(OS_ANDROID) - ApplyAndroidWorkarounds(gpu_info, command_line); + ApplyAndroidWorkarounds( + gpu_info, CommandLine::ForCurrentProcess(), &gpu_driver_bugs_); #endif // OS_ANDROID } void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures( const std::set<int>& features) { - CommandLine* command_line = CommandLine::ForCurrentProcess(); blacklisted_features_ = features; // Force disable using the GPU for these features, even if they would // otherwise be allowed. - if (card_blacklisted_ || - command_line->HasSwitch(switches::kBlacklistAcceleratedCompositing)) { - blacklisted_features_.insert( - gpu::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING); - } - if (card_blacklisted_ || - command_line->HasSwitch(switches::kBlacklistWebGL)) { + if (card_blacklisted_) { + blacklisted_features_.insert(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING); blacklisted_features_.insert(gpu::GPU_FEATURE_TYPE_WEBGL); } |