diff -cr qt-copy/config.tests/x11/xfreetype.test qt-keithp/config.tests/x11/xfreetype.test *** qt-copy/config.tests/x11/xfreetype.test 2002-03-13 16:54:38.000000000 -0800 --- qt-keithp/config.tests/x11/xfreetype.test 2002-05-23 20:33:39.000000000 -0700 *************** *** 74,79 **** --- 74,96 ---- fi fi + XFTCOMPAT_H= + if [ "$XFREETYPE" = "yes" ] + then + INC="X11/Xft/XftCompat.h" + XDIRS=`sed -n -e '/^QMAKE_INCDIR_X11[ ]*=/ { s/[^=]*=[ ]*//; s/-I/ /g; p; }' $XCONFIG` + INCDIRS="$IN_INCDIRS $XDIRS /usr/include /include" + for INCDIR in $INCDIRS + do + if [ -f $INCDIR/$INC ] + then + XFTCOMPAT_H=$INCDIR/$INC + [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR" + break + fi + done + fi + if [ "$XFREETYPE" = "yes" ] then INC="X11/Xft/XftFreetype.h" *************** *** 99,108 **** # check for XftNameUnparse in X11/Xft/Xft.h XFTNAMEUNPARSE=yes ! if [ "$XFREETYPE" = "yes" ] && [ -f "$XFT_H" ] then ! grep XftNameUnparse $XFT_H >/dev/null || XFTNAMEUNPARSE=no ! [ "$XFTNAMEUNPARSE" = "no" ] && echo "xftnameunparse" > $x11tests/xfreetype.cfg fi --- 116,130 ---- # check for XftNameUnparse in X11/Xft/Xft.h XFTNAMEUNPARSE=yes ! if [ "$XFREETYPE" = "yes" ] && [ -f "$XFTCOMPAT_H" ] then ! : ! else ! if [ "$XFREETYPE" = "yes" ] && [ -f "$XFT_H" ] ! then ! grep XftNameUnparse $XFT_H >/dev/null || XFTNAMEUNPARSE=no ! [ "$XFTNAMEUNPARSE" = "no" ] && echo "xftnameunparse" > $x11tests/xfreetype.cfg ! fi fi diff -cr qt-copy/src/kernel/qfontdata_p.h qt-keithp/src/kernel/qfontdata_p.h *** qt-copy/src/kernel/qfontdata_p.h 2002-04-26 13:55:33.000000000 -0700 --- qt-keithp/src/kernel/qfontdata_p.h 2002-05-23 21:16:14.000000000 -0700 *************** *** 363,369 **** #ifndef QT_NO_XFTFREETYPE XftPattern *findXftFont(const QChar &, bool *) const; ! XftPattern *bestXftPattern(const QString &, const QString &) const; #endif // QT_NO_XFTFREETYPE QCString findFont(QFont::Script, bool *) const; QCString findXftFont(QFont::Script, bool *) const; --- 363,369 ---- #ifndef QT_NO_XFTFREETYPE XftPattern *findXftFont(const QChar &, bool *) const; ! XftPattern *bestXftPattern(const QString &, const QString &, const QChar &) const; #endif // QT_NO_XFTFREETYPE QCString findFont(QFont::Script, bool *) const; QCString findXftFont(QFont::Script, bool *) const; diff -cr qt-copy/src/kernel/qfont_x11.cpp qt-keithp/src/kernel/qfont_x11.cpp *** qt-copy/src/kernel/qfont_x11.cpp 2002-04-26 13:55:33.000000000 -0700 --- qt-keithp/src/kernel/qfont_x11.cpp 2002-07-25 09:56:53.000000000 -0700 *************** *** 363,369 **** #ifndef QT_NO_XFTFREETYPE if (xfthandle) { ! XftFreeTypeClose(QPaintDevice::x11AppDisplay(), (XftFontStruct *) xfthandle); xfthandle = 0; } --- 363,369 ---- #ifndef QT_NO_XFTFREETYPE if (xfthandle) { ! XftFontClose(QPaintDevice::x11AppDisplay(), (XftFont *) xfthandle); xfthandle = 0; } *************** *** 679,692 **** // a valid XGlyphInfo static inline XGlyphInfo *getGlyphInfo(QFontStruct *qfs, const QString &str, int pos) { ! XftFontStruct *xftfs; XGlyphInfo *xgi; QChar ch; ! unsigned int missing[1]; ! int nmissing = 0; if (! qfs || qfs == (QFontStruct *) -1 || ! ! (xftfs = (XftFontStruct *) qfs->xfthandle)) { xgi = (XGlyphInfo *) -2; goto end; } --- 679,691 ---- // a valid XGlyphInfo static inline XGlyphInfo *getGlyphInfo(QFontStruct *qfs, const QString &str, int pos) { ! XftFont *xftfs; XGlyphInfo *xgi; QChar ch; ! XftChar16 c; if (! qfs || qfs == (QFontStruct *) -1 || ! ! (xftfs = (XftFont *) qfs->xfthandle)) { xgi = (XGlyphInfo *) -2; goto end; } *************** *** 694,716 **** // no need for codec, all Xft fonts are in unicode mapping ch = QComplexText::shapedCharacter(str, pos); ! if (ch.unicode() == 0) { xgi = 0; goto end; } // load the glyph if it's not in the font ! XftGlyphCheck(QPaintDevice::x11AppDisplay(), xftfs, ch.unicode(), ! missing, &nmissing); ! if (nmissing) ! XftGlyphLoad(QPaintDevice::x11AppDisplay(), xftfs, missing, nmissing); ! ! if (ch.unicode() > xftfs->nrealized) { ! xgi = (XGlyphInfo *) -1; ! goto end; } ! xgi = xftfs->realized[ch.unicode()]; ! if (! xgi) xgi = (XGlyphInfo *) -1; end: --- 693,713 ---- // no need for codec, all Xft fonts are in unicode mapping ch = QComplexText::shapedCharacter(str, pos); ! c = ch.unicode (); ! if (c == 0) { xgi = 0; goto end; } // load the glyph if it's not in the font ! if (XftGlyphExists (QPaintDevice::x11AppDisplay(), xftfs, c)) ! { ! static XGlyphInfo metrics; ! XftTextExtents16 (QPaintDevice::x11AppDisplay(), xftfs, ! &c, 1, &metrics); ! xgi = &metrics; } ! else xgi = (XGlyphInfo *) -1; end: *************** *** 721,750 **** // ditto static inline XGlyphInfo *getGlyphInfo(QFontStruct *qfs, const QChar &ch) { ! XftFontStruct *xftfs; XGlyphInfo *xgi; ! unsigned int missing[1]; ! int nmissing = 0; if (! qfs || qfs == (QFontStruct *) -1 || ! ! (xftfs = (XftFontStruct *) qfs->xfthandle)) { xgi = (XGlyphInfo *) -2; goto end; } ! // load the glyph if it's not in the font ! XftGlyphCheck(QPaintDevice::x11AppDisplay(), xftfs, ch.unicode(), ! missing, &nmissing); ! if (nmissing) ! XftGlyphLoad(QPaintDevice::x11AppDisplay(), xftfs, missing, nmissing); ! ! if (ch.unicode() > xftfs->nrealized) { xgi = (XGlyphInfo *) -1; goto end; } - xgi = xftfs->realized[ch.unicode()]; - if (! xgi) - xgi = (XGlyphInfo *) -1; end: return xgi; --- 718,747 ---- // ditto static inline XGlyphInfo *getGlyphInfo(QFontStruct *qfs, const QChar &ch) { ! XftFont *xftfs; XGlyphInfo *xgi; ! XftChar16 c; if (! qfs || qfs == (QFontStruct *) -1 || ! ! (xftfs = (XftFont *) qfs->xfthandle)) { xgi = (XGlyphInfo *) -2; goto end; } ! c = ch.unicode(); ! ! if (XftGlyphExists (QPaintDevice::x11AppDisplay(), xftfs, c)) ! { ! static XGlyphInfo metrics; ! XftTextExtents16 (QPaintDevice::x11AppDisplay(), xftfs, ! &c, 1, &metrics); ! xgi = &metrics; ! } ! else ! { xgi = (XGlyphInfo *) -1; goto end; } end: return xgi; *************** *** 1211,1217 **** XFontStruct *xfs = 0; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = 0; #endif // QT_NO_XFTFREETYPE if ( cache->script < QFont::LastPrivateScript && --- 1208,1214 ---- XFontStruct *xfs = 0; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = 0; #endif // QT_NO_XFTFREETYPE if ( cache->script < QFont::LastPrivateScript && *************** *** 1220,1226 **** xfs = (XFontStruct *) qfs->handle; #ifndef QT_NO_XFTFREETYPE ! xftfs = (XftFontStruct *) qfs->xfthandle; #endif // QT_NO_XFTFREETYPE } --- 1217,1223 ---- xfs = (XFontStruct *) qfs->handle; #ifndef QT_NO_XFTFREETYPE ! xftfs = (XftFont *) qfs->xfthandle; #endif // QT_NO_XFTFREETYPE } *************** *** 1229,1264 **** #ifndef QT_NO_XFTFREETYPE if (xftfs) { - QPixmap *pm = qt_xft_render_sources->find(screen); - if (! pm) { - pm = new QPixmap(1, 1); - // fix the render Picture to tile the source - XRenderPictureAttributes pattr; - pattr.repeat = TRUE; - XRenderChangePicture(dpy, pm->x11RenderHandle(), CPRepeat, &pattr); - - qt_xft_render_sources->insert(screen, pm); - } - - // fill pixmap with pen color - pm->fill(pen); if (bgmode != Qt::TransparentMode) { ! XRenderColor col; ! col.red = bgcolor.red() | bgcolor.red() << 8; ! col.green = bgcolor.green() | bgcolor.green() << 8; ! col.blue = bgcolor.blue() | bgcolor.blue() << 8; ! col.alpha = 0xffff; ! XRenderFillRectangle(dpy, PictOpSrc, rendhd, &col, ! x + cache->xoff, y - xftfs->ascent, ! cache->x2off - cache->xoff, ! xftfs->ascent + xftfs->descent); ! } ! ! XRenderCompositeString16(dpy, PictOpOver, pm->x11RenderHandle(), rendhd, ! xftfs->format, xftfs->glyphset, ! 0, 0, x + cache->xoff, y + cache->yoff, ! (unsigned short *)cache->string, cache->length); } else #endif // QT_NO_XFTFREETYPE if (xfs) { --- 1226,1257 ---- #ifndef QT_NO_XFTFREETYPE if (xftfs) { + XftDraw *draw = (XftDraw *) rendhd; + if (bgmode != Qt::TransparentMode) { ! XftColor col; ! col.color.red = bgcolor.red() | bgcolor.red() << 8; ! col.color.green = bgcolor.green() | bgcolor.green() << 8; ! col.color.blue = bgcolor.blue() | bgcolor.blue() << 8; ! col.color.alpha = 0xffff; ! col.pixel = bgcolor.pixel(); ! ! XftDrawRect (draw, &col, ! x + cache->xoff, y - xftfs->ascent, ! cache->x2off - cache->xoff, ! xftfs->ascent + xftfs->descent); ! } ! ! XftColor col; ! col.color.red = pen.red () | pen.red() << 8; ! col.color.green = pen.green () | pen.green() << 8; ! col.color.blue = pen.blue () | pen.blue() << 8; ! col.color.alpha = 0xffff; ! col.pixel = pen.pixel(); ! XftDrawString16 (draw, &col, xftfs, ! x + cache->xoff, y + cache->yoff, ! (unsigned short *)cache->string, cache->length); } else #endif // QT_NO_XFTFREETYPE if (xfs) { *************** *** 1335,1342 **** #ifndef QT_NO_XFTFREETYPE if (qfs && qfs != (QFontStruct *) -1 && qfs->xfthandle) ! return XftFreeTypeGlyphExists(QPaintDevice::x11AppDisplay(), ! (XftFontStruct *) qfs->xfthandle, ch.unicode()); #endif // QT_NO_XFTFREETYPE XCharStruct *xcs = getCharStruct(qfs, QString(ch), 0); --- 1328,1335 ---- #ifndef QT_NO_XFTFREETYPE if (qfs && qfs != (QFontStruct *) -1 && qfs->xfthandle) ! return XftGlyphExists (QPaintDevice::x11AppDisplay(), ! (XftFont *) qfs->xfthandle, (FcChar32) ch.unicode()); #endif // QT_NO_XFTFREETYPE XCharStruct *xcs = getCharStruct(qfs, QString(ch), 0); *************** *** 1348,1353 **** --- 1341,1347 ---- static XftPattern *checkXftFont( XftPattern *match, const QString &familyName, const QChar &sample ) { + #if 0 char * family_value; XftPatternGetString (match, XFT_FAMILY, 0, &family_value); QString fam = family_value; *************** *** 1358,1367 **** --- 1352,1376 ---- XftPatternDestroy(match); match = 0; } + #else + (void) familyName; + #endif if (match && sample.unicode() != 0 ) { // check if the character is actually in the font - this does result in // a font being loaded, but since Xft is completely client side, we can // do this efficiently + #ifdef QT_XFT2 + FcCharSet *c; + + if (FcPatternGetCharSet (match, FC_CHARSET, 0, &c) == FcResultMatch) + { + if (!FcCharSetHasChar (c, sample.unicode())) + { + XftPatternDestroy(match); + match = 0; + } + } + #else XftFontStruct *xftfs = XftFreeTypeOpen(QPaintDevice::x11AppDisplay(), match); *************** *** 1374,1379 **** --- 1383,1389 ---- XftFreeTypeClose(QPaintDevice::x11AppDisplay(), xftfs); } + #endif } return match; *************** *** 1388,1394 **** QString foundryName; QFontDatabase::parseFontName(request.family, foundryName, familyName); ! XftPattern *match = bestXftPattern(familyName, foundryName); if ( match ) match = checkXftFont( match, familyName, sample ); --- 1398,1404 ---- QString foundryName; QFontDatabase::parseFontName(request.family, foundryName, familyName); ! XftPattern *match = bestXftPattern(familyName, foundryName, sample); if ( match ) match = checkXftFont( match, familyName, sample ); *************** *** 1409,1415 **** if (request.family != familyName) { QFontDatabase::parseFontName(familyName, foundryName, familyName); ! match = bestXftPattern(familyName, foundryName); if ( match ) match = checkXftFont( match, familyName, sample ); --- 1419,1425 ---- if (request.family != familyName) { QFontDatabase::parseFontName(familyName, foundryName, familyName); ! match = bestXftPattern(familyName, foundryName, sample); if ( match ) match = checkXftFont( match, familyName, sample ); *************** *** 1422,1428 **** // finds an XftPattern best matching the familyname, foundryname and other // requested pieces of the font XftPattern *QFontPrivate::bestXftPattern(const QString &familyName, ! const QString &foundryName) const { QCString generic_value; int weight_value; --- 1432,1439 ---- // finds an XftPattern best matching the familyname, foundryname and other // requested pieces of the font XftPattern *QFontPrivate::bestXftPattern(const QString &familyName, ! const QString &foundryName, ! const QChar &sample) const { QCString generic_value; int weight_value; *************** *** 1484,1550 **** XftResult res; XftPattern *pattern = 0, *result = 0; ! if (mono_value >= XFT_MONO) { ! if (! foundryName.isNull()) ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FOUNDRY, XftTypeString, foundryName.latin1(), ! XFT_FAMILY, XftTypeString, familyName.latin1(), ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! XFT_SPACING, XftTypeInteger, mono_value, ! (char *) 0); ! else if (! familyName.isNull()) ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FAMILY, XftTypeString, familyName.latin1(), ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! XFT_SPACING, XftTypeInteger, mono_value, ! (char *) 0); ! else ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! XFT_SPACING, XftTypeInteger, mono_value, ! (char *) 0); ! } else { ! if (! foundryName.isNull()) ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FOUNDRY, XftTypeString, foundryName.latin1(), ! XFT_FAMILY, XftTypeString, familyName.latin1(), ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! (char *) 0); ! else if (! familyName.isNull()) ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FAMILY, XftTypeString, familyName.latin1(), ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! (char *) 0); ! else ! pattern = XftPatternBuild(0, ! XFT_ENCODING, XftTypeString, "iso10646-1", ! XFT_FAMILY, XftTypeString, generic_value.data(), ! XFT_WEIGHT, XftTypeInteger, weight_value, ! XFT_SLANT, XftTypeInteger, slant_value, ! sizeFormat, XftTypeDouble, size_value, ! (char *) 0); ! } if ( !qt_use_antialiasing || request.styleStrategy & ( QFont::PreferAntialias | QFont::NoAntialias) ) { bool requestAA; --- 1495,1527 ---- XftResult res; XftPattern *pattern = 0, *result = 0; ! pattern = XftPatternCreate (); + #ifndef QT_XFT2 + XftPatternAddString (XFT_ENCODING, "iso10646-1"); + #endif + if (! foundryName.isNull()) + XftPatternAddString (pattern, XFT_FOUNDRY, foundryName.latin1()); + if (! familyName.isNull()) + XftPatternAddString (pattern, XFT_FAMILY, familyName.latin1()); + XftPatternAddString (pattern, XFT_FAMILY, generic_value.data()); + + if (mono_value >= XFT_MONO) + XftPatternAddInteger (pattern, XFT_SPACING, mono_value); + + XftPatternAddInteger (pattern, XFT_WEIGHT, weight_value); + XftPatternAddInteger (pattern, XFT_SLANT, slant_value); + XftPatternAddDouble (pattern, sizeFormat, size_value); + #ifdef QT_XFT2 + if (sample.unicode() != 0) + { + FcCharSet *cs = FcCharSetCreate (); + FcCharSetAddChar (cs, sample.unicode()); + FcPatternAddCharSet (pattern, FC_CHARSET, cs); + FcCharSetDestroy (cs); /* let pattern hold last reference */ + } + #endif + if ( !qt_use_antialiasing || request.styleStrategy & ( QFont::PreferAntialias | QFont::NoAntialias) ) { bool requestAA; *************** *** 2348,2356 **** } #ifndef QT_NO_XFTFREETYPE else { ! hasChar = XftFreeTypeGlyphExists(QPaintDevice::x11AppDisplay(), ! (XftFontStruct *) qfs->xfthandle, ! sample.unicode()); } #endif // QT_NO_XFTFREETYPE --- 2325,2333 ---- } #ifndef QT_NO_XFTFREETYPE else { ! hasChar = XftGlyphExists(QPaintDevice::x11AppDisplay(), ! (XftFont *) qfs->xfthandle, ! sample.unicode()); } #endif // QT_NO_XFTFREETYPE *************** *** 2430,2436 **** XFontStruct *xfs = 0; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = 0; XftPattern *xftmatch = 0; #endif // QT_NO_XFTFREETYPE --- 2407,2413 ---- XFontStruct *xfs = 0; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = 0; XftPattern *xftmatch = 0; #endif // QT_NO_XFTFREETYPE *************** *** 2552,2560 **** qDebug("QFontLoader: loading xft font '%s'", fontname.data()); #endif ! xftfs = XftFreeTypeOpen(QPaintDevice::x11AppDisplay(), ! xftmatch); } #endif // QT_NO_XFTFREETYPE if (qxfn->useCore) { --- 2529,2540 ---- qDebug("QFontLoader: loading xft font '%s'", fontname.data()); #endif ! xftfs = XftFontOpenPattern(QPaintDevice::x11AppDisplay(), ! xftmatch); ! xftmatch = 0; /* xft font owns the pattern now */ } + if (xftmatch) + XftPatternDestroy (xftmatch); #endif // QT_NO_XFTFREETYPE if (qxfn->useCore) { *************** *** 2649,2661 **** } #ifndef QT_NO_XFTFREETYPE else if (xftfs) { ! cost = (xftfs->max_char - xftfs->min_char); ! if (cost <= 0) ! cost = 256; ! else if (cost > 3000) ! cost = 3000; ! cost = ((xftfs->ascent + xftfs->descent) * ! (xftfs->max_advance_width * cost / 8)); } #endif // QT_NO_XFTFREETYPE else { --- 2629,2636 ---- } #ifndef QT_NO_XFTFREETYPE else if (xftfs) { ! /* Xft2 has very low cost per font, everything is cached */ ! cost = 256; } #endif // QT_NO_XFTFREETYPE else { *************** *** 2668,2674 **** qfs = new QFontStruct((Qt::HANDLE) xfs, #ifndef QT_NO_XFTFREETYPE ! (Qt::HANDLE) xftfs, (Qt::HANDLE) xftmatch, #else 0, 0, #endif // QT_NO_XFTFREETYPE --- 2643,2649 ---- qfs = new QFontStruct((Qt::HANDLE) xfs, #ifndef QT_NO_XFTFREETYPE ! (Qt::HANDLE) xftfs, (Qt::HANDLE) 0, #else 0, 0, #endif // QT_NO_XFTFREETYPE *************** *** 2985,2991 **** return d->actual.pixelSize * 3 / 4; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = (XftFontStruct *) qfs->xfthandle; if (xftfs) return xftfs->ascent; #endif // QT_NO_XFTFREETYPE --- 2960,2966 ---- return d->actual.pixelSize * 3 / 4; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = (XftFont *) qfs->xfthandle; if (xftfs) return xftfs->ascent; #endif // QT_NO_XFTFREETYPE *************** *** 3015,3021 **** return 0; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = (XftFontStruct *) qfs->xfthandle; if (xftfs) return xftfs->descent - 1; #endif // QT_NO_XFTFREETYPE --- 2990,2996 ---- return 0; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = (XftFont *) qfs->xfthandle; if (xftfs) return xftfs->descent - 1; #endif // QT_NO_XFTFREETYPE *************** *** 3198,3204 **** return (d->actual.pixelSize * 3 / 4) + 1; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = (XftFontStruct *) qfs->xfthandle; if (xftfs) return xftfs->ascent + xftfs->descent; #endif // QT_NO_XFTFREETYPE --- 3173,3179 ---- return (d->actual.pixelSize * 3 / 4) + 1; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = (XftFont *) qfs->xfthandle; if (xftfs) return xftfs->ascent + xftfs->descent; #endif // QT_NO_XFTFREETYPE *************** *** 3228,3234 **** int l; #ifndef QT_NO_XFTFREETYPE ! XftFontStruct *xftfs = (XftFontStruct *) qfs->xfthandle; if (xftfs) l = (int) QMIN( xftfs->height - (xftfs->ascent + xftfs->descent), ((xftfs->ascent + xftfs->descent) >> 4) ); --- 3203,3209 ---- int l; #ifndef QT_NO_XFTFREETYPE ! XftFont *xftfs = (XftFont *) qfs->xfthandle; if (xftfs) l = (int) QMIN( xftfs->height - (xftfs->ascent + xftfs->descent), ((xftfs->ascent + xftfs->descent) >> 4) ); *************** *** 3511,3518 **** #ifndef QT_NO_XFTFREETYPE if (d->x11data.fontstruct[i]->xfthandle) { ! XftFontStruct *xftfs = ! (XftFontStruct *) qfs->xfthandle; ww = xftfs->max_advance_width; } else #endif // QT_NO_XFTFREETYPE --- 3486,3492 ---- #ifndef QT_NO_XFTFREETYPE if (d->x11data.fontstruct[i]->xfthandle) { ! XftFont *xftfs = (XftFont *) qfs->xfthandle; ww = xftfs->max_advance_width; } else #endif // QT_NO_XFTFREETYPE diff -cr qt-copy/src/kernel/qpaintdevice_x11.cpp qt-keithp/src/kernel/qpaintdevice_x11.cpp *** qt-copy/src/kernel/qpaintdevice_x11.cpp 2002-04-26 13:55:34.000000000 -0700 --- qt-keithp/src/kernel/qpaintdevice_x11.cpp 2002-05-23 21:33:29.000000000 -0700 *************** *** 275,281 **** */ Qt::HANDLE QPaintDevice::x11RenderHandle() const { ! return rendhd; } --- 275,281 ---- */ Qt::HANDLE QPaintDevice::x11RenderHandle() const { ! return XftDrawPicture ((XftDraw *) rendhd); } diff -cr qt-copy/src/kernel/qpainter.h qt-keithp/src/kernel/qpainter.h *** qt-copy/src/kernel/qpainter.h 2002-04-26 13:55:35.000000000 -0700 --- qt-keithp/src/kernel/qpainter.h 2002-05-23 20:46:35.000000000 -0700 *************** *** 382,388 **** Display *dpy; // current display int scrn; // current screen Qt::HANDLE hd; // handle to drawable ! Qt::HANDLE rendhd; // handle to Render Picture GC gc; // graphics context (standard) GC gc_brush; // graphics contect for brush QPoint curPt; // current point --- 382,388 ---- Display *dpy; // current display int scrn; // current screen Qt::HANDLE hd; // handle to drawable ! Qt::HANDLE rendhd; // handle to Xft draw GC gc; // graphics context (standard) GC gc_brush; // graphics contect for brush QPoint curPt; // current point diff -cr qt-copy/src/kernel/qpainter_x11.cpp qt-keithp/src/kernel/qpainter_x11.cpp *** qt-copy/src/kernel/qpainter_x11.cpp 2002-04-26 13:55:35.000000000 -0700 --- qt-keithp/src/kernel/qpainter_x11.cpp 2002-07-25 09:53:06.000000000 -0700 *************** *** 689,717 **** if ( !internclipok ) { if ( pdev == paintEventDevice && paintEventClipRegion ) { if ( penRef &&((QGCC*)penRef)->clip_serial < gc_cache_clip_serial ) { ! #ifndef QT_NO_XRENDER if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XRENDER XSetRegion( dpy, gc, paintEventClipRegion->handle() ); ((QGCC*)penRef)->clip_serial = gc_cache_clip_serial; } else if ( !penRef ) { ! #ifndef QT_NO_XRENDER if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XRENDER XSetRegion( dpy, gc, paintEventClipRegion->handle() ); } ! } else if (penRef && ((QGCC*)penRef)->clip_serial ) { ! #ifndef QT_NO_XRENDER ! if (rendhd) { ! XRenderPictureAttributes pattr; ! pattr.clip_mask = None; ! XRenderChangePicture(dpy, rendhd, CPClipMask, &pattr); ! } ! #endif // QT_NO_XRENDER ! XSetClipMask( dpy, gc, None ); ! ((QGCC*)penRef)->clip_serial = 0; } } --- 689,716 ---- if ( !internclipok ) { if ( pdev == paintEventDevice && paintEventClipRegion ) { if ( penRef &&((QGCC*)penRef)->clip_serial < gc_cache_clip_serial ) { ! #ifndef QT_NO_XFTFREETYPE if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XFTFREETYPE XSetRegion( dpy, gc, paintEventClipRegion->handle() ); ((QGCC*)penRef)->clip_serial = gc_cache_clip_serial; } else if ( !penRef ) { ! #ifndef QT_NO_XFTFREETYPE if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XFTFREETYPE XSetRegion( dpy, gc, paintEventClipRegion->handle() ); } ! } else { ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, 0); ! #endif // QT_NO_XFTFREETYPE ! if (penRef && ((QGCC*)penRef)->clip_serial ) { ! XSetClipMask( dpy, gc, None ); ! ((QGCC*)penRef)->clip_serial = 0; ! } } } *************** *** 901,929 **** if ( !internclipok ) { if ( pdev == paintEventDevice && paintEventClipRegion ) { if ( brushRef &&((QGCC*)brushRef)->clip_serial < gc_cache_clip_serial ) { ! #ifndef QT_NO_XRENDER ! if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XRENDER XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); ((QGCC*)brushRef)->clip_serial = gc_cache_clip_serial; } else if ( !brushRef ){ ! #ifndef QT_NO_XRENDER ! if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XRENDER XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); } ! } else if (brushRef && ((QGCC*)brushRef)->clip_serial ) { ! #ifndef QT_NO_XRENDER ! if (rendhd) { ! XRenderPictureAttributes pattr; ! pattr.clip_mask = None; ! XRenderChangePicture(dpy, rendhd, CPClipMask, &pattr); ! } ! #endif // QT_NO_XRENDER ! XSetClipMask( dpy, gc_brush, None ); ! ((QGCC*)brushRef)->clip_serial = 0; } } --- 900,927 ---- if ( !internclipok ) { if ( pdev == paintEventDevice && paintEventClipRegion ) { if ( brushRef &&((QGCC*)brushRef)->clip_serial < gc_cache_clip_serial ) { ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XFTFREETYPE XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); ((QGCC*)brushRef)->clip_serial = gc_cache_clip_serial; } else if ( !brushRef ){ ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, paintEventClipRegion->handle()); ! #endif // QT_NO_XFTFREETYPE XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); } ! } else { ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, 0); ! #endif // QT_NO_XFTFREETYPE ! if (brushRef && ((QGCC*)brushRef)->clip_serial ) { ! XSetClipMask( dpy, gc_brush, None ); ! ((QGCC*)brushRef)->clip_serial = 0; ! } } } *************** *** 1058,1064 **** dpy = pdev->x11Display(); // get display variable scrn = pdev->x11Screen(); // get screen variable hd = pdev->handle(); // get handle to drawable ! rendhd = pdev->x11RenderHandle(); if ( testf(ExtDev) ) { // external device if ( !pdev->cmd( QPaintDevice::PdcBegin, this, 0 ) ) { --- 1056,1062 ---- dpy = pdev->x11Display(); // get display variable scrn = pdev->x11Screen(); // get screen variable hd = pdev->handle(); // get handle to drawable ! rendhd = pdev->rendhd; if ( testf(ExtDev) ) { // external device if ( !pdev->cmd( QPaintDevice::PdcBegin, this, 0 ) ) { *************** *** 1120,1130 **** updateBrush(); XSetSubwindowMode( dpy, gc, IncludeInferiors ); XSetSubwindowMode( dpy, gc_brush, IncludeInferiors ); ! #ifndef QT_NO_XRENDER ! if (rendhd) { ! XRenderPictureAttributes pattr; ! pattr.subwindow_mode = IncludeInferiors; ! XRenderChangePicture(dpy, rendhd, CPSubwindowMode, &pattr); } #endif } --- 1118,1142 ---- updateBrush(); XSetSubwindowMode( dpy, gc, IncludeInferiors ); XSetSubwindowMode( dpy, gc_brush, IncludeInferiors ); ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! { ! # ifdef QT_XFT2 ! XftDrawSetSubwindowMode ((XftDraw *) rendhd, ! IncludeInferiors); ! # else ! # ifndef QT_NO_XRENDER ! Picture pict = XftDrawPicture ((XftDraw *) rendhd); ! if (pict) ! { ! XRenderPictureAttributes pattr; ! pattr.subwindow_mode = IncludeInferiors; ! XRenderChangePicture(dpy, pict, CPSubwindowMode, &pattr); ! } ! # else ! ; ! # endif ! # endif } #endif } *************** *** 1234,1248 **** if ( testf(ExtDev) ) pdev->cmd( QPaintDevice::PdcEnd, this, 0 ); ! #ifndef QT_NO_XRENDER ! if (rendhd) { ! // reset clipping/subwindow mode on our render picture ! XRenderPictureAttributes pattr; ! pattr.subwindow_mode = ClipByChildren; ! pattr.clip_mask = None; ! XRenderChangePicture(dpy, rendhd, CPClipMask | CPSubwindowMode, &pattr); } ! #endif // QT_NO_XRENDER if ( pfont ) { delete pfont; --- 1246,1273 ---- if ( testf(ExtDev) ) pdev->cmd( QPaintDevice::PdcEnd, this, 0 ); ! #ifndef QT_NO_XFTFREETYPE ! ! if (rendhd) ! { ! # ifdef QT_XFT2 ! XftDrawSetSubwindowMode ((XftDraw *) rendhd, ! ClipByChildren); ! # else ! # ifndef QT_NO_XRENDER ! Picture pict = XftDrawPicture ((XftDraw *) rendhd); ! if (pict) ! { ! XRenderPictureAttributes pattr; ! pattr.subwindow_mode = ClipByChildren; ! XRenderChangePicture(dpy, pict, CPSubwindowMode, &pattr); ! } ! # else ! ; ! # endif ! # endif } ! #endif // QT_NO_XFTFREETYPE if ( pfont ) { delete pfont; *************** *** 1481,1489 **** updateBrush(); XSetRegion( dpy, gc_brush, rgn.handle() ); ! #ifndef QT_NO_XRENDER if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, rgn.handle()); #endif // QT_NO_XRENDER } else { --- 1506,1514 ---- updateBrush(); XSetRegion( dpy, gc_brush, rgn.handle() ); ! #ifndef QT_NO_XFTFREETYPE if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, rgn.handle()); #endif // QT_NO_XRENDER } else { *************** *** 1491,1511 **** XSetRegion( dpy, gc, paintEventClipRegion->handle() ); XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); ! #ifndef QT_NO_XRENDER if (rendhd) ! XRenderSetPictureClipRegion(dpy, rendhd, paintEventClipRegion->handle()); #endif // QT_NO_XRENDER } else { XSetClipMask( dpy, gc, None ); XSetClipMask( dpy, gc_brush, None ); ! #ifndef QT_NO_XRENDER ! if (rendhd) { ! XRenderPictureAttributes pattr; ! pattr.clip_mask = None; ! XRenderChangePicture(dpy, rendhd, CPClipMask, &pattr); ! } #endif // QT_NO_XRENDER } --- 1516,1533 ---- XSetRegion( dpy, gc, paintEventClipRegion->handle() ); XSetRegion( dpy, gc_brush, paintEventClipRegion->handle() ); ! #ifndef QT_NO_XFTFREETYPE if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, paintEventClipRegion->handle()); #endif // QT_NO_XRENDER } else { XSetClipMask( dpy, gc, None ); XSetClipMask( dpy, gc_brush, None ); ! #ifndef QT_NO_XFTFREETYPE ! if (rendhd) ! XftDrawSetClip ((XftDraw *) rendhd, 0); #endif // QT_NO_XRENDER } *************** *** 2698,2707 **** #ifndef QT_NO_XRENDER QPixmap *alpha = pixmap.data->alphapm; ! if ( rendhd && pixmap.x11RenderHandle() && ! alpha && alpha->x11RenderHandle()) { ! XRenderComposite(dpy, PictOpOver, pixmap.x11RenderHandle(), ! alpha->x11RenderHandle(), rendhd, sx, sy, sx, sy, x, y, sw, sh); } else #endif // QT_NO_XRENDER --- 2720,2732 ---- #ifndef QT_NO_XRENDER QPixmap *alpha = pixmap.data->alphapm; ! Picture rend_pict; ! if (rendhd && (rend_pict = XftDrawPicture ((XftDraw *) rendhd)) && ! pixmap.x11RenderHandle() && ! alpha && alpha->x11RenderHandle()) ! { ! XRenderComposite(dpy, PictOpOver, pixmap.x11RenderHandle (), ! alpha->x11RenderHandle(), rend_pict, sx, sy, sx, sy, x, y, sw, sh); } else #endif // QT_NO_XRENDER *************** *** 2810,2816 **** #ifndef QT_NO_XRENDER QPixmap *alpha = pixmap.data->alphapm; ! if (rendhd && pixmap.x11RenderHandle() && alpha && alpha->x11RenderHandle()) { // this is essentially drawTile() from above, inlined for // the XRenderComposite call int yPos, xPos, drawH, drawW, yOff, xOff; --- 2835,2845 ---- #ifndef QT_NO_XRENDER QPixmap *alpha = pixmap.data->alphapm; ! Picture rend_pict; ! if (rendhd && (rend_pict = XftDrawPicture ((XftDraw *) rendhd)) && ! pixmap.x11RenderHandle() && ! alpha && alpha->x11RenderHandle()) ! { // this is essentially drawTile() from above, inlined for // the XRenderComposite call int yPos, xPos, drawH, drawW, yOff, xOff; *************** *** 2826,2833 **** drawW = pixmap.width() - xOff; // Cropping first column if ( xPos + drawW > x + w ) // Cropping last column drawW = x + w - xPos; ! XRenderComposite(dpy, PictOpOver, pixmap.x11RenderHandle(), ! alpha->x11RenderHandle(), rendhd, xOff, yOff, xOff, yOff, xPos, yPos, drawW, drawH); xPos += drawW; xOff = 0; --- 2855,2863 ---- drawW = pixmap.width() - xOff; // Cropping first column if ( xPos + drawW > x + w ) // Cropping last column drawW = x + w - xPos; ! XRenderComposite(dpy, PictOpOver, ! pixmap.x11RenderHandle (), ! alpha->x11RenderHandle (), rend_pict, xOff, yOff, xOff, yOff, xPos, yPos, drawW, drawH); xPos += drawW; xOff = 0; diff -cr qt-copy/src/kernel/qpixmap_x11.cpp qt-keithp/src/kernel/qpixmap_x11.cpp *** qt-copy/src/kernel/qpixmap_x11.cpp 2002-04-26 13:55:36.000000000 -0700 --- qt-keithp/src/kernel/qpixmap_x11.cpp 2002-05-23 22:41:53.000000000 -0700 *************** *** 334,362 **** hd = (HANDLE)XCreatePixmap( x11Display(), RootWindow(x11Display(), x11Screen() ), w, h, data->d ); ! #ifndef QT_NO_XRENDER ! if (qt_use_xrender) { ! XRenderPictFormat *format = 0; ! XRenderPictFormat req; ! ulong mask = PictFormatType | PictFormatDepth; ! ! req.type = PictTypeDirect; ! req.depth = data->d; ! ! if (data->d == 1) { ! req.direct.alpha = 0; ! req.direct.alphaMask = 1; ! mask |= PictFormatAlpha | PictFormatAlphaMask; ! } else { ! format = XRenderFindVisualFormat(x11Display(), (Visual *) x11Visual()); ! } ! ! if (! format) ! format = XRenderFindFormat(x11Display(), mask, &req, 0); ! if (format) ! rendhd = XRenderCreatePicture(x11Display(), hd, format, 0, 0); } ! #endif // QT_NO_XRENDER } --- 334,348 ---- hd = (HANDLE)XCreatePixmap( x11Display(), RootWindow(x11Display(), x11Screen() ), w, h, data->d ); ! #ifndef QT_NO_XFTFREETYPE ! if (data->d == 1) { ! rendhd = (HANDLE) XftDrawCreateBitmap (x11Display(), hd); ! } else { ! rendhd = (HANDLE) XftDrawCreate (x11Display(), hd, ! (Visual *) x11Visual(), ! x11Colormap()); } ! #endif // QT_NO_XFTFREETYPE } *************** *** 372,383 **** XFreeGC( x11Display(), (GC)data->maskgc ); if ( qApp && hd) { ! #ifndef QT_NO_XRENDER if (rendhd) { ! XRenderFreePicture(x11Display(), rendhd); rendhd = 0; } ! #endif // QT_NO_XRENDER XFreePixmap( x11Display(), hd ); hd = 0; --- 358,369 ---- XFreeGC( x11Display(), (GC)data->maskgc ); if ( qApp && hd) { ! #ifndef QT_NO_XFTFREETYPE if (rendhd) { ! XftDrawDestroy((XftDraw *) rendhd); rendhd = 0; } ! #endif // QT_NO_XFTFREETYPE XFreePixmap( x11Display(), hd ); hd = 0; *************** *** 416,437 **** RootWindow(x11Display(), x11Screen() ), (char *)bits, w, h ); ! #ifndef QT_NO_XRENDER ! if (qt_use_xrender) { ! XRenderPictFormat *format; ! XRenderPictFormat req; ! ! req.type = PictTypeDirect; ! req.depth = 1; ! req.direct.alpha = 0; ! req.direct.alphaMask = 1; ! format = XRenderFindFormat(x11Display(), ! (PictFormatType | PictFormatDepth | ! PictFormatAlpha | PictFormatAlphaMask), ! &req, 0); ! if (format) ! rendhd = (HANDLE) XRenderCreatePicture(x11Display(), hd, format, 0, 0); ! } #endif // QT_NO_XRENDER if ( flipped_bits ) // Avoid purify complaint --- 402,409 ---- RootWindow(x11Display(), x11Screen() ), (char *)bits, w, h ); ! #ifndef QT_NO_XFTFREETYPE ! rendhd = (HANDLE) XftDrawCreateBitmap (x11Display (), hd); #endif // QT_NO_XRENDER if ( flipped_bits ) // Avoid purify complaint *************** *** 1013,1024 **** if ( d == 1 ) { // 1 bit pixmap (bitmap) if ( hd ) { // delete old X pixmap ! #ifndef QT_NO_XRENDER if (rendhd) { ! XRenderFreePicture(x11Display(), rendhd); rendhd = 0; } ! #endif // QT_NO_XRENDER XFreePixmap( x11Display(), hd ); } --- 985,996 ---- if ( d == 1 ) { // 1 bit pixmap (bitmap) if ( hd ) { // delete old X pixmap ! #ifndef QT_NO_XFTFREETYPE if (rendhd) { ! XftDrawDestroy ((XftDraw *) rendhd); rendhd = 0; } ! #endif // QT_NO_XFTFREETYPE XFreePixmap( x11Display(), hd ); } *************** *** 1067,1089 **** RootWindow(x11Display(), x11Screen() ), bits, w, h ); ! #ifndef QT_NO_XRENDER ! if (qt_use_xrender) { ! XRenderPictFormat *format; ! XRenderPictFormat req; ! ! req.type = PictTypeDirect; ! req.depth = 1; ! req.direct.alpha = 0; ! req.direct.alphaMask = 1; ! format = XRenderFindFormat(x11Display(), ! (PictFormatType | PictFormatDepth | ! PictFormatAlpha | PictFormatAlphaMask), ! &req, 0); ! if (format) ! rendhd = (HANDLE) XRenderCreatePicture(x11Display(), hd, format, 0, 0); ! } ! #endif // QT_NO_XRENDER if ( tmp_bits ) // Avoid purify complaint delete [] tmp_bits; --- 1039,1047 ---- RootWindow(x11Display(), x11Screen() ), bits, w, h ); ! #ifndef QT_NO_XFTFREETYPE ! rendhd = (HANDLE) XftDrawCreateBitmap (x11Display (), hd); ! #endif // QT_NO_XFTFREETYPE if ( tmp_bits ) // Avoid purify complaint delete [] tmp_bits; *************** *** 1484,1495 **** if ( hd && (width() != w || height() != h || this->depth() != dd) ) { ! #ifndef QT_NO_XRENDER if (rendhd) { ! XRenderFreePicture(x11Display(), rendhd); rendhd = 0; } ! #endif // QT_NO_XRENDER XFreePixmap( dpy, hd ); // don't reuse old pixmap hd = 0; --- 1442,1453 ---- if ( hd && (width() != w || height() != h || this->depth() != dd) ) { ! #ifndef QT_NO_XFTFREETYPE if (rendhd) { ! XftDrawDestroy ((XftDraw *) rendhd); rendhd = 0; } ! #endif // QT_NO_XFTFREETYPE XFreePixmap( dpy, hd ); // don't reuse old pixmap hd = 0; *************** *** 1499,1527 **** RootWindow(x11Display(), x11Screen() ), w, h, dd ); ! #ifndef QT_NO_XRENDER ! if (qt_use_xrender) { ! XRenderPictFormat *format = 0; ! XRenderPictFormat req; ! ulong mask = PictFormatType | PictFormatDepth; ! ! req.type = PictTypeDirect; ! req.depth = data->d; ! ! if (data->d == 1) { ! req.direct.alpha = 0; ! req.direct.alphaMask = 1; ! mask |= PictFormatAlpha | PictFormatAlphaMask; ! } else { ! format = XRenderFindVisualFormat(x11Display(), (Visual *) x11Visual()); ! } ! ! if (! format) ! format = XRenderFindFormat(x11Display(), mask, &req, 0); ! if (format) ! rendhd = XRenderCreatePicture(x11Display(), hd, format, 0, 0); ! } ! #endif // QT_NO_XRENDER } --- 1457,1469 ---- RootWindow(x11Display(), x11Screen() ), w, h, dd ); ! #ifndef QT_NO_XFTFREETYPE ! if (data->d == 1) ! rendhd = (HANDLE) XftDrawCreateBitmap (x11Display (), hd); ! else ! rendhd = (HANDLE) XftDrawCreate (x11Display (), hd, ! (Visual *) x11Visual (), x11Colormap ()); ! #endif // QT_NO_XFTFREETYPE } *************** *** 1543,1548 **** --- 1485,1491 ---- m = img.createAlphaMask( conversion_flags ); setMask( m ); + #ifdef QT_XFT2 #ifndef QT_NO_XRENDER // ### only support 32bit images at the moment if (qt_use_xrender && img.depth() == 32) { *************** *** 1558,1573 **** XCreatePixmap(x11Display(), RootWindow(x11Display(), x11Screen()), w, h, 8); ! XRenderPictFormat *format = 0; ! XRenderPictFormat req; ! ulong mask = PictFormatType | PictFormatDepth | PictFormatAlphaMask; ! req.type = PictTypeDirect; ! req.depth = 8; ! req.direct.alphaMask = 0xff; ! format = XRenderFindFormat(x11Display(), mask, &req, 0); ! if (format) ! data->alphapm->rendhd = ! XRenderCreatePicture(x11Display(), data->alphapm->hd, format, 0, 0); XImage *axi = XCreateImage(x11Display(), (Visual *) x11Visual(), 8, ZPixmap, 0, 0, w, h, 8, 0); --- 1501,1509 ---- XCreatePixmap(x11Display(), RootWindow(x11Display(), x11Screen()), w, h, 8); ! data->alphapm->rendhd = (HANDLE) XftDrawCreateAlpha (x11Display (), ! data->alphapm->hd, ! 8); XImage *axi = XCreateImage(x11Display(), (Visual *) x11Visual(), 8, ZPixmap, 0, 0, w, h, 8, 0); *************** *** 1590,1595 **** --- 1526,1532 ---- } } #endif // QT_NO_XRENDER + #endif } return TRUE; *************** *** 1837,1842 **** --- 1774,1780 ---- } #endif + #ifdef QT_XFT2 #ifndef QT_NO_XRENDER if ( qt_use_xrender && data->alphapm ) { // xform the alpha channel XImage *axi = 0; *************** *** 1870,1886 **** RootWindow(x11Display(), x11Screen()), w, h, 8); ! XRenderPictFormat *format = 0; ! XRenderPictFormat req; ! ulong mask = PictFormatType | PictFormatDepth | PictFormatAlphaMask; ! req.type = PictTypeDirect; ! req.depth = 8; ! req.direct.alphaMask = 0xff; ! format = XRenderFindFormat(x11Display(), mask, &req, 0); ! if (format) ! pm.data->alphapm->rendhd = ! XRenderCreatePicture(x11Display(), pm.data->alphapm->hd, ! format, 0, 0); XImage *axi2 = XCreateImage(x11Display(), (Visual *) x11Visual(), 8, ZPixmap, 0, (char *)dptr, w, h, 8, 0); --- 1808,1816 ---- RootWindow(x11Display(), x11Screen()), w, h, 8); ! pm.data->alphapm->rendhd = (HANDLE) XftDrawCreateAlpha(x11Display(), ! pm.data->alphapm->hd, ! 8); XImage *axi2 = XCreateImage(x11Display(), (Visual *) x11Visual(), 8, ZPixmap, 0, (char *)dptr, w, h, 8, 0); *************** *** 1897,1902 **** --- 1827,1833 ---- } } #endif + #endif if ( data->mask ) // xform mask, too pm.setMask( data->mask->xForm(matrix) ); *************** *** 2009,2026 **** XCreatePixmap(dst->x11Display(), RootWindow(dst->x11Display(), dst->x11Screen()), dst->width(), dst->height(), 8); ! ! XRenderPictFormat *format = 0; ! XRenderPictFormat req; ! ulong mask = PictFormatType | PictFormatDepth | PictFormatAlphaMask; ! req.type = PictTypeDirect; ! req.depth = 8; ! req.direct.alphaMask = 0xff; ! format = XRenderFindFormat(dst->x11Display(), mask, &req, 0); ! if (format) ! dst->data->alphapm->rendhd = ! XRenderCreatePicture(dst->x11Display(), dst->data->alphapm->hd, ! format, 0, 0); } if (sw < 0) --- 1940,1949 ---- XCreatePixmap(dst->x11Display(), RootWindow(dst->x11Display(), dst->x11Screen()), dst->width(), dst->height(), 8); ! dst->data->alphapm->rendhd = ! (unsigned long) XftDrawCreateAlpha (dst->x11Display(), ! dst->data->alphapm->hd, ! 8); } if (sw < 0) diff -cr qt-copy/src/kernel/qt_x11.h qt-keithp/src/kernel/qt_x11.h *** qt-copy/src/kernel/qt_x11.h 2002-03-15 11:31:52.000000000 -0800 --- qt-keithp/src/kernel/qt_x11.h 2002-05-23 22:22:32.000000000 -0700 *************** *** 138,154 **** // #define QT_NO_XRENDER #ifndef QT_NO_XRENDER # include ! // #define QT_NO_XFTFREETYPE ! # ifndef QT_NO_XFTFREETYPE ! # include ! # endif // QT_NO_XFTFREETYPE ! #else ! // make sure QT_NO_XFTTREETYPE is defined if QT_NO_XRENDER is defined ! # ifndef QT_NO_XFTFREETYPE ! # define QT_NO_XFTFREETYPE ! # endif ! #endif // QT_NO_XRENDER #ifndef QT_NO_XKB # include --- 138,151 ---- // #define QT_NO_XRENDER #ifndef QT_NO_XRENDER # include ! #endif + #ifndef QT_NO_XFTFREETYPE + # include + #if defined(XFT_VERSION) && XFT_VERSION >= 20000 + #define QT_XFT2 + #endif + #endif // QT_NO_XFTFREETYPE #ifndef QT_NO_XKB # include diff -cr qt-copy/src/kernel/qwidget_x11.cpp qt-keithp/src/kernel/qwidget_x11.cpp *** qt-copy/src/kernel/qwidget_x11.cpp 2002-04-26 13:55:37.000000000 -0700 --- qt-keithp/src/kernel/qwidget_x11.cpp 2002-05-23 23:37:48.000000000 -0700 *************** *** 321,338 **** setWinId( id ); // set widget id/handle + hd } ! #ifndef QT_NO_XRENDER if (rendhd) { ! XRenderFreePicture(dpy, rendhd); rendhd = 0; } ! if (qt_use_xrender) { ! XRenderPictFormat *format = XRenderFindVisualFormat(dpy, (Visual *) x11Visual()); ! if (format) ! rendhd = XRenderCreatePicture(dpy, id, format, 0, 0); ! } ! #endif // QT_NO_XRENDER // NET window types long net_wintypes[4] = { 0, 0, 0, 0 }; --- 321,334 ---- setWinId( id ); // set widget id/handle + hd } ! #ifndef QT_NO_XFTFREETYPE if (rendhd) { ! XftDrawDestroy ((XftDraw *) rendhd); rendhd = 0; } ! rendhd = (HANDLE) XftDrawCreate (dpy, id, (Visual *) x11Visual (), x11Colormap ()); ! #endif // QT_NO_XFTFREETYPE // NET window types long net_wintypes[4] = { 0, 0, 0, 0 }; *************** *** 597,603 **** #ifndef QT_NO_XRENDER if (rendhd) { ! XRenderFreePicture(x11Display(), rendhd); rendhd = 0; } #endif // QT_NO_XRENDER --- 593,599 ---- #ifndef QT_NO_XRENDER if (rendhd) { ! XftDrawDestroy ((XftDraw *) rendhd); rendhd = 0; } #endif // QT_NO_XRENDER