bug 112522 on anti-alias scale bitmap font on local X server

r=pavlov, sr=mscott
This commit is contained in:
bstell%netscape.com 2001-11-29 07:55:08 +00:00
Родитель e5ee0feabb
Коммит 04de485892
2 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -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;