winex11: Add a SelectFont entry point in the XRender driver.

This commit is contained in:
Alexandre Julliard 2011-09-12 11:50:42 +02:00
parent 225d8abec9
commit cbfcce1a3d
3 changed files with 20 additions and 29 deletions

View File

@ -303,7 +303,6 @@ extern int client_side_antialias_with_render DECLSPEC_HIDDEN;
extern int using_client_side_fonts DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN;
extern void X11DRV_XRender_Finalize(void) DECLSPEC_HIDDEN;
extern BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE*, HFONT) DECLSPEC_HIDDEN;
extern void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *data) DECLSPEC_HIDDEN;
extern void X11DRV_XRender_CopyBrush(X11DRV_PDEVICE *physDev, X_PHYSBITMAP *physBitmap, int width, int height) DECLSPEC_HIDDEN;
extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,

View File

@ -3238,12 +3238,6 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
TRACE("gdiFont = %p\n", gdiFont);
if(gdiFont && using_client_side_fonts) {
X11DRV_XRender_SelectFont(physDev, hfont);
physDev->has_gdi_font = TRUE;
return FALSE;
}
EnterCriticalSection( &crtsc_fonts_X11 );
if(fontList == NULL) X11DRV_FONT_InitX11Metrics();

View File

@ -1091,24 +1091,30 @@ void X11DRV_XRender_Finalize(void)
LeaveCriticalSection(&xrender_cs);
}
/***********************************************************************
* X11DRV_XRender_SelectFont
/**********************************************************************
* xrenderdrv_SelectFont
*/
BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
static HFONT xrenderdrv_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
{
struct xrender_physdev *physdev = get_xrender_dev( dev );
LFANDSIZE lfsz;
struct xrender_info *info;
GetObjectW(hfont, sizeof(lfsz.lf), &lfsz.lf);
if (!GetObjectW( hfont, sizeof(lfsz.lf), &lfsz.lf )) return HGDI_ERROR;
if (!gdiFont)
{
dev = GET_NEXT_PHYSDEV( dev, pSelectFont );
return dev->funcs->pSelectFont( dev, hfont, gdiFont );
}
TRACE("h=%d w=%d weight=%d it=%d charset=%d name=%s\n",
lfsz.lf.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight,
lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName));
lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth );
lfsz.devsize.cx = X11DRV_XWStoDS( physDev, lfsz.lf.lfWidth );
lfsz.devsize.cy = X11DRV_YWStoDS( physDev, lfsz.lf.lfHeight );
lfsz.devsize.cx = X11DRV_XWStoDS( physdev->x11dev, lfsz.lf.lfWidth );
lfsz.devsize.cy = X11DRV_YWStoDS( physdev->x11dev, lfsz.lf.lfHeight );
GetTransform( physDev->dev.hdc, 0x204, &lfsz.xform );
GetTransform( dev->hdc, 0x204, &lfsz.xform );
TRACE("font transform %f %f %f %f\n", lfsz.xform.eM11, lfsz.xform.eM12,
lfsz.xform.eM21, lfsz.xform.eM22);
@ -1117,14 +1123,12 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
lfsz_calc_hash(&lfsz);
info = get_xrender_info(physDev);
if (!info) return 0;
EnterCriticalSection(&xrender_cs);
if(info->cache_index != -1)
dec_ref_cache(info->cache_index);
info->cache_index = GetCacheEntry(physDev, &lfsz);
if (physdev->info.cache_index != -1)
dec_ref_cache( physdev->info.cache_index );
physdev->info.cache_index = GetCacheEntry( physdev->x11dev, &lfsz );
LeaveCriticalSection(&xrender_cs);
physdev->x11dev->has_gdi_font = TRUE;
return 0;
}
@ -2608,7 +2612,7 @@ static const struct gdi_dc_funcs xrender_funcs =
xrenderdrv_SelectBitmap, /* pSelectBitmap */
NULL, /* pSelectBrush */
NULL, /* pSelectClipPath */
NULL, /* pSelectFont */
xrenderdrv_SelectFont, /* pSelectFont */
NULL, /* pSelectPalette */
NULL, /* pSelectPen */
NULL, /* pSetArcDirection */
@ -2662,12 +2666,6 @@ void X11DRV_XRender_Finalize(void)
{
}
BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
{
assert(0);
return FALSE;
}
void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *data)
{
assert(0);