зеркало из https://github.com/mozilla/pjs.git
Bug 630201. Don't use DirectWrite for pre-RTM versions of Windows 7. r=bas, a=joedrew
This commit is contained in:
Родитель
38a12eeaea
Коммит
723aae06e9
|
@ -408,6 +408,29 @@ gfxWindowsPlatform::VerifyD2DDevice(PRBool aAttemptForce)
|
|||
#endif
|
||||
}
|
||||
|
||||
// bug 630201 - older pre-RTM versions of Direct2D/DirectWrite cause odd
|
||||
// crashers so blacklist them altogether
|
||||
|
||||
#ifdef CAIRO_HAS_DWRITE_FONT
|
||||
#define WINDOWS7_RTM_BUILD 7600
|
||||
|
||||
static PRBool
|
||||
AllowDirectWrite()
|
||||
{
|
||||
PRInt32 winVers, buildNum;
|
||||
|
||||
winVers = gfxWindowsPlatform::WindowsOSVersion(&buildNum);
|
||||
if (winVers == gfxWindowsPlatform::kWindows7 &&
|
||||
buildNum < WINDOWS7_RTM_BUILD)
|
||||
{
|
||||
// don't use Direct2D/DirectWrite on older versions of Windows 7
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
gfxPlatformFontList*
|
||||
gfxWindowsPlatform::CreatePlatformFontList()
|
||||
{
|
||||
|
@ -417,7 +440,7 @@ gfxWindowsPlatform::CreatePlatformFontList()
|
|||
pfl = new gfxFT2FontList();
|
||||
#else
|
||||
#ifdef CAIRO_HAS_DWRITE_FONT
|
||||
if (GetDWriteFactory()) {
|
||||
if (AllowDirectWrite() && GetDWriteFactory()) {
|
||||
pfl = new gfxDWriteFontList();
|
||||
if (NS_SUCCEEDED(pfl->InitFontList())) {
|
||||
return pfl;
|
||||
|
@ -677,9 +700,10 @@ gfxWindowsPlatform::UseClearTypeAlways()
|
|||
}
|
||||
|
||||
PRInt32
|
||||
gfxWindowsPlatform::WindowsOSVersion()
|
||||
gfxWindowsPlatform::WindowsOSVersion(PRInt32 *aBuildNum)
|
||||
{
|
||||
static PRInt32 winVersion = UNINITIALIZED_VALUE;
|
||||
static PRInt32 buildNum = UNINITIALIZED_VALUE;
|
||||
|
||||
OSVERSIONINFO vinfo;
|
||||
|
||||
|
@ -687,10 +711,17 @@ gfxWindowsPlatform::WindowsOSVersion()
|
|||
vinfo.dwOSVersionInfoSize = sizeof (vinfo);
|
||||
if (!GetVersionEx(&vinfo)) {
|
||||
winVersion = kWindowsUnknown;
|
||||
buildNum = 0;
|
||||
} else {
|
||||
winVersion = PRInt32(vinfo.dwMajorVersion << 16) + vinfo.dwMinorVersion;
|
||||
buildNum = PRInt32(vinfo.dwBuildNumber);
|
||||
}
|
||||
}
|
||||
|
||||
if (aBuildNum) {
|
||||
*aBuildNum = buildNum;
|
||||
}
|
||||
|
||||
return winVersion;
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ public:
|
|||
kWindows7 = 0x60001
|
||||
};
|
||||
|
||||
static PRInt32 WindowsOSVersion();
|
||||
static PRInt32 WindowsOSVersion(PRInt32 *aBuildNum = nsnull);
|
||||
|
||||
static void GetDLLVersion(const PRUnichar *aDLLPath, nsAString& aVersion);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче