Skip to content
Snippets Groups Projects
Commit 053c704f authored by zmo@google.com's avatar zmo@google.com
Browse files

Merge part of r75473.

Fix a bug in the GPU blacklist.  Originally if we fail to collect driver version, we won't apply blacklist logic.  This will fail us to blacklist ATI cards on linux.

BUG=none
TEST=blacklist all ATI cards on linux.
TBR=zmo

Review URL: http://codereview.chromium.org/6532101

git-svn-id: svn://svn.chromium.org/chrome/branches/648/src@75682 0039d316-1c4b-4281-b951-d872f2087c98
parent ebb4ea33
No related branches found
No related tags found
No related merge requests found
......@@ -378,26 +378,26 @@ bool GpuBlacklist::GpuBlacklistEntry::SetBlacklistedFeatures(
}
bool GpuBlacklist::GpuBlacklistEntry::Contains(
OsType os_type, const Version& os_version,
uint32 vendor_id, uint32 device_id,
const std::string& driver_vendor,
const Version& driver_version,
const std::string& gl_renderer) const {
OsType os_type, const Version& os_version, const GPUInfo& gpu_info) const {
DCHECK(os_type != kOsAny);
if (os_info_.get() != NULL && !os_info_->Contains(os_type, os_version))
return false;
if (vendor_id_ != 0 && vendor_id_ != vendor_id)
if (vendor_id_ != 0 && vendor_id_ != gpu_info.vendor_id())
return false;
if (device_id_ != 0 && device_id_ != device_id)
if (device_id_ != 0 && device_id_ != gpu_info.device_id())
return false;
if (driver_vendor_info_.get() != NULL &&
!driver_vendor_info_->Contains(driver_vendor))
return false;
if (driver_version_info_.get() != NULL &&
!driver_version_info_->Contains(driver_version))
!driver_vendor_info_->Contains(gpu_info.driver_vendor()))
return false;
if (driver_version_info_.get() != NULL) {
scoped_ptr<Version> driver_version(
Version::GetVersionFromString(gpu_info.driver_version()));
if (driver_version.get() == NULL ||
!driver_version_info_->Contains(*driver_version))
return false;
}
if (gl_renderer_info_.get() != NULL &&
!gl_renderer_info_->Contains(gl_renderer))
!gl_renderer_info_->Contains(gpu_info.gl_renderer()))
return false;
return true;
}
......@@ -492,10 +492,6 @@ GpuFeatureFlags GpuBlacklist::DetermineGpuFeatureFlags(
// No need to go through blacklist entries if GPUInfo isn't available.
if (gpu_info.progress() == GPUInfo::kUninitialized)
return flags;
scoped_ptr<Version> driver_version(
Version::GetVersionFromString(gpu_info.driver_version()));
if (driver_version.get() == NULL)
return flags;
if (os == kOsAny)
os = GetOsType();
......@@ -524,11 +520,7 @@ GpuFeatureFlags GpuBlacklist::DetermineGpuFeatureFlags(
DCHECK(os_version != NULL);
for (size_t i = 0; i < blacklist_.size(); ++i) {
if (blacklist_[i]->Contains(os, *os_version,
gpu_info.vendor_id(), gpu_info.device_id(),
gpu_info.driver_vendor(),
*driver_version,
gpu_info.gl_renderer())) {
if (blacklist_[i]->Contains(os, *os_version, gpu_info)) {
flags.Combine(blacklist_[i]->GetGpuFeatureFlags());
active_entries_.push_back(blacklist_[i]);
}
......
......@@ -154,11 +154,9 @@ class GpuBlacklist {
DictionaryValue* value);
// Determines if a given os/gc/driver is included in the Entry set.
bool Contains(OsType os_type, const Version& os_version,
uint32 vendor_id, uint32 device_id,
const std::string& driver_vendor,
const Version& driver_version,
const std::string& gl_renderer) const;
bool Contains(OsType os_type,
const Version& os_version,
const GPUInfo& gpu_info) const;
// Returns the OsType.
OsType GetOsType() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment