diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 18:11:57 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 18:11:57 +0000 |
commit | 9c2985a474815d0fd41b38c8ec418e15d34dc6a8 (patch) | |
tree | 118cf02ad918718570eb07614719db8f5303bb32 /content/browser/gpu/gpu_internals_ui.cc | |
parent | 398fa730d4d71fc5510fc93e0e832e239eecddfd (diff) | |
download | chromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.zip chromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.tar.gz chromium_src-9c2985a474815d0fd41b38c8ec418e15d34dc6a8.tar.bz2 |
Change GpuControlList features from bits of int to set.
Before, we limit to manage 32 features. Now we can manage as many as we want.
BUG=222857
TEST=content_unittests, waterfall
Review URL: https://codereview.chromium.org/13240002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191858 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/gpu/gpu_internals_ui.cc')
-rw-r--r-- | content/browser/gpu/gpu_internals_ui.cc | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index 62b85e3..a4ad6a5 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc @@ -25,6 +25,7 @@ #include "content/public/browser/web_ui_message_handler.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" +#include "content/public/common/gpu_feature_type.h" #include "content/public/common/gpu_info.h" #include "content/public/common/url_constants.h" #include "grit/content_resources.h" @@ -191,16 +192,15 @@ bool SupportsAccelerated2dCanvas() { base::Value* GetFeatureStatus() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - bool gpu_access_blocked = - !GpuDataManagerImpl::GetInstance()->GpuAccessAllowed(); + GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance(); + bool gpu_access_blocked = !manager->GpuAccessAllowed(); - uint32 flags = GpuDataManagerImpl::GetInstance()->GetBlacklistedFeatures(); base::DictionaryValue* status = new base::DictionaryValue(); const GpuFeatureInfo kGpuFeatureInfo[] = { { "2d_canvas", - flags & GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS), command_line.HasSwitch(switches::kDisableAccelerated2dCanvas) || !SupportsAccelerated2dCanvas(), "Accelerated 2D canvas is unavailable: either disabled at the command" @@ -209,7 +209,8 @@ base::Value* GetFeatureStatus() { }, { "compositing", - flags & GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING, + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING), command_line.HasSwitch(switches::kDisableAcceleratedCompositing), "Accelerated compositing has been disabled, either via about:flags or" " command line. This adversely affects performance of all hardware" @@ -218,16 +219,18 @@ base::Value* GetFeatureStatus() { }, { "3d_css", - flags & (GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | - GPU_FEATURE_TYPE_3D_CSS), + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_3D_CSS), command_line.HasSwitch(switches::kDisableAcceleratedLayers), "Accelerated layers have been disabled at the command line.", false }, { "css_animation", - flags & (GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | - GPU_FEATURE_TYPE_3D_CSS), + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) || + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_3D_CSS), command_line.HasSwitch(cc::switches::kDisableThreadedAnimation) || command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || command_line.HasSwitch(switches::kDisableAcceleratedLayers), @@ -236,7 +239,7 @@ base::Value* GetFeatureStatus() { }, { "webgl", - flags & GPU_FEATURE_TYPE_WEBGL, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_WEBGL), #if defined(OS_ANDROID) !command_line.HasSwitch(switches::kEnableExperimentalWebGL), #else @@ -247,7 +250,7 @@ base::Value* GetFeatureStatus() { }, { "multisampling", - flags & GPU_FEATURE_TYPE_MULTISAMPLING, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_MULTISAMPLING), command_line.HasSwitch(switches::kDisableGLMultisampling), "Multisampling has been disabled, either via about:flags or command" " line.", @@ -255,7 +258,7 @@ base::Value* GetFeatureStatus() { }, { "flash_3d", - flags & GPU_FEATURE_TYPE_FLASH3D, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH3D), command_line.HasSwitch(switches::kDisableFlash3d), "Using 3d in flash has been disabled, either via about:flags or" " command line.", @@ -263,7 +266,7 @@ base::Value* GetFeatureStatus() { }, { "flash_stage3d", - flags & GPU_FEATURE_TYPE_FLASH_STAGE3D, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH_STAGE3D), command_line.HasSwitch(switches::kDisableFlashStage3d), "Using Stage3d in Flash has been disabled, either via about:flags or" " command line.", @@ -271,8 +274,9 @@ base::Value* GetFeatureStatus() { }, { "flash_stage3d_baseline", - flags & (content::GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE | - content::GPU_FEATURE_TYPE_FLASH_STAGE3D), + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) || + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_FLASH_STAGE3D), command_line.HasSwitch(switches::kDisableFlashStage3d), "Using Stage3d Baseline profile in Flash has been disabled, either" " via about:flags or command line.", @@ -280,7 +284,7 @@ base::Value* GetFeatureStatus() { }, { "texture_sharing", - flags & GPU_FEATURE_TYPE_TEXTURE_SHARING, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_TEXTURE_SHARING), command_line.HasSwitch(switches::kDisableImageTransportSurface), "Sharing textures between processes has been disabled, either via" " about:flags or command line.", @@ -288,7 +292,8 @@ base::Value* GetFeatureStatus() { }, { "video_decode", - flags & GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE, + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE), command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode), "Accelerated video decode has been disabled, either via about:flags" " or command line.", @@ -296,7 +301,7 @@ base::Value* GetFeatureStatus() { }, { "video", - flags & GPU_FEATURE_TYPE_ACCELERATED_VIDEO, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_ACCELERATED_VIDEO), command_line.HasSwitch(switches::kDisableAcceleratedVideo) || command_line.HasSwitch(switches::kDisableAcceleratedCompositing), "Accelerated video presentation has been disabled, either via" @@ -305,7 +310,7 @@ base::Value* GetFeatureStatus() { }, { "panel_fitting", - flags & GPU_FEATURE_TYPE_PANEL_FITTING, + manager->IsFeatureBlacklisted(GPU_FEATURE_TYPE_PANEL_FITTING), #if defined(OS_CHROMEOS) command_line.HasSwitch(switches::kDisablePanelFitting), #else @@ -317,10 +322,12 @@ base::Value* GetFeatureStatus() { }, { "force_compositing_mode", - (flags & GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) && + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) && !IsForceCompositingModeEnabled(), !IsForceCompositingModeEnabled() && - !(flags & GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE), + !manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE), "Force compositing mode is off, either disabled at the command" " line or not supported by the current system.", false @@ -375,7 +382,8 @@ base::Value* GetFeatureStatus() { status = "enabled"; if (kGpuFeatureInfo[i].name == "webgl" && (command_line.HasSwitch(switches::kDisableAcceleratedCompositing) || - (flags & GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) + manager->IsFeatureBlacklisted( + GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING))) status += "_readback"; bool has_thread = IsThreadedCompositingEnabled(); if (kGpuFeatureInfo[i].name == "compositing") { |