зеркало из https://github.com/mozilla/gecko-dev.git
bug 112522 on anti-alias scale bitmap font on local X server
r=pavlov, sr=mscott
This commit is contained in:
Родитель
e5ee0feabb
Коммит
04de485892
|
@ -118,6 +118,17 @@ double gAASBDarkTextGain = 0.6;
|
|||
PRUint8 gAASBLightTextMinValue = 64;
|
||||
double gAASBLightTextGain = 1.3;
|
||||
|
||||
PRBool
|
||||
nsXFontAAScaledBitmap::DisplayIsLocal(Display *aDisplay)
|
||||
{
|
||||
// if shared memory works then the display is local
|
||||
if (gdk_get_use_xshm())
|
||||
return PR_TRUE;
|
||||
|
||||
return PR_FALSE;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
nsXFontAAScaledBitmap::DrawText8(GdkDrawable *aDrawable, GdkGC *aGC,
|
||||
PRInt32 aX, PRInt32 aY,
|
||||
|
@ -469,6 +480,11 @@ nsXFontAAScaledBitmap::InitGlobals(Display *aDisplay, int aScreen)
|
|||
|
||||
sDisplay = aDisplay; // used to free shared sBackgroundGC
|
||||
|
||||
// if not a local display then might be slow so don't run
|
||||
if (!DisplayIsLocal(aDisplay)) {
|
||||
goto cleanup_and_return;
|
||||
}
|
||||
|
||||
root_win = RootWindow(sDisplay, aScreen);
|
||||
sBackgroundGC = XCreateGC(sDisplay, root_win, 0, NULL);
|
||||
NS_ASSERTION(sBackgroundGC, "failed to create sBackgroundGC");
|
||||
|
|
|
@ -98,6 +98,7 @@ protected:
|
|||
#ifdef DEBUG
|
||||
void dump_XImage_blue_data(XImage *ximage);
|
||||
#endif
|
||||
static PRBool DisplayIsLocal(Display *);
|
||||
|
||||
protected:
|
||||
PRBool mAlreadyLoaded;
|
||||
|
|
Загрузка…
Ссылка в новой задаче