mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 624970. Display DirectWrite version in about:support. r=joe, a=joe
This commit is contained in:
parent
d987bacdd1
commit
5c42411612
@ -691,6 +691,43 @@ gfxWindowsPlatform::WindowsOSVersion()
|
||||
return winVersion;
|
||||
}
|
||||
|
||||
void
|
||||
gfxWindowsPlatform::GetDLLVersion(PRUnichar *aDLLPath, nsAString& aVersion)
|
||||
{
|
||||
DWORD versInfoSize, vers[4] = {0};
|
||||
// version info not available case
|
||||
aVersion.Assign(NS_LITERAL_STRING("0.0.0.0"));
|
||||
versInfoSize = GetFileVersionInfoSizeW(aDLLPath, NULL);
|
||||
nsAutoTArray<BYTE,512> versionInfo;
|
||||
|
||||
if (!versionInfo.AppendElements(PRUint32(versInfoSize))) {
|
||||
return;
|
||||
}
|
||||
if (!GetFileVersionInfoW(aDLLPath, NULL, versInfoSize,
|
||||
LPBYTE(versionInfo.Elements()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
UINT len;
|
||||
VS_FIXEDFILEINFO *fileInfo;
|
||||
if (!VerQueryValue(LPBYTE(versionInfo.Elements()), TEXT("\\"),
|
||||
(LPVOID *)&fileInfo , &len)) {
|
||||
return;
|
||||
}
|
||||
|
||||
DWORD fileVersMS = fileInfo->dwFileVersionMS;
|
||||
DWORD fileVersLS = fileInfo->dwFileVersionLS;
|
||||
|
||||
vers[0] = HIWORD(fileVersMS);
|
||||
vers[1] = LOWORD(fileVersMS);
|
||||
vers[2] = HIWORD(fileVersLS);
|
||||
vers[3] = LOWORD(fileVersLS);
|
||||
|
||||
char buf[256];
|
||||
sprintf(buf, "%d.%d.%d.%d", vers[0], vers[1], vers[2], vers[3]);
|
||||
aVersion.Assign(NS_ConvertUTF8toUTF16(buf));
|
||||
}
|
||||
|
||||
void
|
||||
gfxWindowsPlatform::FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref)
|
||||
{
|
||||
|
@ -227,6 +227,8 @@ public:
|
||||
|
||||
static PRInt32 WindowsOSVersion();
|
||||
|
||||
static void GetDLLVersion(PRUnichar *aDLLPath, nsAString& aVersion);
|
||||
|
||||
virtual void FontsPrefsChanged(nsIPrefBranch *aPrefBranch, const char *aPref);
|
||||
|
||||
#ifdef CAIRO_HAS_DWRITE_FONT
|
||||
|
@ -233,12 +233,16 @@ function populateGraphicsSection() {
|
||||
]));
|
||||
|
||||
var dwEnabled = false;
|
||||
var dwriteEnabledStr = dwEnabled.toString();
|
||||
var dwriteVersion;
|
||||
try {
|
||||
dwEnabled = gfxInfo.DWriteEnabled;
|
||||
dwriteVersion = gfxInfo.DWriteVersion;
|
||||
dwriteEnabledStr = dwEnabled.toString() + " (" + dwriteVersion + ")";
|
||||
} catch(e) {}
|
||||
trGraphics.push(createParentElement("tr", [
|
||||
createHeader(bundle.GetStringFromName("directWriteEnabled")),
|
||||
createElement("td", dwEnabled),
|
||||
createElement("td", dwriteEnabledStr),
|
||||
]));
|
||||
|
||||
var webglrenderer;
|
||||
|
@ -40,7 +40,7 @@
|
||||
|
||||
/* NOTE: this interface is completely undesigned, not stable and likely to change */
|
||||
|
||||
[scriptable, uuid(d2bfa0fd-8f73-4660-9609-f999680243b1)]
|
||||
[scriptable, uuid(5c5de1e7-f7f4-46b4-9ced-03ab1f869eaf)]
|
||||
interface nsIGfxInfo : nsISupports
|
||||
{
|
||||
/*
|
||||
@ -48,6 +48,7 @@ interface nsIGfxInfo : nsISupports
|
||||
*/
|
||||
readonly attribute boolean D2DEnabled;
|
||||
readonly attribute boolean DWriteEnabled;
|
||||
readonly attribute DOMString DWriteVersion;
|
||||
|
||||
/**
|
||||
* The name of the display adapter.
|
||||
|
@ -71,6 +71,13 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void
|
||||
GfxInfo::Init()
|
||||
{
|
||||
|
@ -106,6 +106,13 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString adapterDescription; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
|
||||
|
@ -74,6 +74,14 @@ GfxInfo::GetDWriteEnabled(PRBool *aEnabled)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute DOMString DWriteVersion; */
|
||||
NS_IMETHODIMP
|
||||
GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
|
||||
{
|
||||
gfxWindowsPlatform::GetPlatform()->GetDLLVersion(L"dwrite.dll", aDwriteVersion);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* 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)
|
||||
|
Loading…
Reference in New Issue
Block a user