Add GL strings to CastSysInfo interface and use to configure GPU
Linux GPU info collector uses PCI scanning, which doesn't work on Chromecast. So initial browser-process decisions on GPU feature blacklisting are incorrect. This provides the info instead through CastSysInfo and will allow us for example to add exceptions to the accelerated canvas blacklist for our GPU. BUG= Review URL: https://codereview.chromium.org/1117813002 Cr-Commit-Position: refs/heads/master@{#328186}
This commit is contained in:
chromecast
@ -64,4 +64,16 @@ std::string CastSysInfoDummy::GetApInterface() {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string CastSysInfoDummy::GetGlVendor() {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string CastSysInfoDummy::GetGlRenderer() {
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string CastSysInfoDummy::GetGlVersion() {
|
||||
return "";
|
||||
}
|
||||
|
||||
} // namespace chromecast
|
||||
|
@ -29,6 +29,9 @@ class CastSysInfoDummy : public CastSysInfo {
|
||||
std::string GetFactoryLocale(std::string* second_locale) override;
|
||||
std::string GetWifiInterface() override;
|
||||
std::string GetApInterface() override;
|
||||
std::string GetGlVendor() override;
|
||||
std::string GetGlRenderer() override;
|
||||
std::string GetGlVersion() override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(CastSysInfoDummy);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "base/run_loop.h"
|
||||
#include "cc/base/switches.h"
|
||||
#include "chromecast/base/cast_paths.h"
|
||||
#include "chromecast/base/cast_sys_info_util.h"
|
||||
#include "chromecast/base/metrics/cast_metrics_helper.h"
|
||||
#include "chromecast/base/metrics/grouped_histogram.h"
|
||||
#include "chromecast/browser/cast_browser_context.h"
|
||||
@ -32,7 +33,9 @@
|
||||
#include "chromecast/common/platform_client_auth.h"
|
||||
#include "chromecast/media/base/key_systems_common.h"
|
||||
#include "chromecast/net/connectivity_checker.h"
|
||||
#include "chromecast/public/cast_sys_info.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/gpu_data_manager.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "media/audio/audio_manager.h"
|
||||
#include "media/audio/audio_manager_factory.h"
|
||||
@ -266,6 +269,14 @@ int CastBrowserMainParts::PreCreateThreads() {
|
||||
}
|
||||
|
||||
void CastBrowserMainParts::PreMainMessageLoopRun() {
|
||||
// Set GL strings so GPU config code can make correct feature blacklisting/
|
||||
// whitelisting decisions.
|
||||
// Note: SetGLStrings MUST be called after GpuDataManager::Initialize.
|
||||
scoped_ptr<CastSysInfo> sys_info = CreateSysInfo();
|
||||
content::GpuDataManager::GetInstance()->SetGLStrings(
|
||||
sys_info->GetGlVendor(), sys_info->GetGlRenderer(),
|
||||
sys_info->GetGlVersion());
|
||||
|
||||
scoped_refptr<PrefRegistrySimple> pref_registry(new PrefRegistrySimple());
|
||||
metrics::RegisterPrefs(pref_registry.get());
|
||||
cast_browser_process_->SetPrefService(
|
||||
|
@ -55,6 +55,19 @@ class CastSysInfo {
|
||||
virtual std::string GetWifiInterface() = 0;
|
||||
// Returns the name of the software AP interface.
|
||||
virtual std::string GetApInterface() = 0;
|
||||
|
||||
// Returns the GL_VENDOR string of GPU driver. Must match the value that would
|
||||
// be obtained from a GL context, but implementations must *not* create a GL
|
||||
// context.
|
||||
virtual std::string GetGlVendor() = 0;
|
||||
// Returns the GL_RENDERER string of GPU driver. Must match the value that
|
||||
// would be obtained from a GL context, but implementations must *not* create
|
||||
// a GL context.
|
||||
virtual std::string GetGlRenderer() = 0;
|
||||
// Returns the GL_VERSION string of GPU driver. Must match the value that
|
||||
// would be obtained from a GL context, but implementations must *not* create
|
||||
// a GL context.
|
||||
virtual std::string GetGlVersion() = 0;
|
||||
};
|
||||
|
||||
} // namespace chromecast
|
||||
|
Reference in New Issue
Block a user