Commit e82ac463 authored by zmo@chromium.org's avatar zmo@chromium.org

Add accelerated_video_decode as a GPU blacklist feature.

Note that this CL does not hook the blacklist with the disabling of the feature.  Will do that in another CL.

BUG=139683
TEST=unit_tests
TBR=jam
Review URL: https://chromiumcodereview.appspot.com/10831081

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149275 0039d316-1c4b-4281-b951-d872f2087c98
parent 23f720d3
......@@ -771,6 +771,7 @@ bool GpuBlacklist::GpuBlacklistEntry::SetBlacklistedFeatures(
case content::GPU_FEATURE_TYPE_FLASH3D:
case content::GPU_FEATURE_TYPE_FLASH_STAGE3D:
case content::GPU_FEATURE_TYPE_TEXTURE_SHARING:
case content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE:
case content::GPU_FEATURE_TYPE_ALL:
feature_type |= type;
break;
......
......@@ -954,3 +954,32 @@ TEST_F(GpuBlacklistTest, MultipleGPUsSecondary) {
EXPECT_EQ(type, content::GPU_FEATURE_TYPE_WEBGL);
}
TEST_F(GpuBlacklistTest, VideoDecode) {
const std::string video_decode_json =
"{\n"
" \"name\": \"gpu blacklist\",\n"
" \"version\": \"0.1\",\n"
" \"entries\": [\n"
" {\n"
" \"id\": 1,\n"
" \"os\": {\n"
" \"type\": \"macosx\"\n"
" },\n"
" \"vendor_id\": \"0x10de\",\n"
" \"device_id\": [\"0x0640\"],\n"
" \"blacklist\": [\n"
" \"accelerated_video_decode\"\n"
" ]\n"
" }\n"
" ]\n"
"}";
Version os_version("10.6.4");
scoped_ptr<GpuBlacklist> blacklist(Create());
EXPECT_TRUE(blacklist->LoadGpuBlacklist(
video_decode_json, GpuBlacklist::kAllOs));
GpuFeatureType type = blacklist->DetermineGpuFeatureType(
GpuBlacklist::kOsMacosx, &os_version, gpu_info());
EXPECT_EQ(type, content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE);
}
......@@ -40,6 +40,7 @@ const char kGpuFeatureNameMultisampling[] = "multisampling";
const char kGpuFeatureNameFlash3d[] = "flash_3d";
const char kGpuFeatureNameFlashStage3d[] = "flash_stage3d";
const char kGpuFeatureNameTextureSharing[] = "texture_sharing";
const char kGpuFeatureNameAcceleratedVideoDecode[] = "accelerated_video_decode";
const char kGpuFeatureNameAll[] = "all";
const char kGpuFeatureNameUnknown[] = "unknown";
......@@ -258,6 +259,8 @@ GpuFeatureType StringToGpuFeatureType(const std::string& feature_string) {
return content::GPU_FEATURE_TYPE_FLASH_STAGE3D;
else if (feature_string == kGpuFeatureNameTextureSharing)
return content::GPU_FEATURE_TYPE_TEXTURE_SHARING;
else if (feature_string == kGpuFeatureNameAcceleratedVideoDecode)
return content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE;
else if (feature_string == kGpuFeatureNameAll)
return content::GPU_FEATURE_TYPE_ALL;
return content::GPU_FEATURE_TYPE_UNKNOWN;
......@@ -371,6 +374,14 @@ Value* GetFeatureStatus() {
"Sharing textures between processes has been disabled, either via"
" about:flags or command line.",
false
},
{
"video_decode",
flags & content::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE,
command_line.HasSwitch(switches::kDisableAcceleratedVideoDecode),
"Accelerated video decode has been disabled, either via about:flags"
" or command line.",
true
}
};
const size_t kNumFeatures = sizeof(kGpuFeatureInfo) / sizeof(GpuFeatureInfo);
......
......@@ -52,6 +52,7 @@ std::string GpuFeatureTypeToString(content::GpuFeatureType feature);
// 'flash_3d',
// 'flash_stage3d',
// 'texture_sharing'
// 'video_decode'
//
// Each problems has:
// {
......
......@@ -18,13 +18,15 @@ enum GpuFeatureType {
GPU_FEATURE_TYPE_FLASH3D = 1 << 4,
GPU_FEATURE_TYPE_FLASH_STAGE3D = 1 << 5,
GPU_FEATURE_TYPE_TEXTURE_SHARING = 1 << 6,
GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE = 1 << 7,
GPU_FEATURE_TYPE_ALL = GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS |
GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING |
GPU_FEATURE_TYPE_WEBGL |
GPU_FEATURE_TYPE_MULTISAMPLING |
GPU_FEATURE_TYPE_FLASH3D |
GPU_FEATURE_TYPE_FLASH_STAGE3D |
GPU_FEATURE_TYPE_TEXTURE_SHARING,
GPU_FEATURE_TYPE_TEXTURE_SHARING |
GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE,
// All flags initialized to false, i.e., no feature is blacklisted.
GPU_FEATURE_TYPE_UNKNOWN = 0
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment