Bug 1302240 - Report content backend to telemetry. r=dvander

This commit is contained in:
Mason Chang 2016-09-12 16:23:28 -07:00
parent 05a47f9aef
commit 200e76f295
4 changed files with 34 additions and 0 deletions

View File

@ -1316,6 +1316,7 @@ EnvironmentCache.prototype = {
let gfxData = {
D2DEnabled: getGfxField("D2DEnabled", null),
DWriteEnabled: getGfxField("DWriteEnabled", null),
ContentBackend: getGfxField("ContentBackend", null),
// The following line is disabled due to main thread jank and will be enabled
// again as part of bug 1154500.
//DWriteVersion: getGfxField("DWriteVersion", null),

View File

@ -1400,6 +1400,33 @@ GfxInfoBase::GetActiveCrashGuards(JSContext* aCx, JS::MutableHandle<JS::Value> a
return NS_OK;
}
NS_IMETHODIMP
GfxInfoBase::GetContentBackend(nsAString & aContentBackend)
{
BackendType backend = gfxPlatform::GetPlatform()->GetDefaultContentBackend();
nsString outStr;
switch (backend) {
case BackendType::DIRECT2D1_1: {
outStr.AppendPrintf("Direct2D 1.1");
break;
}
case BackendType::SKIA: {
outStr.AppendPrintf("Skia");
break;
}
case BackendType::CAIRO: {
outStr.AppendPrintf("Cairo");
break;
}
default:
return NS_ERROR_FAILURE;
}
aContentBackend.Assign(outStr);
return NS_OK;
}
GfxInfoCollectorBase::GfxInfoCollectorBase()
{
GfxInfoBase::AddCollector(this);

View File

@ -58,6 +58,7 @@ public:
NS_IMETHOD GetFeatures(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetFeatureLog(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetActiveCrashGuards(JSContext*, JS::MutableHandle<JS::Value>) override;
NS_IMETHOD GetContentBackend(nsAString & aContentBackend) override;
// Initialization function. If you override this, you must call this class's
// version of Init first.

View File

@ -18,6 +18,11 @@ interface nsIGfxInfo : nsISupports
readonly attribute DOMString DWriteVersion;
readonly attribute DOMString cleartypeParameters;
/*
* These are valid across all platforms.
*/
readonly attribute DOMString ContentBackend;
// XXX: Switch to a list of devices, rather than explicitly numbering them.
/**