1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
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
Index: vcl/prj/build.lst
===================================================================
RCS file: /cvs/gsl/vcl/prj/build.lst,v
retrieving revision 1.20.60.3
diff -u -p -u -r1.20.60.3 build.lst
--- vcl/prj/build.lst 24 Jun 2005 15:12:55 -0000 1.20.60.3
+++ vcl/prj/build.lst 30 Aug 2005 15:13:24 -0000
@@ -1,4 +1,4 @@
-vc vcl : boost nas freetype psprint rsc sot ucbhelper unotools rvpapi icu i18npool unoil ridljar x11_extensions sndfile portaudio gtk offuh basegfx NULL
+vc vcl : boost nas freetype psprint rsc sot ucbhelper unotools rvpapi icu i18npool unoil ridljar X11_EXTENSIONS:x11_extensions sndfile portaudio gtk offuh basegfx NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\source\unotypes nmake - all vc_unot NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_unot NULL
|