Commit cbfcce1a authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 225d8abe
...@@ -303,7 +303,6 @@ extern int client_side_antialias_with_render DECLSPEC_HIDDEN; ...@@ -303,7 +303,6 @@ extern int client_side_antialias_with_render DECLSPEC_HIDDEN;
extern int using_client_side_fonts DECLSPEC_HIDDEN; extern int using_client_side_fonts DECLSPEC_HIDDEN;
extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN;
extern void X11DRV_XRender_Finalize(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_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 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, extern BOOL X11DRV_XRender_ExtTextOut(X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags,
......
...@@ -3238,12 +3238,6 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) ...@@ -3238,12 +3238,6 @@ HFONT X11DRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont )
TRACE("gdiFont = %p\n", 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 ); EnterCriticalSection( &crtsc_fonts_X11 );
if(fontList == NULL) X11DRV_FONT_InitX11Metrics(); if(fontList == NULL) X11DRV_FONT_InitX11Metrics();
......
...@@ -1091,24 +1091,30 @@ void X11DRV_XRender_Finalize(void) ...@@ -1091,24 +1091,30 @@ void X11DRV_XRender_Finalize(void)
LeaveCriticalSection(&xrender_cs); LeaveCriticalSection(&xrender_cs);
} }
/**********************************************************************
/*********************************************************************** * xrenderdrv_SelectFont
* X11DRV_XRender_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; 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", 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.lfHeight, lfsz.lf.lfWidth, lfsz.lf.lfWeight,
lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName)); lfsz.lf.lfItalic, lfsz.lf.lfCharSet, debugstr_w(lfsz.lf.lfFaceName));
lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth ); lfsz.lf.lfWidth = abs( lfsz.lf.lfWidth );
lfsz.devsize.cx = X11DRV_XWStoDS( physDev, lfsz.lf.lfWidth ); lfsz.devsize.cx = X11DRV_XWStoDS( physdev->x11dev, lfsz.lf.lfWidth );
lfsz.devsize.cy = X11DRV_YWStoDS( physDev, lfsz.lf.lfHeight ); 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, TRACE("font transform %f %f %f %f\n", lfsz.xform.eM11, lfsz.xform.eM12,
lfsz.xform.eM21, lfsz.xform.eM22); lfsz.xform.eM21, lfsz.xform.eM22);
...@@ -1117,14 +1123,12 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont) ...@@ -1117,14 +1123,12 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
lfsz_calc_hash(&lfsz); lfsz_calc_hash(&lfsz);
info = get_xrender_info(physDev);
if (!info) return 0;
EnterCriticalSection(&xrender_cs); EnterCriticalSection(&xrender_cs);
if(info->cache_index != -1) if (physdev->info.cache_index != -1)
dec_ref_cache(info->cache_index); dec_ref_cache( physdev->info.cache_index );
info->cache_index = GetCacheEntry(physDev, &lfsz); physdev->info.cache_index = GetCacheEntry( physdev->x11dev, &lfsz );
LeaveCriticalSection(&xrender_cs); LeaveCriticalSection(&xrender_cs);
physdev->x11dev->has_gdi_font = TRUE;
return 0; return 0;
} }
...@@ -2608,7 +2612,7 @@ static const struct gdi_dc_funcs xrender_funcs = ...@@ -2608,7 +2612,7 @@ static const struct gdi_dc_funcs xrender_funcs =
xrenderdrv_SelectBitmap, /* pSelectBitmap */ xrenderdrv_SelectBitmap, /* pSelectBitmap */
NULL, /* pSelectBrush */ NULL, /* pSelectBrush */
NULL, /* pSelectClipPath */ NULL, /* pSelectClipPath */
NULL, /* pSelectFont */ xrenderdrv_SelectFont, /* pSelectFont */
NULL, /* pSelectPalette */ NULL, /* pSelectPalette */
NULL, /* pSelectPen */ NULL, /* pSelectPen */
NULL, /* pSetArcDirection */ NULL, /* pSetArcDirection */
...@@ -2662,12 +2666,6 @@ void X11DRV_XRender_Finalize(void) ...@@ -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) void X11DRV_XRender_SetDeviceClipping(X11DRV_PDEVICE *physDev, const RGNDATA *data)
{ {
assert(0); assert(0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment