Репозитории ALT
5.1: | 3.2.0.7-alt0.M51.1 |
4.1: | 3.0.0.10-alt1.M41.1 |
4.0: | 2.4.1.7-alt0.M40.1 |
3.0: | 1.1.5-alt1 |
Группа :: Офис
Пакет: openoffice.org
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: system-xrender.diff
Скачать
Скачать
Index: unx/source/gdi/gcach_xpeer.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/gcach_xpeer.cxx,v
retrieving revision 1.32.18.1
diff -u -u -r1.32.18.1 gcach_xpeer.cxx
--- vcl/unx/source/gdi/gcach_xpeer.cxx 9 Jan 2004 18:14:01 -0000 1.32.18.1
+++ vcl/unx/source/gdi/gcach_xpeer.cxx 5 May 2004 00:49:04 -0000
@@ -126,6 +126,7 @@
if( !XQueryExtension( mpDisplay, "RENDER", &nDummy, &nDummy, &nDummy ) )
return;
+#ifndef SYSTEM_XRENDER
// we don't know if we are running on a system with xrender library
// we don't want to install system libraries ourselves
// => load them dynamically when they are there
@@ -203,24 +204,42 @@
pFunc=osl_getSymbol(pRenderLib, freePicFuncName.pData);
if( !pFunc ) return;
pXRenderFreePicture = (void(*)(Display*,Picture))pFunc;
+#endif
// needed to initialize libXrender internals, we already know its there
+#ifdef SYSTEM_XRENDER
+ XRenderQueryExtension( mpDisplay, &nDummy, &nDummy );
+#else
(*pXRenderQueryExtension)( mpDisplay, &nDummy, &nDummy );
+#endif
int nMajor, nMinor;
+#ifdef SYSTEM_XRENDER
+ XRenderQueryVersion( mpDisplay, &nMajor, &nMinor );
+#else
(*pXRenderQueryVersion)( mpDisplay, &nMajor, &nMinor );
+#endif
nRenderVersion = 16*nMajor + nMinor;
// TODO: enable/disable things depending on version
// the 8bit alpha mask format must be there
XRenderPictFormat aPictFormat={0,0,8,{0,0,0,0,0,0,0,0xFF},0};
+#ifdef SYSTEM_XRENDER
+ mpGlyphFormat = XRenderFindFormat ( mpDisplay,
+ PictFormatAlphaMask|PictFormatDepth, &aPictFormat, 0 );
+#else
mpGlyphFormat = (*pXRenderFindFormat)( mpDisplay,
PictFormatAlphaMask|PictFormatDepth, &aPictFormat, 0 );
+#endif
if( mpGlyphFormat != NULL )
{
// and the visual must be supported too
+#ifdef SYSTEM_XRENDER
+ XRenderPictFormat* pVisualFormat = XRenderFindVisualFormat ( mpDisplay, _pVisual);
+#else
XRenderPictFormat* pVisualFormat = (*pXRenderFindVisualFormat)( mpDisplay, _pVisual );
+#endif
if( pVisualFormat != NULL )
mbUsingXRender = true;
}
@@ -249,7 +268,11 @@
break;
case XRENDER_KIND:
+#ifdef SYSTEM_XRENDER
+ XRenderFreeGlyphSet( mpDisplay,(GlyphSet)rServerFont.GetExtPointer() );
+#else
(*pXRenderFreeGlyphSet)( mpDisplay,(GlyphSet)rServerFont.GetExtPointer() );
+#endif
break;
}
@@ -350,7 +377,11 @@
int nHeight = rServerFont.GetFontSelData().mnHeight;
if( nHeight<250 && rServerFont.GetAntialiasAdvice() )
{
+#ifdef SYSTEM_XRENDER
+ aGlyphSet = XRenderCreateGlyphSet ( mpDisplay, mpGlyphFormat );
+#else
aGlyphSet = (*pXRenderCreateGlyphSet)( mpDisplay, mpGlyphFormat );
+#endif
rServerFont.SetExtended( XRENDER_KIND, (void*)aGlyphSet );
}
else
@@ -514,8 +545,13 @@
aGlyphId = nGlyphIndex & 0x00FFFFFF;
const ULONG nBytes = maRawBitmap.mnScanlineSize * maRawBitmap.mnHeight;
+#ifdef SYSTEM_XRENDER
+ XRenderAddGlyphs ( mpDisplay, aGlyphSet, &aGlyphId, &aGlyphInfo, 1,
+ (char*)maRawBitmap.mpBits, nBytes );
+#else
(*pXRenderAddGlyphs)( mpDisplay, aGlyphSet, &aGlyphId, &aGlyphInfo, 1,
(char*)maRawBitmap.mpBits, nBytes );
+#endif
mnBytesUsed += nBytes;
}
else
Index: unx/source/gdi/gcach_xpeer.hxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/gcach_xpeer.hxx,v
retrieving revision 1.7
diff -u -u -r1.7 gcach_xpeer.hxx
--- vcl/unx/source/gdi/gcach_xpeer.hxx 28 Apr 2003 17:10:05 -0000 1.7
+++ vcl/unx/source/gdi/gcach_xpeer.hxx 5 May 2004 00:49:04 -0000
@@ -97,6 +97,7 @@
bool mbUsingXRender;
XRenderPictFormat* mpGlyphFormat;
+#ifndef SYSTEM_XRENDER
public:
XRenderPictFormat* (*pXRenderFindFormat)(Display*,unsigned long,XRenderPictFormat*,int);
XRenderPictFormat* (*pXRenderFindVisualFormat)(Display*,Visual*);
@@ -110,6 +111,7 @@
Picture (*pXRenderCreatePicture)(Display*,Drawable,XRenderPictFormat*,unsigned long,XRenderPictureAttributes*);
void (*pXRenderSetPictureClipRegion)(Display*,Picture,XLIB_Region);
void (*pXRenderFreePicture)(Display*,Picture);
+#endif
};
#endif // _SV_GCACH_XPEER_HXX
Index: unx/source/gdi/salgdi3.cxx
===================================================================
RCS file: /cvs/gsl/vcl/unx/source/gdi/salgdi3.cxx,v
retrieving revision 1.105.46.5
diff -u -u -r1.105.46.5 salgdi3.cxx
--- vcl/unx/source/gdi/salgdi3.cxx 13 Feb 2004 14:03:54 -0000 1.105.46.5
+++ vcl/unx/source/gdi/salgdi3.cxx 5 May 2004 00:49:05 -0000
@@ -839,7 +839,11 @@
{
Display* pDisplay = GetXDisplay();
Visual* pVisual = GetDisplay()->GetVisual()->GetVisual();
+#ifdef SYSTEM_XRENDER
+ XRenderPictFormat* pVisualFormat = XRenderFindVisualFormat ( pDisplay, pVisual );
+#else
XRenderPictFormat* pVisualFormat = (*aX11GlyphPeer.pXRenderFindVisualFormat)( pDisplay, pVisual );
+#endif
// create xrender Picture for font foreground
static Pixmap aPixmap;
@@ -855,7 +859,11 @@
XRenderPictureAttributes aAttr;
aAttr.repeat = true;
+#ifdef SYSTEM_XRENDER
+ aSrc = XRenderCreatePicture ( pDisplay, aPixmap, pVisualFormat, CPRepeat, &aAttr );
+#else
aSrc = (*aX11GlyphPeer.pXRenderCreatePicture)( pDisplay, aPixmap, pVisualFormat, CPRepeat, &aAttr );
+#endif
}
// set font foreground
@@ -869,10 +877,19 @@
// notify xrender of target drawable
XRenderPictureAttributes aAttr;
+#ifdef SYSTEM_XRENDER
+ Picture aDst = XRenderCreatePicture ( pDisplay, hDrawable_, pVisualFormat, 0, &aAttr );
+#else
Picture aDst = (*aX11GlyphPeer.pXRenderCreatePicture)( pDisplay, hDrawable_, pVisualFormat, 0, &aAttr );
+#endif
+
// set clipping
if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) )
+#ifdef SYSTEM_XRENDER
+ XRenderSetPictureClipRegion( pDisplay, aDst, pClipRegion_ );
+#else
(*aX11GlyphPeer.pXRenderSetPictureClipRegion)( pDisplay, aDst, pClipRegion_ );
+#endif
ServerFont& rFont = rLayout.GetServerFont();
GlyphSet aGlyphSet = aX11GlyphPeer.GetGlyphSet( rFont );
@@ -890,12 +907,21 @@
unsigned int aRenderAry[ MAXGLYPHS ];
for( int i = 0; i < nGlyphs; ++i )
aRenderAry[ i ] = aX11GlyphPeer.GetGlyphId( rFont, aGlyphAry[i] );
+#ifdef SYSTEM_XRENDER
+ XRenderCompositeString32 ( pDisplay, PictOpOver,
+ aSrc, aDst, 0, aGlyphSet, 0, 0, aPos.X(), aPos.Y(), aRenderAry, nGlyphs );
+#else
(*aX11GlyphPeer.pXRenderCompositeString32)( pDisplay, PictOpOver,
aSrc, aDst, 0, aGlyphSet, 0, 0, aPos.X(), aPos.Y(), aRenderAry, nGlyphs );
+#endif
}
// cleanup
+#ifdef SYSTEM_XRENDER
+ XRenderFreePicture ( pDisplay, aDst );
+#else
(*aX11GlyphPeer.pXRenderFreePicture)( pDisplay, aDst );
+#endif
}
//--------------------------------------------------------------------------
Index: util/makefile.mk
===================================================================
RCS file: /cvs/gsl/vcl/util/makefile.mk,v
retrieving revision 1.47.10.2
diff -u -u -r1.47.10.2 makefile.mk
--- vcl/util/makefile.mk 3 Mar 2004 14:33:18 -0000 1.47.10.2
+++ vcl/util/makefile.mk 5 May 2004 00:49:05 -0000
@@ -217,6 +217,9 @@
.IF "$(USE_BUILTIN_RASTERIZER)"!=""
LIB1FILES += $(SLB)$/glyphs.lib
SHL1STDLIBS+= $(FREETYPELIB)
+.IF "$(SYSTEM_XRENDER)" == "YES"
+ SHL1STDLIBS+= -lXrender
+.ENDIF
.ENDIF # USE_BUILTIN_RASTERIZER
--- vcl/unx/source/gdi/makefile.mk.orig 2004-05-08 17:22:47.000000000 +0200
+++ vcl/unx/source/gdi/makefile.mk 2004-05-08 17:23:26.000000000 +0200
@@ -111,6 +111,10 @@
ENVCFLAGS+=-DUSE_CDE
.ENDIF
+.IF "$(SYSTEM_XRENDER)" == "YES"
+CFLAGS+=-DSYSTEM_XRENDER
+.ENDIF
+
.IF "$(USE_BUILTIN_RASTERIZER)" != ""
SLOFILES+= $(SLO)$/gcach_xpeer.obj
.ENDIF