From 3f05326ab86b1fbefcee6d09b224bb17cc43c158 Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Fri, 27 Apr 2001 09:44:43 +0000 Subject: [PATCH] fix for bug 77645 r=syd, sr=brendan. --- gfx/src/gtk/XIE.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/gfx/src/gtk/XIE.c b/gfx/src/gtk/XIE.c index 80f70bb8c295..1f207516b8a7 100644 --- a/gfx/src/gtk/XIE.c +++ b/gfx/src/gtk/XIE.c @@ -33,8 +33,11 @@ #include +#include "prenv.h" + /*#define DEBUG_XIE 1*/ +static PRBool useXIE = PR_TRUE; static PRBool inited = PR_FALSE; static XiePhotospace gPhotospace; static XiePhotoElement *photoElement; @@ -141,10 +144,31 @@ DrawScaledImageXIE(Display *display, printf("DrawScaledImageXIE\n"); #endif + if (!useXIE) { +#ifdef DEBUG_XIE + fprintf(stderr, "useXIE is false.\n"); +#endif + return PR_FALSE; + } + if (!inited) { XieExtensionInfo *info; - if (!XieInitialize(display, &info)) + + if (useXIE) { + char *text = PR_GetEnv("MOZ_DISABLE_XIE"); + if (text) { +#ifdef DEBUG_XIE + fprintf(stderr, "MOZ_DISABLE_XIE set, disabling use of XIE.\n"); +#endif + useXIE = PR_FALSE; + return PR_FALSE; + } + } + + if (!XieInitialize(display, &info)) { + useXIE = PR_FALSE; return PR_FALSE; + } inited = PR_TRUE; @@ -161,7 +185,7 @@ DrawScaledImageXIE(Display *display, if (aSrcMask) { Drawable destMask; -#ifdef DEBUG_XIE +#ifdef DEBUG_XIE fprintf(stderr, "DrawScaledImageXIE with alpha mask\n"); #endif