diff options
author | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 20:23:10 +0000 |
---|---|---|
committer | zmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-17 20:23:10 +0000 |
commit | 577dd6e274bfb1cf9c7db707f2154b5a05a7dbf9 (patch) | |
tree | 17a61663dcef952c80e6a2180fcef2c7ed66307d | |
parent | 493f4522070f1851d27e22076f1374afbb440d61 (diff) | |
download | chromium_src-577dd6e274bfb1cf9c7db707f2154b5a05a7dbf9.zip chromium_src-577dd6e274bfb1cf9c7db707f2154b5a05a7dbf9.tar.gz chromium_src-577dd6e274bfb1cf9c7db707f2154b5a05a7dbf9.tar.bz2 |
Merge 177239
> Add force_compositing_mode support in gpu blacklist.
>
> So we can turn them off on older windows drivers between 2007 and 2009.
>
> BUG=169938
> TEST=content_unittests
> Review URL: https://codereview.chromium.org/11930003
TBR=zmo@chromium.org
Review URL: https://codereview.chromium.org/12008002
git-svn-id: svn://svn.chromium.org/chrome/branches/1364/src@177461 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/gpu_internals/info_view.js | 1 | ||||
-rw-r--r-- | chrome/browser/ui/webui/gpu_internals_ui.cc | 9 | ||||
-rw-r--r-- | content/browser/gpu/compositor_util.cc | 17 | ||||
-rw-r--r-- | content/browser/gpu/gpu_blacklist.cc | 1 | ||||
-rw-r--r-- | content/browser/gpu/gpu_util.cc | 5 | ||||
-rw-r--r-- | content/browser/gpu/gpu_util_unittest.cc | 5 | ||||
-rw-r--r-- | content/browser/gpu/software_rendering_list.json | 18 | ||||
-rw-r--r-- | content/public/common/gpu_feature_type.h | 4 |
8 files changed, 50 insertions, 10 deletions
diff --git a/chrome/browser/resources/gpu_internals/info_view.js b/chrome/browser/resources/gpu_internals/info_view.js index 4316b58..88c8e0e 100644 --- a/chrome/browser/resources/gpu_internals/info_view.js +++ b/chrome/browser/resources/gpu_internals/info_view.js @@ -88,6 +88,7 @@ cr.define('gpu', function() { // GPU Switching 'gpu_switching': 'GPU Switching', 'panel_fitting': 'Panel Fitting', + 'force_compositing_mode': 'Force Compositing Mode', }; var statusLabelMap = { 'disabled_software': 'Software only. Hardware acceleration disabled.', diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index 8fb021b..8458e74 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -318,6 +318,15 @@ Value* GetFeatureStatus() { "Panel fitting is unavailable, either disabled at the command" " line or not supported by the current system.", false + }, + { + "force_compositing_mode", + flags & content::GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE, + !content::IsForceCompositingModeEnabled() && + !(flags & content::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 } }; const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo); diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc index d954590..9628215 100644 --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc @@ -36,6 +36,13 @@ bool CanDoAcceleratedCompositing() { return true; } +bool IsForceCompositingModeBlacklisted() { + GpuFeatureType blacklisted_features = + GpuDataManager::GetInstance()->GetBlacklistedFeatures(); + return GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE == + (blacklisted_features & GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE); +} + } // namespace bool IsThreadedCompositingEnabled() { @@ -49,7 +56,7 @@ bool IsThreadedCompositingEnabled() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - // Command line switches take precedence over field trials. + // Command line switches take precedence over blacklist and field trials. if (command_line.HasSwitch(switches::kDisableForceCompositingMode) || command_line.HasSwitch(switches::kDisableThreadedCompositing)) return false; @@ -57,6 +64,9 @@ bool IsThreadedCompositingEnabled() { if (command_line.HasSwitch(switches::kEnableThreadedCompositing)) return true; + if (IsForceCompositingModeBlacklisted()) + return false; + base::FieldTrial* trial = base::FieldTrialList::Find(kGpuCompositingFieldTrialName); return trial && @@ -74,13 +84,16 @@ bool IsForceCompositingModeEnabled() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - // Command line switches take precedence over field trials. + // Command line switches take precedence over blacklisting and field trials. if (command_line.HasSwitch(switches::kDisableForceCompositingMode)) return false; if (command_line.HasSwitch(switches::kForceCompositingMode)) return true; + if (IsForceCompositingModeBlacklisted()) + return false; + base::FieldTrial* trial = base::FieldTrialList::Find(kGpuCompositingFieldTrialName); diff --git a/content/browser/gpu/gpu_blacklist.cc b/content/browser/gpu/gpu_blacklist.cc index 039854f..b1cfcca 100644 --- a/content/browser/gpu/gpu_blacklist.cc +++ b/content/browser/gpu/gpu_blacklist.cc @@ -954,6 +954,7 @@ bool GpuBlacklist::GpuBlacklistEntry::SetBlacklistedFeatures( case GPU_FEATURE_TYPE_3D_CSS: case GPU_FEATURE_TYPE_ACCELERATED_VIDEO: case GPU_FEATURE_TYPE_PANEL_FITTING: + case GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE: case GPU_FEATURE_TYPE_ALL: feature_type |= type; break; diff --git a/content/browser/gpu/gpu_util.cc b/content/browser/gpu/gpu_util.cc index 622628a..5de32a8 100644 --- a/content/browser/gpu/gpu_util.cc +++ b/content/browser/gpu/gpu_util.cc @@ -29,6 +29,7 @@ const char kGpuFeatureNameAcceleratedVideoDecode[] = "accelerated_video_decode"; const char kGpuFeatureName3dCss[] = "3d_css"; const char kGpuFeatureNameAcceleratedVideo[] = "accelerated_video"; const char kGpuFeatureNamePanelFitting[] = "panel_fitting"; +const char kGpuFeatureNameForceCompositingMode[] = "force_compositing_mode"; const char kGpuFeatureNameAll[] = "all"; const char kGpuFeatureNameUnknown[] = "unknown"; @@ -108,6 +109,8 @@ GpuFeatureType StringToGpuFeatureType(const std::string& feature_string) { return GPU_FEATURE_TYPE_ACCELERATED_VIDEO; if (feature_string == kGpuFeatureNamePanelFitting) return GPU_FEATURE_TYPE_PANEL_FITTING; + if (feature_string == kGpuFeatureNameForceCompositingMode) + return GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE; if (feature_string == kGpuFeatureNameAll) return GPU_FEATURE_TYPE_ALL; return GPU_FEATURE_TYPE_UNKNOWN; @@ -140,6 +143,8 @@ std::string GpuFeatureTypeToString(GpuFeatureType type) { matches.push_back(kGpuFeatureNameAcceleratedVideo); if (type & GPU_FEATURE_TYPE_PANEL_FITTING) matches.push_back(kGpuFeatureNamePanelFitting); + if (type & GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE) + matches.push_back(kGpuFeatureNameForceCompositingMode); if (!matches.size()) matches.push_back(kGpuFeatureNameUnknown); } diff --git a/content/browser/gpu/gpu_util_unittest.cc b/content/browser/gpu/gpu_util_unittest.cc index 9d5de36..bb1ef2b 100644 --- a/content/browser/gpu/gpu_util_unittest.cc +++ b/content/browser/gpu/gpu_util_unittest.cc @@ -29,6 +29,8 @@ TEST(GpuUtilsTest, GpuFeatureTypFromString) { GPU_FEATURE_TYPE_ACCELERATED_VIDEO); EXPECT_EQ(StringToGpuFeatureType("panel_fitting"), GPU_FEATURE_TYPE_PANEL_FITTING); + EXPECT_EQ(StringToGpuFeatureType("force_compositing_mode"), + GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE); EXPECT_EQ(StringToGpuFeatureType("all"), GPU_FEATURE_TYPE_ALL); EXPECT_EQ(StringToGpuFeatureType("xxx"), GPU_FEATURE_TYPE_UNKNOWN); } @@ -66,6 +68,9 @@ TEST(GpuUtilsTest, GpuFeatureTypeToString) { GpuFeatureTypeToString(GPU_FEATURE_TYPE_PANEL_FITTING).c_str(), "panel_fitting"); EXPECT_STREQ( + GpuFeatureTypeToString(GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE).c_str(), + "force_compositing_mode"); + EXPECT_STREQ( GpuFeatureTypeToString(GPU_FEATURE_TYPE_ALL).c_str(), "all"); EXPECT_STREQ(GpuFeatureTypeToString( GPU_FEATURE_TYPE_UNKNOWN).c_str(), "unknown"); diff --git a/content/browser/gpu/software_rendering_list.json b/content/browser/gpu/software_rendering_list.json index b7ab029..5a49011 100644 --- a/content/browser/gpu/software_rendering_list.json +++ b/content/browser/gpu/software_rendering_list.json @@ -41,8 +41,8 @@ // 19. "blacklist" is a list of gpu feature strings, valid values include // "accelerated_2d_canvas", "accelerated_compositing", "webgl", // "multisampling", "flash_3d", "flash_stage3d", "texture_sharing", -// "accelerated_video", "accelerated_video_decode", "panel_fitting", and -// "all". +// "accelerated_video", "accelerated_video_decode", "panel_fitting", +// "force_compositing_mode", and "all". // This field is mandatory. // 20. "description" has the description of the entry. // 21. "webkit_bugs" is an array of associated webkit bug numbers. @@ -75,7 +75,7 @@ { "name": "software rendering list", // Please update the version number whenever you change this file. - "version": "4.9", + "version": "4.10", "entries": [ { "id": 1, @@ -200,7 +200,8 @@ "accelerated_video_decode", "3d_css", "multisampling", - "flash_3d" + "flash_3d", + "force_compositing_mode" ] }, { @@ -224,7 +225,8 @@ "accelerated_video_decode", "3d_css", "multisampling", - "flash_3d" + "flash_3d", + "force_compositing_mode" ] }, { @@ -248,7 +250,8 @@ "accelerated_video_decode", "3d_css", "multisampling", - "flash_3d" + "flash_3d", + "force_compositing_mode" ] }, { @@ -272,7 +275,8 @@ "accelerated_video_decode", "3d_css", "multisampling", - "flash_3d" + "flash_3d", + "force_compositing_mode" ] }, { diff --git a/content/public/common/gpu_feature_type.h b/content/public/common/gpu_feature_type.h index a862af3..3d75e10 100644 --- a/content/public/common/gpu_feature_type.h +++ b/content/public/common/gpu_feature_type.h @@ -22,6 +22,7 @@ enum GpuFeatureType { GPU_FEATURE_TYPE_3D_CSS = 1 << 8, GPU_FEATURE_TYPE_ACCELERATED_VIDEO = 1 << 9, GPU_FEATURE_TYPE_PANEL_FITTING = 1 << 10, + GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE = 1 << 11, GPU_FEATURE_TYPE_ALL = GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS | GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING | GPU_FEATURE_TYPE_WEBGL | @@ -32,7 +33,8 @@ enum GpuFeatureType { GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE | GPU_FEATURE_TYPE_3D_CSS | GPU_FEATURE_TYPE_ACCELERATED_VIDEO | - GPU_FEATURE_TYPE_PANEL_FITTING, + GPU_FEATURE_TYPE_PANEL_FITTING | + GPU_FEATURE_TYPE_FORCE_COMPOSITING_MODE, // All flags initialized to false, i.e., no feature is blacklisted. GPU_FEATURE_TYPE_UNKNOWN = 0 }; |