зеркало из https://github.com/mozilla/gecko-dev.git
Back out Bug 591057 / cset 02d5f1c5d438 because of 4% Ts regression
This commit is contained in:
Родитель
21ffbbde09
Коммит
87b84c8733
|
@ -247,15 +247,6 @@ function populateGraphicsSection() {
|
|||
pushInfoRow(trGraphics, "driverDate", gfxInfo.adapterDriverDate);
|
||||
|
||||
#ifdef XP_WIN
|
||||
pushInfoRow(trGraphics, "adapterDescription2", gfxInfo.adapterDescription2);
|
||||
pushInfoRow(trGraphics, "adapterVendorID2", hexValueToString(gfxInfo.adapterVendorID2));
|
||||
pushInfoRow(trGraphics, "adapterDeviceID2", hexValueToString(gfxInfo.adapterDeviceID2));
|
||||
pushInfoRow(trGraphics, "adapterRAM2", gfxInfo.adapterRAM2);
|
||||
pushInfoRow(trGraphics, "adapterDrivers2", gfxInfo.adapterDriver2);
|
||||
pushInfoRow(trGraphics, "driverVersion2", gfxInfo.adapterDriverVersion2);
|
||||
pushInfoRow(trGraphics, "driverDate2", gfxInfo.adapterDriverDate2);
|
||||
pushInfoRow(trGraphics, "isGPU2Active", gfxInfo.isGPU2Active);
|
||||
|
||||
var version = Cc["@mozilla.org/system-info;1"]
|
||||
.getService(Ci.nsIPropertyBag2)
|
||||
.getProperty("version");
|
||||
|
|
|
@ -31,12 +31,4 @@ adapterDrivers = Adapter Drivers
|
|||
adapterRAM = Adapter RAM
|
||||
driverVersion = Driver Version
|
||||
driverDate = Driver Date
|
||||
adapterDescription2 = Adapter Description (GPU #2)
|
||||
adapterVendorID2 = Vendor ID (GPU #2)
|
||||
adapterDeviceID2 = Device ID (GPU #2)
|
||||
adapterDrivers2 = Adapter Drivers (GPU #2)
|
||||
adapterRAM2 = Adapter RAM (GPU #2)
|
||||
driverVersion2 = Driver Version (GPU #2)
|
||||
driverDate2 = Driver Date (GPU #2)
|
||||
isGPU2Active = GPU #2 Active
|
||||
webglRenderer = WebGL Renderer
|
||||
|
|
|
@ -51,38 +51,27 @@ interface nsIGfxInfo : nsISupports
|
|||
readonly attribute boolean AzureEnabled;
|
||||
readonly attribute DOMString DWriteVersion;
|
||||
readonly attribute DOMString cleartypeParameters;
|
||||
|
||||
// XXX: Switch to a list of devices, rather than explicitly numbering them.
|
||||
|
||||
|
||||
/**
|
||||
* The name of the display adapter.
|
||||
*/
|
||||
readonly attribute DOMString adapterDescription;
|
||||
readonly attribute DOMString adapterDescription2;
|
||||
|
||||
readonly attribute DOMString adapterDriver;
|
||||
readonly attribute DOMString adapterDriver2;
|
||||
|
||||
/* These types are inspired by DXGI_ADAPTER_DESC */
|
||||
readonly attribute unsigned long adapterVendorID;
|
||||
readonly attribute unsigned long adapterVendorID2;
|
||||
|
||||
readonly attribute unsigned long adapterDeviceID;
|
||||
readonly attribute unsigned long adapterDeviceID2;
|
||||
|
||||
|
||||
/**
|
||||
* The amount of RAM in MB in the display adapter.
|
||||
*/
|
||||
readonly attribute DOMString adapterRAM;
|
||||
readonly attribute DOMString adapterRAM2;
|
||||
|
||||
readonly attribute DOMString adapterDriverVersion;
|
||||
readonly attribute DOMString adapterDriverVersion2;
|
||||
|
||||
readonly attribute DOMString adapterDriverDate;
|
||||
readonly attribute DOMString adapterDriverDate2;
|
||||
|
||||
readonly attribute boolean isGPU2Active;
|
||||
|
||||
void getFailures(
|
||||
[optional] out unsigned long failureCount,
|
||||
|
|
|
@ -111,13 +111,6 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
|
@ -126,13 +119,6 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
|
@ -141,13 +127,6 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
|
@ -156,13 +135,6 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
|
@ -171,13 +143,6 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
|
@ -186,13 +151,6 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
|
@ -201,20 +159,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
GfxInfo::AddCrashReportAnnotations()
|
||||
{
|
||||
|
|
|
@ -64,14 +64,6 @@ public:
|
|||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
|
|
@ -64,14 +64,6 @@ public:
|
|||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
|
|
@ -134,13 +134,6 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
|
@ -149,13 +142,6 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
|
@ -164,13 +150,6 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
|
@ -179,13 +158,6 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
|
@ -194,13 +166,6 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
|
@ -209,13 +174,6 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
|
@ -224,20 +182,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
GfxInfo::AddCrashReportAnnotations()
|
||||
{
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <setupapi.h>
|
||||
#include "d3d9.h"
|
||||
#include "gfxWindowsPlatform.h"
|
||||
#include "GfxInfo.h"
|
||||
#include "GfxInfoWebGL.h"
|
||||
|
@ -78,11 +77,7 @@ static const PRUint32 vendorATI = 0x1002;
|
|||
GfxInfo::GfxInfo()
|
||||
: mAdapterVendorID(0),
|
||||
mAdapterDeviceID(0),
|
||||
mAdapterVendorID2(0),
|
||||
mAdapterDeviceID2(0),
|
||||
mWindowsVersion(0),
|
||||
mHasDualGPU(PR_FALSE),
|
||||
mIsGPU2Active(PR_FALSE)
|
||||
mWindowsVersion(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -204,42 +199,7 @@ GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
typedef IDirect3D9* (WINAPI*Direct3DCreate9Func) (
|
||||
UINT SDKVersion
|
||||
);
|
||||
|
||||
// XXX: Blacklisting logic doesn't use the result of this for now. Bug #628129.
|
||||
void
|
||||
GfxInfo::IdentifyActiveDevice()
|
||||
{
|
||||
|
||||
HMODULE d3d9 = LoadLibraryW(L"d3d9.dll");
|
||||
if (!d3d9) {
|
||||
NS_WARNING("Couldn't load d3d9.dll");
|
||||
return;
|
||||
}
|
||||
|
||||
Direct3DCreate9Func d3d9Create = (Direct3DCreate9Func)
|
||||
GetProcAddress(d3d9, "Direct3DCreate9");
|
||||
if (!d3d9Create) {
|
||||
NS_WARNING("Couldn't get Direct3DCreate9 function");
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<IDirect3D9> d3d9Object = dont_AddRef(d3d9Create(D3D_SDK_VERSION));;
|
||||
if (!d3d9Object) {
|
||||
NS_WARNING("Couldn't create d3d9object");
|
||||
return;
|
||||
}
|
||||
|
||||
D3DADAPTER_IDENTIFIER9 ident;
|
||||
HRESULT result = d3d9Object->GetAdapterIdentifier(D3DADAPTER_DEFAULT, 0, &ident);
|
||||
|
||||
if ((result == D3D_OK) &&
|
||||
(mAdapterVendorID2 == ident.VendorId) && (mAdapterDeviceID2 = ident.DeviceId)) {
|
||||
mIsGPU2Active = PR_TRUE;
|
||||
}
|
||||
}
|
||||
/* XXX: GfxInfo doesn't handle multiple GPUs. We should try to do that. Bug #591057 */
|
||||
|
||||
static nsresult GetKeyValue(const WCHAR* keyLocation, const WCHAR* keyName, nsAString& destString, int type)
|
||||
{
|
||||
|
@ -449,40 +409,7 @@ GfxInfo::Init()
|
|||
result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverDate = value;
|
||||
RegCloseKey(key);
|
||||
|
||||
// Check for second adapter:
|
||||
//
|
||||
// A second adapter will have the same driver key as the first adapter except for
|
||||
// the last character, where '1' will be swapped for '0' or vice-versa.
|
||||
// We know driverKey.Length() > 0 since driverKeyPre is a prefix of driverKey.
|
||||
if (driverKey[driverKey.Length()-1] == '0') {
|
||||
driverKey.SetCharAt('1', driverKey.Length()-1);
|
||||
} else {
|
||||
driverKey.SetCharAt('0', driverKey.Length()-1);
|
||||
}
|
||||
result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.BeginReading(), 0, KEY_QUERY_VALUE, &key);
|
||||
if (result == ERROR_SUCCESS) {
|
||||
mHasDualGPU = PR_TRUE;
|
||||
mDeviceKey2 = driverKey;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"DriverVersion", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverVersion2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"DriverDate", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDriverDate2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"Device Description", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDeviceString2 = value;
|
||||
dwcbData = sizeof(value);
|
||||
result = RegQueryValueExW(key, L"MatchingDeviceId", NULL, NULL, (LPBYTE)value, &dwcbData);
|
||||
if (result == ERROR_SUCCESS)
|
||||
mDeviceID2 = value;
|
||||
RegCloseKey(key);
|
||||
}
|
||||
RegCloseKey(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -495,47 +422,6 @@ GfxInfo::Init()
|
|||
FreeLibrary(setupapi);
|
||||
}
|
||||
|
||||
nsAutoString vendor(mDeviceID);
|
||||
ToUpperCase(vendor);
|
||||
PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterVendorID = vendor.ToInteger(&err, 16);
|
||||
|
||||
vendor = mDeviceID2;
|
||||
ToUpperCase(vendor);
|
||||
start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
mAdapterVendorID2 = vendor.ToInteger(&err, 16);
|
||||
|
||||
nsAutoString device(mDeviceID);
|
||||
ToUpperCase(device);
|
||||
start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
mAdapterDeviceID = device.ToInteger(&err, 16);
|
||||
|
||||
device = mDeviceID2;
|
||||
ToUpperCase(device);
|
||||
start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
mAdapterDeviceID2 = device.ToInteger(&err, 16);
|
||||
|
||||
if (mHasDualGPU) {
|
||||
IdentifyActiveDevice();
|
||||
}
|
||||
|
||||
const char *spoofedDriverVersionString = PR_GetEnv("MOZ_GFX_SPOOF_DRIVER_VERSION");
|
||||
if (spoofedDriverVersionString) {
|
||||
mDriverVersion.AssignASCII(spoofedDriverVersionString);
|
||||
|
@ -544,6 +430,16 @@ GfxInfo::Init()
|
|||
const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_VENDOR_ID");
|
||||
if (spoofedVendor) {
|
||||
PR_sscanf(spoofedVendor, "%x", &mAdapterVendorID);
|
||||
} else {
|
||||
nsAutoString vendor(mDeviceID);
|
||||
ToUpperCase(vendor);
|
||||
PRInt32 start = vendor.Find(NS_LITERAL_CSTRING("VEN_"));
|
||||
if (start != -1) {
|
||||
vendor.Cut(0, start + strlen("VEN_"));
|
||||
vendor.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterVendorID = vendor.ToInteger(&err, 16);
|
||||
}
|
||||
|
||||
mHasDriverVersionMismatch = PR_FALSE;
|
||||
|
@ -572,6 +468,16 @@ GfxInfo::Init()
|
|||
const char *spoofedDevice = PR_GetEnv("MOZ_GFX_SPOOF_DEVICE_ID");
|
||||
if (spoofedDevice) {
|
||||
PR_sscanf(spoofedDevice, "%x", &mAdapterDeviceID);
|
||||
} else {
|
||||
nsAutoString device(mDeviceID);
|
||||
ToUpperCase(device);
|
||||
PRInt32 start = device.Find(NS_LITERAL_CSTRING("&DEV_"));
|
||||
if (start != -1) {
|
||||
device.Cut(0, start + strlen("&DEV_"));
|
||||
device.Truncate(4);
|
||||
}
|
||||
nsresult err;
|
||||
mAdapterDeviceID = device.ToInteger(&err, 16);
|
||||
}
|
||||
|
||||
const char *spoofedWindowsVersion = PR_GetEnv("MOZ_GFX_SPOOF_WINDOWS_VERSION");
|
||||
|
@ -594,14 +500,6 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
aAdapterDescription = mDeviceString2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
|
@ -611,15 +509,6 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"HardwareInformation.MemorySize", aAdapterRAM, REG_DWORD)))
|
||||
aAdapterRAM = L"Unknown";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
|
@ -629,15 +518,6 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
if (NS_FAILED(GetKeyValue(mDeviceKey2.BeginReading(), L"InstalledDisplayDrivers", aAdapterDriver, REG_MULTI_SZ)))
|
||||
aAdapterDriver = L"Unknown";
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
|
@ -654,22 +534,6 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
aAdapterDriverVersion = mDriverVersion2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
aAdapterDriverDate = mDriverDate2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
|
@ -678,14 +542,6 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
*aAdapterVendorID = mAdapterVendorID2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
|
@ -694,22 +550,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
*aAdapterDeviceID = mAdapterDeviceID2;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
*aIsGPU2Active = mIsGPU2Active;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if defined(MOZ_CRASHREPORTER)
|
||||
/* Cisco's VPN software can cause corruption of the floating point state.
|
||||
* Make a note of this in our crash reports so that some weird crashes
|
||||
|
@ -767,19 +607,6 @@ GfxInfo::AddCrashReportAnnotations()
|
|||
}
|
||||
note.Append("\n");
|
||||
|
||||
if (mHasDualGPU) {
|
||||
PRUint32 deviceID2, vendorID2;
|
||||
nsAutoString adapterDriverVersionString2;
|
||||
|
||||
note.Append("Has dual GPUs. GPU #2: ");
|
||||
GetAdapterDeviceID2(&deviceID2);
|
||||
GetAdapterVendorID2(&vendorID2);
|
||||
GetAdapterDriverVersion2(adapterDriverVersionString2);
|
||||
note.AppendPrintf("AdapterVendorID2: %04x, ", vendorID2);
|
||||
note.AppendPrintf("AdapterDeviceID2: %04x, ", deviceID2);
|
||||
note.AppendPrintf("AdapterDriverVersion2: ");
|
||||
note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
|
||||
}
|
||||
CrashReporter::AppendAppNotesToCrashReport(note);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -68,14 +68,6 @@ public:
|
|||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
@ -94,7 +86,6 @@ protected:
|
|||
private:
|
||||
|
||||
void AddCrashReportAnnotations();
|
||||
void IdentifyActiveDevice();
|
||||
nsString mDeviceString;
|
||||
nsString mDeviceID;
|
||||
nsString mDriverVersion;
|
||||
|
@ -103,16 +94,7 @@ private:
|
|||
nsString mDeviceKeyDebug;
|
||||
PRUint32 mAdapterVendorID;
|
||||
PRUint32 mAdapterDeviceID;
|
||||
nsString mDeviceString2;
|
||||
nsString mDriverVersion2;
|
||||
nsString mDeviceID2;
|
||||
nsString mDriverDate2;
|
||||
nsString mDeviceKey2;
|
||||
PRUint32 mAdapterVendorID2;
|
||||
PRUint32 mAdapterDeviceID2;
|
||||
PRUint32 mWindowsVersion;
|
||||
PRBool mHasDualGPU;
|
||||
PRBool mIsGPU2Active;
|
||||
PRBool mHasDriverVersionMismatch;
|
||||
};
|
||||
|
||||
|
|
|
@ -343,13 +343,6 @@ GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
||||
|
@ -358,13 +351,6 @@ GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterRAM2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
||||
|
@ -373,13 +359,6 @@ GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriver2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
||||
|
@ -389,13 +368,6 @@ GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverVersion2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
||||
|
@ -404,13 +376,6 @@ GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDriverDate2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
||||
|
@ -419,13 +384,6 @@ GfxInfo::GetAdapterVendorID(PRUint32 *aAdapterVendorID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterVendorID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterVendorID2(PRUint32 *aAdapterVendorID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
||||
|
@ -434,20 +392,6 @@ GfxInfo::GetAdapterDeviceID(PRUint32 *aAdapterDeviceID)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned long adapterDeviceID2; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute boolean isGPU2Active; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetIsGPU2Active(PRBool* aIsGPU2Active)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
||||
} // end namespace widget
|
||||
} // end namespace mozilla
|
||||
|
|
|
@ -63,14 +63,6 @@ public:
|
|||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterVendorID2(PRUint32 *aAdapterVendorID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDeviceID2(PRUint32 *aAdapterDeviceID);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
|
||||
NS_SCRIPTABLE NS_IMETHOD GetIsGPU2Active(PRBool *aIsGPU2Active);
|
||||
using GfxInfoBase::GetFeatureStatus;
|
||||
using GfxInfoBase::GetFeatureSuggestedDriverVersion;
|
||||
using GfxInfoBase::GetWebGLParameter;
|
||||
|
|
Загрузка…
Ссылка в новой задаче