summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-12 21:36:15 +0000
committerzmo@chromium.org <zmo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-12 21:38:33 +0000
commit220698aaf8077d85505d76a26f7fa0f909b83b58 (patch)
treefb3b079e4fb8dcfa66d4d5807c84abd0bf2d7adb /gpu
parent22d40e2a6ce678247af3479ec0861b643dcae711 (diff)
downloadchromium_src-220698aaf8077d85505d76a26f7fa0f909b83b58.zip
chromium_src-220698aaf8077d85505d76a26f7fa0f909b83b58.tar.gz
chromium_src-220698aaf8077d85505d76a26f7fa0f909b83b58.tar.bz2
Use RE string pattern matching for blacklist strings.
Including cpu_brand, gl_vendor, gl_renderer, gl_extension, driver_vendor, and machine_model_name. BUG=396578 TBR=piman@chromium.org TEST=gpu_unittests Review URL: https://codereview.chromium.org/452293002 Cr-Commit-Position: refs/heads/master@{#289067} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/BUILD.gn1
-rw-r--r--gpu/config/gpu_control_list.cc147
-rw-r--r--gpu/config/gpu_control_list.h51
-rw-r--r--gpu/config/gpu_control_list_entry_unittest.cc200
-rw-r--r--gpu/config/gpu_control_list_format.txt20
-rw-r--r--gpu/config/gpu_control_list_string_info_unittest.cc98
-rw-r--r--gpu/config/gpu_control_list_unittest.cc5
-rw-r--r--gpu/config/gpu_driver_bug_list_json.cc187
-rw-r--r--gpu/config/software_rendering_list_json.cc142
-rw-r--r--gpu/gpu.gyp1
10 files changed, 297 insertions, 555 deletions
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn
index 7c8acc8..fc7a4ac 100644
--- a/gpu/BUILD.gn
+++ b/gpu/BUILD.gn
@@ -209,7 +209,6 @@ test("gpu_unittests") {
"config/gpu_control_list_entry_unittest.cc",
"config/gpu_control_list_number_info_unittest.cc",
"config/gpu_control_list_os_info_unittest.cc",
- "config/gpu_control_list_string_info_unittest.cc",
"config/gpu_control_list_unittest.cc",
"config/gpu_control_list_version_info_unittest.cc",
"config/gpu_driver_bug_list_unittest.cc",
diff --git a/gpu/config/gpu_control_list.cc b/gpu/config/gpu_control_list.cc
index 444c186..f5ccd61 100644
--- a/gpu/config/gpu_control_list.cc
+++ b/gpu/config/gpu_control_list.cc
@@ -14,6 +14,7 @@
#include "base/sys_info.h"
#include "gpu/config/gpu_info.h"
#include "gpu/config/gpu_util.h"
+#include "third_party/re2/re2/re2.h"
namespace gpu {
namespace {
@@ -89,6 +90,13 @@ int CompareLexicalNumberStrings(
return 0;
}
+// A mismatch is identified only if both |input| and |pattern| are not empty.
+bool StringMismatch(const std::string& input, const std::string& pattern) {
+ if (input.empty() || pattern.empty())
+ return false;
+ return !RE2::FullMatch(input, pattern);
+}
+
const char kMultiGpuStyleStringAMDSwitchable[] = "amd_switchable";
const char kMultiGpuStyleStringAMDSwitchableDiscrete[] =
"amd_switchable_discrete";
@@ -261,45 +269,6 @@ GpuControlList::OsType GpuControlList::OsInfo::StringToOsType(
return kOsUnknown;
}
-GpuControlList::StringInfo::StringInfo(const std::string& string_op,
- const std::string& string_value) {
- op_ = StringToOp(string_op);
- value_ = base::StringToLowerASCII(string_value);
-}
-
-bool GpuControlList::StringInfo::Contains(const std::string& value) const {
- std::string my_value = base::StringToLowerASCII(value);
- switch (op_) {
- case kContains:
- return strstr(my_value.c_str(), value_.c_str()) != NULL;
- case kBeginWith:
- return StartsWithASCII(my_value, value_, false);
- case kEndWith:
- return EndsWith(my_value, value_, false);
- case kEQ:
- return value_ == my_value;
- default:
- return false;
- }
-}
-
-bool GpuControlList::StringInfo::IsValid() const {
- return op_ != kUnknown;
-}
-
-GpuControlList::StringInfo::Op GpuControlList::StringInfo::StringToOp(
- const std::string& string_op) {
- if (string_op == "=")
- return kEQ;
- else if (string_op == "contains")
- return kContains;
- else if (string_op == "beginwith")
- return kBeginWith;
- else if (string_op == "endwith")
- return kEndWith;
- return kUnknown;
-}
-
GpuControlList::FloatInfo::FloatInfo(const std::string& float_op,
const std::string& float_value,
const std::string& float_value2)
@@ -520,13 +489,9 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue(
dictionary_entry_count++;
}
- const base::DictionaryValue* driver_vendor_value = NULL;
- if (value->GetDictionary("driver_vendor", &driver_vendor_value)) {
- std::string vendor_op;
- std::string vendor_value;
- driver_vendor_value->GetString(kOp, &vendor_op);
- driver_vendor_value->GetString("value", &vendor_value);
- if (!entry->SetDriverVendorInfo(vendor_op, vendor_value)) {
+ std::string driver_vendor_value;
+ if (value->GetString("driver_vendor", &driver_vendor_value)) {
+ if (!entry->SetDriverVendorInfo(driver_vendor_value)) {
LOG(WARNING) << "Malformed driver_vendor entry " << entry->id();
return NULL;
}
@@ -594,39 +559,27 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue(
dictionary_entry_count++;
}
- const base::DictionaryValue* gl_vendor_value = NULL;
- if (value->GetDictionary("gl_vendor", &gl_vendor_value)) {
- std::string vendor_op;
- std::string vendor_value;
- gl_vendor_value->GetString(kOp, &vendor_op);
- gl_vendor_value->GetString("value", &vendor_value);
- if (!entry->SetGLVendorInfo(vendor_op, vendor_value)) {
+ std::string gl_vendor_value;
+ if (value->GetString("gl_vendor", &gl_vendor_value)) {
+ if (!entry->SetGLVendorInfo(gl_vendor_value)) {
LOG(WARNING) << "Malformed gl_vendor entry " << entry->id();
return NULL;
}
dictionary_entry_count++;
}
- const base::DictionaryValue* gl_renderer_value = NULL;
- if (value->GetDictionary("gl_renderer", &gl_renderer_value)) {
- std::string renderer_op;
- std::string renderer_value;
- gl_renderer_value->GetString(kOp, &renderer_op);
- gl_renderer_value->GetString("value", &renderer_value);
- if (!entry->SetGLRendererInfo(renderer_op, renderer_value)) {
+ std::string gl_renderer_value;
+ if (value->GetString("gl_renderer", &gl_renderer_value)) {
+ if (!entry->SetGLRendererInfo(gl_renderer_value)) {
LOG(WARNING) << "Malformed gl_renderer entry " << entry->id();
return NULL;
}
dictionary_entry_count++;
}
- const base::DictionaryValue* gl_extensions_value = NULL;
- if (value->GetDictionary("gl_extensions", &gl_extensions_value)) {
- std::string extensions_op;
- std::string extensions_value;
- gl_extensions_value->GetString(kOp, &extensions_op);
- gl_extensions_value->GetString("value", &extensions_value);
- if (!entry->SetGLExtensionsInfo(extensions_op, extensions_value)) {
+ std::string gl_extensions_value;
+ if (value->GetString("gl_extensions", &gl_extensions_value)) {
+ if (!entry->SetGLExtensionsInfo(gl_extensions_value)) {
LOG(WARNING) << "Malformed gl_extensions entry " << entry->id();
return NULL;
}
@@ -651,13 +604,9 @@ GpuControlList::GpuControlListEntry::GetEntryFromValue(
dictionary_entry_count++;
}
- const base::DictionaryValue* cpu_brand_value = NULL;
- if (value->GetDictionary("cpu_info", &cpu_brand_value)) {
- std::string cpu_op;
- std::string cpu_value;
- cpu_brand_value->GetString(kOp, &cpu_op);
- cpu_brand_value->GetString("value", &cpu_value);
- if (!entry->SetCpuBrand(cpu_op, cpu_value)) {
+ std::string cpu_brand_value;
+ if (value->GetString("cpu_info", &cpu_brand_value)) {
+ if (!entry->SetCpuBrand(cpu_brand_value)) {
LOG(WARNING) << "Malformed cpu_brand entry " << entry->id();
return NULL;
}
@@ -898,10 +847,9 @@ bool GpuControlList::GpuControlListEntry::SetGLType(
}
bool GpuControlList::GpuControlListEntry::SetDriverVendorInfo(
- const std::string& vendor_op,
const std::string& vendor_value) {
- driver_vendor_info_.reset(new StringInfo(vendor_op, vendor_value));
- return driver_vendor_info_->IsValid();
+ driver_vendor_info_ = vendor_value;
+ return !driver_vendor_info_.empty();
}
bool GpuControlList::GpuControlListEntry::SetDriverVersionInfo(
@@ -933,24 +881,21 @@ bool GpuControlList::GpuControlListEntry::SetGLVersionInfo(
}
bool GpuControlList::GpuControlListEntry::SetGLVendorInfo(
- const std::string& vendor_op,
const std::string& vendor_value) {
- gl_vendor_info_.reset(new StringInfo(vendor_op, vendor_value));
- return gl_vendor_info_->IsValid();
+ gl_vendor_info_ = vendor_value;
+ return !gl_vendor_info_.empty();
}
bool GpuControlList::GpuControlListEntry::SetGLRendererInfo(
- const std::string& renderer_op,
const std::string& renderer_value) {
- gl_renderer_info_.reset(new StringInfo(renderer_op, renderer_value));
- return gl_renderer_info_->IsValid();
+ gl_renderer_info_ = renderer_value;
+ return !gl_renderer_info_.empty();
}
bool GpuControlList::GpuControlListEntry::SetGLExtensionsInfo(
- const std::string& extensions_op,
const std::string& extensions_value) {
- gl_extensions_info_.reset(new StringInfo(extensions_op, extensions_value));
- return gl_extensions_info_->IsValid();
+ gl_extensions_info_ = extensions_value;
+ return !gl_extensions_info_.empty();
}
bool GpuControlList::GpuControlListEntry::SetGLResetNotificationStrategyInfo(
@@ -963,10 +908,9 @@ bool GpuControlList::GpuControlListEntry::SetGLResetNotificationStrategyInfo(
}
bool GpuControlList::GpuControlListEntry::SetCpuBrand(
- const std::string& cpu_op,
const std::string& cpu_value) {
- cpu_brand_.reset(new StringInfo(cpu_op, cpu_value));
- return cpu_brand_->IsValid();
+ cpu_brand_ = cpu_value;
+ return !cpu_brand_.empty();
}
bool GpuControlList::GpuControlListEntry::SetPerfGraphicsInfo(
@@ -1236,8 +1180,7 @@ bool GpuControlList::GpuControlListEntry::Contains(
case kMultiGpuStyleNone:
break;
}
- if (driver_vendor_info_.get() != NULL && !gpu_info.driver_vendor.empty() &&
- !driver_vendor_info_->Contains(gpu_info.driver_vendor))
+ if (StringMismatch(gpu_info.driver_vendor, driver_vendor_info_))
return false;
if (driver_version_info_.get() != NULL && !gpu_info.driver_version.empty()) {
if (!driver_version_info_->Contains(gpu_info.driver_version))
@@ -1249,14 +1192,11 @@ bool GpuControlList::GpuControlListEntry::Contains(
}
if (GLVersionInfoMismatch(gpu_info.gl_version))
return false;
- if (gl_vendor_info_.get() != NULL && !gpu_info.gl_vendor.empty() &&
- !gl_vendor_info_->Contains(gpu_info.gl_vendor))
+ if (StringMismatch(gpu_info.gl_vendor, gl_vendor_info_))
return false;
- if (gl_renderer_info_.get() != NULL && !gpu_info.gl_renderer.empty() &&
- !gl_renderer_info_->Contains(gpu_info.gl_renderer))
+ if (StringMismatch(gpu_info.gl_renderer, gl_renderer_info_))
return false;
- if (gl_extensions_info_.get() != NULL && !gpu_info.gl_extensions.empty() &&
- !gl_extensions_info_->Contains(gpu_info.gl_extensions))
+ if (StringMismatch(gpu_info.gl_extensions, gl_extensions_info_))
return false;
if (gl_reset_notification_strategy_info_.get() != NULL &&
!gl_reset_notification_strategy_info_->Contains(
@@ -1279,7 +1219,8 @@ bool GpuControlList::GpuControlListEntry::Contains(
return false;
bool found_match = false;
for (size_t ii = 0; ii < machine_model_name_list_.size(); ++ii) {
- if (machine_model_name_list_[ii] == gpu_info.machine_model_name) {
+ if (RE2::FullMatch(gpu_info.machine_model_name,
+ machine_model_name_list_[ii])) {
found_match = true;
break;
}
@@ -1297,9 +1238,9 @@ bool GpuControlList::GpuControlListEntry::Contains(
if (direct_rendering_info_.get() != NULL &&
!direct_rendering_info_->Contains(gpu_info.direct_rendering))
return false;
- if (cpu_brand_.get() != NULL) {
+ if (!cpu_brand_.empty()) {
base::CPU cpu_info;
- if (!cpu_brand_->Contains(cpu_info.cpu_brand()))
+ if (StringMismatch(cpu_info.cpu_brand(), cpu_brand_))
return false;
}
@@ -1317,13 +1258,13 @@ bool GpuControlList::GpuControlListEntry::NeedsMoreInfo(
// If certain info is missing due to some error, say, we fail to collect
// vendor_id/device_id, then even if we launch GPU process and create a gl
// context, we won't gather such missing info, so we still return false.
- if (driver_vendor_info_.get() && gpu_info.driver_vendor.empty())
+ if (!driver_vendor_info_.empty() && gpu_info.driver_vendor.empty())
return true;
if (driver_version_info_.get() && gpu_info.driver_version.empty())
return true;
- if (gl_vendor_info_.get() && gpu_info.gl_vendor.empty())
+ if (!gl_vendor_info_.empty() && gpu_info.gl_vendor.empty())
return true;
- if (gl_renderer_info_.get() && gpu_info.gl_renderer.empty())
+ if (!gl_renderer_info_.empty() && gpu_info.gl_renderer.empty())
return true;
for (size_t i = 0; i < exceptions_.size(); ++i) {
if (exceptions_[i]->NeedsMoreInfo(gpu_info))
diff --git a/gpu/config/gpu_control_list.h b/gpu/config/gpu_control_list.h
index b2daa47..a5abf52 100644
--- a/gpu/config/gpu_control_list.h
+++ b/gpu/config/gpu_control_list.h
@@ -192,32 +192,6 @@ class GPU_EXPORT GpuControlList {
scoped_ptr<VersionInfo> version_info_;
};
- class GPU_EXPORT StringInfo {
- public:
- StringInfo(const std::string& string_op, const std::string& string_value);
-
- // Determines if a given string is included in the StringInfo.
- bool Contains(const std::string& value) const;
-
- // Determines if the StringInfo contains valid information.
- bool IsValid() const;
-
- private:
- enum Op {
- kContains,
- kBeginWith,
- kEndWith,
- kEQ, // =
- kUnknown // Indicates StringInfo data is invalid.
- };
-
- // Maps string to Op; returns kUnknown if it's not a valid Op.
- static Op StringToOp(const std::string& string_op);
-
- Op op_;
- std::string value_;
- };
-
class GPU_EXPORT FloatInfo {
public:
FloatInfo(const std::string& float_op,
@@ -370,8 +344,7 @@ class GPU_EXPORT GpuControlList {
bool SetGLType(const std::string& gl_type_string);
- bool SetDriverVendorInfo(const std::string& vendor_op,
- const std::string& vendor_value);
+ bool SetDriverVendorInfo(const std::string& vendor_value);
bool SetDriverVersionInfo(const std::string& version_op,
const std::string& version_style,
@@ -386,21 +359,17 @@ class GPU_EXPORT GpuControlList {
const std::string& version_string,
const std::string& version_string2);
- bool SetGLVendorInfo(const std::string& vendor_op,
- const std::string& vendor_value);
+ bool SetGLVendorInfo(const std::string& vendor_value);
- bool SetGLRendererInfo(const std::string& renderer_op,
- const std::string& renderer_value);
+ bool SetGLRendererInfo(const std::string& renderer_value);
- bool SetGLExtensionsInfo(const std::string& extensions_op,
- const std::string& extensions_value);
+ bool SetGLExtensionsInfo(const std::string& extensions_value);
bool SetGLResetNotificationStrategyInfo(const std::string& op,
const std::string& int_string,
const std::string& int_string2);
- bool SetCpuBrand(const std::string& cpu_op,
- const std::string& cpu_value);
+ bool SetCpuBrand(const std::string& cpu_value);
bool SetPerfGraphicsInfo(const std::string& op,
const std::string& float_string,
@@ -464,15 +433,15 @@ class GPU_EXPORT GpuControlList {
MultiGpuStyle multi_gpu_style_;
MultiGpuCategory multi_gpu_category_;
GLType gl_type_;
- scoped_ptr<StringInfo> driver_vendor_info_;
+ std::string driver_vendor_info_;
scoped_ptr<VersionInfo> driver_version_info_;
scoped_ptr<VersionInfo> driver_date_info_;
scoped_ptr<VersionInfo> gl_version_info_;
- scoped_ptr<StringInfo> gl_vendor_info_;
- scoped_ptr<StringInfo> gl_renderer_info_;
- scoped_ptr<StringInfo> gl_extensions_info_;
+ std::string gl_vendor_info_;
+ std::string gl_renderer_info_;
+ std::string gl_extensions_info_;
scoped_ptr<IntInfo> gl_reset_notification_strategy_info_;
- scoped_ptr<StringInfo> cpu_brand_;
+ std::string cpu_brand_;
scoped_ptr<FloatInfo> perf_graphics_info_;
scoped_ptr<FloatInfo> perf_gaming_info_;
scoped_ptr<FloatInfo> perf_overall_info_;
diff --git a/gpu/config/gpu_control_list_entry_unittest.cc b/gpu/config/gpu_control_list_entry_unittest.cc
index 6ae866b..d693d85 100644
--- a/gpu/config/gpu_control_list_entry_unittest.cc
+++ b/gpu/config/gpu_control_list_entry_unittest.cc
@@ -470,14 +470,11 @@ TEST_F(GpuControlListEntryTest, GlVersionGLEntry) {
EXPECT_FALSE(entry->Contains(GpuControlList::kOsWin, "6.1", gpu_info));
}
-TEST_F(GpuControlListEntryTest, GlVendorEntry) {
+TEST_F(GpuControlListEntryTest, GlVendorEqual) {
const std::string json = LONG_STRING_CONST(
{
"id": 1,
- "gl_vendor": {
- "op": "beginwith",
- "value": "NVIDIA"
- },
+ "gl_vendor": "NVIDIA",
"features": [
"test_feature_0"
]
@@ -486,25 +483,26 @@ TEST_F(GpuControlListEntryTest, GlVendorEntry) {
ScopedEntry entry(GetEntryFromString(json));
EXPECT_TRUE(entry.get() != NULL);
- const GpuControlList::OsType os_type[] = {
- GpuControlList::kOsMacosx,
- GpuControlList::kOsWin,
- GpuControlList::kOsLinux,
- GpuControlList::kOsChromeOS,
- GpuControlList::kOsAndroid
- };
- for (size_t i = 0; i < arraysize(os_type); ++i)
- EXPECT_TRUE(entry->Contains(os_type[i], "10.6", gpu_info()));
+ GPUInfo gpu_info;
+ gpu_info.gl_vendor = "NVIDIA";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ // Case sensitive.
+ gpu_info.gl_vendor = "NVidia";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_vendor = "NVIDIA-x";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
}
-TEST_F(GpuControlListEntryTest, GlRendererEntry) {
+TEST_F(GpuControlListEntryTest, GlVendorWithDot) {
const std::string json = LONG_STRING_CONST(
{
"id": 1,
- "gl_renderer": {
- "op": "contains",
- "value": "GeForce"
- },
+ "gl_vendor": "X\\.Org.*",
"features": [
"test_feature_0"
]
@@ -513,15 +511,100 @@ TEST_F(GpuControlListEntryTest, GlRendererEntry) {
ScopedEntry entry(GetEntryFromString(json));
EXPECT_TRUE(entry.get() != NULL);
- const GpuControlList::OsType os_type[] = {
- GpuControlList::kOsMacosx,
- GpuControlList::kOsWin,
- GpuControlList::kOsLinux,
- GpuControlList::kOsChromeOS,
- GpuControlList::kOsAndroid
- };
- for (size_t i = 0; i < arraysize(os_type); ++i)
- EXPECT_TRUE(entry->Contains(os_type[i], "10.6", gpu_info()));
+ GPUInfo gpu_info;
+ gpu_info.gl_vendor = "X.Org R300 Project";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsLinux, "", gpu_info));
+
+ gpu_info.gl_vendor = "X.Org";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsLinux, "", gpu_info));
+}
+
+TEST_F(GpuControlListEntryTest, GlRendererContains) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "gl_renderer": ".*GeForce.*",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+
+ GPUInfo gpu_info;
+ gpu_info.gl_renderer = "NVIDIA GeForce GT 120 OpenGL Engine";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ // Case sensitive.
+ gpu_info.gl_renderer = "NVIDIA GEFORCE GT 120 OpenGL Engine";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_renderer = "GeForce GT 120 OpenGL Engine";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_renderer = "NVIDIA GeForce";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_renderer = "NVIDIA Ge Force";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+}
+
+TEST_F(GpuControlListEntryTest, GlRendererCaseInsensitive) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "gl_renderer": "(?i).*software.*",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+
+ GPUInfo gpu_info;
+ gpu_info.gl_renderer = "software rasterizer";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_renderer = "Software Rasterizer";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+}
+
+TEST_F(GpuControlListEntryTest, GlExtensionsEndWith) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "gl_extensions": ".*GL_SUN_slice_accum",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+
+ GPUInfo gpu_info;
+ gpu_info.gl_extensions = "GL_SGIS_generate_mipmap "
+ "GL_SGIX_shadow "
+ "GL_SUN_slice_accum";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.gl_extensions = "GL_SGIS_generate_mipmap "
+ "GL_SUN_slice_accum "
+ "GL_SGIX_shadow";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
}
TEST_F(GpuControlListEntryTest, PerfGraphicsEntry) {
@@ -640,6 +723,38 @@ TEST_F(GpuControlListEntryTest, AMDSwitchableEntry) {
GpuControlList::kOsMacosx, "10.6", gpu_info));
}
+TEST_F(GpuControlListEntryTest, DriverVendorBeginWith) {
+ const std::string json = LONG_STRING_CONST(
+ {
+ "id": 1,
+ "driver_vendor": "NVIDIA.*",
+ "features": [
+ "test_feature_0"
+ ]
+ }
+ );
+ ScopedEntry entry(GetEntryFromString(json));
+ EXPECT_TRUE(entry.get() != NULL);
+
+ GPUInfo gpu_info;
+ gpu_info.driver_vendor = "NVIDIA Corporation";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ // Case sensitive.
+ gpu_info.driver_vendor = "NVidia Corporation";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.driver_vendor = "NVIDIA";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+
+ gpu_info.driver_vendor = "USA NVIDIA";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsMacosx, "10.9", gpu_info));
+}
+
TEST_F(GpuControlListEntryTest, LexicalDriverVersionEntry) {
const std::string json = LONG_STRING_CONST(
{
@@ -710,10 +825,7 @@ TEST_F(GpuControlListEntryTest, NeedsMoreInfoForExceptionsEntry) {
"vendor_id": "0x8086",
"exceptions": [
{
- "gl_renderer": {
- "op": "contains",
- "value": "mesa"
- }
+ "gl_renderer": ".*mesa.*"
}
],
"features": [
@@ -807,7 +919,9 @@ TEST_F(GpuControlListEntryTest, MachineModelName) {
"os": {
"type": "android"
},
- "machine_model_name": ["Nexus 4", "XT1032"],
+ "machine_model_name": [
+ "Nexus 4", "XT1032", "GT-.*", "SCH-.*"
+ ],
"features": [
"test_feature_0"
]
@@ -841,6 +955,18 @@ TEST_F(GpuControlListEntryTest, MachineModelName) {
gpu_info.machine_model_name = "";
EXPECT_FALSE(entry->Contains(
GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "GT-N7100";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "GT-I9300";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+
+ gpu_info.machine_model_name = "SCH-I545";
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
}
TEST_F(GpuControlListEntryTest, MachineModelNameException) {
@@ -852,7 +978,7 @@ TEST_F(GpuControlListEntryTest, MachineModelNameException) {
"os": {
"type": "android"
},
- "machine_model_name": ["Nexus 4"]
+ "machine_model_name": ["Nexus.*"]
}
],
"features": [
@@ -871,6 +997,12 @@ TEST_F(GpuControlListEntryTest, MachineModelNameException) {
EXPECT_TRUE(entry->Contains(
GpuControlList::kOsLinux, "4.1", gpu_info));
+ gpu_info.machine_model_name = "Nexus 7";
+ EXPECT_FALSE(entry->Contains(
+ GpuControlList::kOsAndroid, "4.1", gpu_info));
+ EXPECT_TRUE(entry->Contains(
+ GpuControlList::kOsLinux, "4.1", gpu_info));
+
gpu_info.machine_model_name = "";
EXPECT_TRUE(entry->Contains(
GpuControlList::kOsAndroid, "4.1", gpu_info));
diff --git a/gpu/config/gpu_control_list_format.txt b/gpu/config/gpu_control_list_format.txt
index 71c569c..c897cb6 100644
--- a/gpu/config/gpu_control_list_format.txt
+++ b/gpu/config/gpu_control_list_format.txt
@@ -32,7 +32,7 @@
// 6. "multi_gpu_category" is a string, valid values include "any", "primary",
// "secondary", and "active". If unspecified, the default value is "primary".
// See gpu_control_list.h for more details on the meanings of the strings.
-// 7. "driver_vendor" is a STRING structure (defined below).
+// 7. "driver_vendor" is a string pattern.
// 8. "driver_version" is a VERSION structure (defined below).
// 9. "driver_date" is a VERSION structure (defined below).
// The version is interpreted as "year.month.day".
@@ -41,17 +41,16 @@
// The default value on Android is "gles", on Windows is "angle", on other
// platforms is "gl".
// 11. "gl_version" is a VERSION structure (defined below).
-// 12. "gl_vendor" is a STRING structure (defined below).
-// 13. "gl_renderer" is a STRING structure (defined below).
-// 14. "gl_extensions" is a STRING structure (defined below).
+// 12. "gl_vendor" is a string pattern.
+// 13. "gl_renderer" is a string pattern.
+// 14. "gl_extensions" is a string pattern.
// 15. "perf_graphics" is a FLOAT structure (defined below).
// 16. "perf_gaming" is a FLOAT structure (defined below).
// 17. "perf_overall" is a FLOAT structure (defined below).
-// 18. "machine_model_name" is an array of strings. The strings can contain
-// any characters.
+// 18. "machine_model_name" is an array of string patterns.
// 19. "machine_model_version" is a VERSION structure (defined below).
// 20. "gpu_count" is a INT structure (defined below).
-// 21 "cpu_info" is a STRING structure (defined below).
+// 21 "cpu_info" is a string pattern.
// 22. "exceptions" is a list of entries.
// 23. "features" is a list of gpu control list options, which can be
// configured by a specific list. See its *_json.cc file for a list of
@@ -74,12 +73,11 @@
// Only "driver_version" supports lexical style if the format is major.minor;
// in that case, major is still numerical, but minor is lexical.
//
-// STRING includes "op" and "value". "op" can be any of the following values:
-// "contains", "beginwith", "endwith", "=". "value" is a string.
-//
// FLOAT includes "op" "value", and "value2". "op" can be any of the
// following values: "=", "<", "<=", ">", ">=", "any", "between". "value2" is
// only used if "op" is "between". "value" is used for all "op" values except
// "any". "value" and "value2" are valid float numbers.
// INT is very much like FLOAT, except that the values need to be integers.
-
+//
+// String pattern syntax can be found at
+// https://code.google.com/p/re2/wiki/Syntax.
diff --git a/gpu/config/gpu_control_list_string_info_unittest.cc b/gpu/config/gpu_control_list_string_info_unittest.cc
deleted file mode 100644
index 39e2f58..0000000
--- a/gpu/config/gpu_control_list_string_info_unittest.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "gpu/config/gpu_control_list.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gpu {
-
-class StringInfoTest : public testing::Test {
- public:
- StringInfoTest() { }
- virtual ~StringInfoTest() { }
-
- typedef GpuControlList::StringInfo StringInfo;
-};
-
-TEST_F(StringInfoTest, ValidStringInfo) {
- const std::string op[] = {
- "contains",
- "beginwith",
- "endwith",
- "="
- };
- for (size_t i = 0; i < arraysize(op); ++i) {
- {
- StringInfo info(op[i], std::string());
- EXPECT_TRUE(info.IsValid());
- }
- {
- StringInfo info(op[i], "hello");
- EXPECT_TRUE(info.IsValid());
- }
- }
-}
-
-TEST_F(StringInfoTest, InvalidStringInfo) {
- const std::string op[] = {
- "Contains",
- "BeginWith",
- "EndWith",
- " =",
- "= "
- };
- for (size_t i = 0; i < arraysize(op); ++i) {
- StringInfo info(op[i], "hello");
- EXPECT_FALSE(info.IsValid());
- }
-}
-
-TEST_F(StringInfoTest, StringComparison) {
- {
- StringInfo info("contains", "happy");
- EXPECT_TRUE(info.Contains("unhappy"));
- EXPECT_TRUE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_TRUE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("beginwith", "happy");
- EXPECT_FALSE(info.Contains("unhappy"));
- EXPECT_TRUE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("endwith", "happy");
- EXPECT_TRUE(info.Contains("unhappy"));
- EXPECT_FALSE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- }
- {
- StringInfo info("=", "happy");
- EXPECT_FALSE(info.Contains("unhappy"));
- EXPECT_FALSE(info.Contains("happy1"));
- EXPECT_TRUE(info.Contains("happy"));
- EXPECT_FALSE(info.Contains("a happy dog"));
- EXPECT_TRUE(info.Contains("Happy"));
- EXPECT_TRUE(info.Contains("HAPPY"));
- EXPECT_FALSE(info.Contains("ha-ppy"));
- EXPECT_FALSE(info.Contains("ha ppy"));
- EXPECT_FALSE(info.Contains(" happy"));
- EXPECT_FALSE(info.Contains("happy "));
- }
-}
-
-} // namespace gpu
-
diff --git a/gpu/config/gpu_control_list_unittest.cc b/gpu/config/gpu_control_list_unittest.cc
index 03a7d0e..9ba06b8 100644
--- a/gpu/config/gpu_control_list_unittest.cc
+++ b/gpu/config/gpu_control_list_unittest.cc
@@ -303,10 +303,7 @@ TEST_F(GpuControlListTest, NeedsMoreInfoForExceptions) {
"vendor_id": "0x8086",
"exceptions": [
{
- "gl_renderer": {
- "op": "contains",
- "value": "mesa"
- }
+ "gl_renderer": ".*mesa.*"
}
],
"features": [
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index 30ddda8..708b2d2 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
- "version": "6.9",
+ "version": "7.0",
"entries": [
{
"id": 1,
@@ -27,10 +27,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Imagination"
- },
+ "gl_vendor": "Imagination.*",
"features": [
"use_client_side_arrays_for_stream_buffers"
]
@@ -41,10 +38,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
+ "gl_vendor": "ARM.*",
"features": [
"use_client_side_arrays_for_stream_buffers"
]
@@ -112,10 +106,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "4.3"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"restore_scissor_on_fbo_change"
]
@@ -256,10 +247,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"disable_depth_texture"
]
@@ -284,10 +272,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_extensions": {
- "op": "contains",
- "value": "GL_VIV_shader_binary"
- },
+ "gl_extensions": ".*GL_VIV_shader_binary.*",
"features": [
"unbind_fbo_on_context_switch"
]
@@ -299,10 +284,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Imagination"
- },
+ "gl_vendor": "Imagination.*",
"features": [
"unbind_fbo_on_context_switch"
]
@@ -327,14 +309,8 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
- "gl_renderer": {
- "op": "contains",
- "value": "Mali-400"
- },
+ "gl_vendor": "ARM.*",
+ "gl_renderer": ".*Mali-400.*",
"features": [
"use_non_zero_size_for_client_side_stream_buffers"
]
@@ -397,14 +373,8 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"id": 31,
"cr_bugs": [154715, 10068, 269829, 294779, 285292],
"description": "The Mali-Txxx driver does not guarantee flush ordering",
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
- "gl_renderer": {
- "op": "beginwith",
- "value": "Mali-T"
- },
+ "gl_vendor": "ARM.*",
+ "gl_renderer": "Mali-T.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -416,10 +386,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Broadcom"
- },
+ "gl_vendor": "Broadcom.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -430,10 +397,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Imagination"
- },
+ "gl_vendor": "Imagination.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -445,10 +409,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_extensions": {
- "op": "contains",
- "value": "GL_VIV_shader_binary"
- },
+ "gl_extensions": ".*GL_VIV_shader_binary.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -464,10 +425,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "4.3"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "NVIDIA"
- },
+ "gl_vendor": "NVIDIA.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -483,10 +441,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "4.3"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -510,10 +465,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -540,10 +492,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"value": "4.4"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
+ "gl_vendor": "ARM.*",
"features": [
"disable_ext_discard_framebuffer"
]
@@ -555,14 +504,8 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Imagination"
- },
- "gl_renderer": {
- "op": "=",
- "value": "PowerVR SGX 540"
- },
+ "gl_vendor": "Imagination.*",
+ "gl_renderer": "PowerVR SGX 540",
"features": [
"disable_ext_discard_framebuffer"
]
@@ -574,10 +517,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_extensions": {
- "op": "contains",
- "value": "GL_VIV_shader_binary"
- },
+ "gl_extensions": ".*GL_VIV_shader_binary.*",
"features": [
"disable_ext_discard_framebuffer"
]
@@ -635,10 +575,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"wake_up_gpu_before_drawing"
]
@@ -654,10 +591,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"op": "<",
"value": "3.1"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "NVIDIA"
- },
+ "gl_vendor": "NVIDIA.*",
"features": [
"release_image_after_use"
]
@@ -668,10 +602,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "win"
},
- "gl_renderer": {
- "op": "beginwith",
- "value": "ANGLE"
- },
+ "gl_renderer": "ANGLE.*",
"features": [
"texsubimage2d_faster_than_teximage2d"
]
@@ -682,10 +613,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"disable_multisampling"
]
@@ -716,10 +644,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"features": [
"count_all_in_varyings_packing"
]
@@ -731,10 +656,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "chromeos"
},
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"features": [
"count_all_in_varyings_packing"
]
@@ -865,10 +787,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"id": 69,
"description": "Some shaders in Skia need more than the min available vertex and fragment shader uniform vectors in case of OSMesa",
"cr_bugs": [174845],
- "driver_vendor": {
- "op": "=",
- "value": "osmesa"
- },
+ "driver_vendor": "osmesa",
"features": [
"max_fragment_uniform_vectors_32",
"max_varying_vectors_16",
@@ -898,10 +817,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_extensions": {
- "op": "contains",
- "value": "GL_VIV_shader_binary"
- },
+ "gl_extensions": ".*GL_VIV_shader_binary.*",
"features": [
"disable_oes_standard_derivatives"
]
@@ -918,10 +834,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
"op": "=",
"value": "3.1"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "NVidia"
- },
+ "gl_vendor": "NVIDIA.*",
"features": [
"use_virtualized_gl_contexts"
]
@@ -952,10 +865,7 @@ LONG_STRING_CONST(
"value": "4.4.4"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"disable_egl_khr_fence_sync"
]
@@ -971,14 +881,8 @@ LONG_STRING_CONST(
"value": "4.3"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
- "gl_renderer": {
- "op": "contains",
- "value": "Mali-400"
- },
+ "gl_vendor": "ARM.*",
+ "gl_renderer": ".*Mali-400.*",
"features": [
"disable_multisampling"
]
@@ -994,10 +898,7 @@ LONG_STRING_CONST(
"value": "4.4.4"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Imagination Technologies"
- },
+ "gl_vendor": "Imagination Technologies.*",
"features": [
"disable_egl_khr_fence_sync"
]
@@ -1013,14 +914,8 @@ LONG_STRING_CONST(
"value": "4.4.4"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ARM"
- },
- "gl_renderer": {
- "op": "beginwith",
- "value": "Mali-400 MP"
- },
+ "gl_vendor": "ARM.*",
+ "gl_renderer": "Mali-400 MP.*",
"features": [
"disable_egl_khr_fence_sync"
]
@@ -1036,10 +931,7 @@ LONG_STRING_CONST(
"value": "4.4.4"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Broadcom"
- },
+ "gl_vendor": "Broadcom.*",
"features": [
"disable_egl_khr_fence_sync"
]
@@ -1066,10 +958,7 @@ LONG_STRING_CONST(
"value": "4.3"
}
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Qualcomm"
- },
+ "gl_vendor": "Qualcomm.*",
"features": [
"disable_async_readpixels"
]
diff --git a/gpu/config/software_rendering_list_json.cc b/gpu/config/software_rendering_list_json.cc
index e0eab81..8fb41f1 100644
--- a/gpu/config/software_rendering_list_json.cc
+++ b/gpu/config/software_rendering_list_json.cc
@@ -18,7 +18,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
{
"name": "software rendering list",
// Please update the version number whenever you change this file.
- "version": "8.10",
+ "version": "9.0",
"entries": [
{
"id": 1,
@@ -42,10 +42,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "gl_renderer": {
- "op": "contains",
- "value": "software"
- },
+ "gl_renderer": "(?i).*software.*",
"features": [
"all"
]
@@ -76,10 +73,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"vendor_id": "0x1002",
"exceptions": [
{
- "driver_vendor": {
- "op": "contains",
- "value": "AMD"
- },
+ "driver_vendor": ".*AMD.*",
"driver_version": {
"op": ">=",
"style": "lexical",
@@ -87,10 +81,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
}
},
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "10.0.4"
@@ -150,10 +141,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
}
},
{
- "driver_vendor": {
- "op": "=",
- "value": "osmesa"
- }
+ "driver_vendor": "osmesa"
},
{
"vendor_id": "0x1414",
@@ -172,10 +160,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"type": "linux"
},
"vendor_id": "0x8086",
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": "<",
"value": "10.1"
@@ -240,20 +225,14 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": "<",
"value": "7.11"
},
"exceptions": [
{
- "driver_vendor": {
- "op": "=",
- "value": "osmesa"
- }
+ "driver_vendor": "osmesa"
}
],
"features": [
@@ -277,16 +256,10 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "ATI"
- },
+ "gl_vendor": "ATI.*",
"exceptions": [
{
- "driver_vendor": {
- "op": "contains",
- "value": "AMD"
- },
+ "driver_vendor": ".*AMD.*",
"driver_version": {
"op": ">=",
"style": "lexical",
@@ -294,10 +267,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
}
},
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "10.0.4"
@@ -315,20 +285,11 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "X.Org"
- },
- "gl_renderer": {
- "op": "contains",
- "value": "AMD"
- },
+ "gl_vendor": "X\\.Org.*",
+ "gl_renderer": ".*AMD.*",
"exceptions": [
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "10.0.4"
@@ -346,20 +307,11 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "X.Org"
- },
- "gl_renderer": {
- "op": "contains",
- "value": "ATI"
- },
+ "gl_vendor": "X\\.Org.*",
+ "gl_renderer": ".*ATI.*",
"exceptions": [
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "10.0.4"
@@ -378,10 +330,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"type": "linux"
},
"vendor_id": "0x10de",
- "gl_vendor": {
- "op": "beginwith",
- "value": "nouveau"
- },
+ "gl_vendor": "(?i)nouveau.*",
"features": [
"all"
]
@@ -405,10 +354,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
}
},
{
- "cpu_info": {
- "op": "contains",
- "value": "Atom"
- }
+ "cpu_info": "(?i).*Atom.*"
}
],
"features": [
@@ -449,18 +395,12 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"multi_gpu_style": "optimus",
"exceptions": [
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "10.1"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "Intel"
- }
+ "gl_vendor": "Intel.*"
}
],
"features": [
@@ -557,10 +497,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"type": "linux"
},
"vendor_id": "0x10de",
- "driver_vendor": {
- "op": "=",
- "value": "NVIDIA"
- },
+ "driver_vendor": "NVIDIA",
"driver_version": {
"op": "<",
"value": "295"
@@ -621,24 +558,15 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "linux"
},
- "gl_vendor": {
- "op": "beginwith",
- "value": "VMware"
- },
+ "gl_vendor": "VMware.*",
"exceptions": [
{
- "driver_vendor": {
- "op": "=",
- "value": "Mesa"
- },
+ "driver_vendor": "Mesa",
"driver_version": {
"op": ">=",
"value": "9.2.1"
},
- "gl_renderer": {
- "op": "contains",
- "value": "SVGA3D"
- }
+ "gl_renderer": ".*SVGA3D.*"
}
],
"features": [
@@ -663,10 +591,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"type": "linux"
},
"vendor_id": "0x10de",
- "driver_vendor": {
- "op": "=",
- "value": "NVIDIA"
- },
+ "driver_vendor": "NVIDIA",
"features": [
"accelerated_video_decode",
"flash_3d",
@@ -716,10 +641,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "android"
},
- "gl_renderer": {
- "op": "contains",
- "value": "Adreno"
- },
+ "gl_renderer": ".*Adreno.*",
"driver_version": {
"op": "<",
"value": "4.1"
@@ -848,10 +770,7 @@ const char kSoftwareRenderingListJson[] = LONG_STRING_CONST(
"os": {
"type": "win"
},
- "driver_vendor": {
- "op": "=",
- "value": "Microsoft"
- },
+ "driver_vendor": "Microsoft",
"exceptions": [
{
"vendor_id": "0x1414",
@@ -1112,10 +1031,7 @@ LONG_STRING_CONST(
"type": "linux"
},
"vendor_id": "0x1002",
- "driver_vendor": {
- "op": "contains",
- "value": "AMD"
- },
+ "driver_vendor": ".*AMD.*",
"driver_version": {
"op": "=",
"value": "13.101"
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index aa2a8c1..7ad805d 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -276,7 +276,6 @@
'config/gpu_control_list_entry_unittest.cc',
'config/gpu_control_list_number_info_unittest.cc',
'config/gpu_control_list_os_info_unittest.cc',
- 'config/gpu_control_list_string_info_unittest.cc',
'config/gpu_control_list_unittest.cc',
'config/gpu_control_list_version_info_unittest.cc',
'config/gpu_driver_bug_list_unittest.cc',