Introduce dixLookupFontable for "FONT or GC" parameters.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Jamey Sharp 2010-05-06 11:00:37 -07:00 • committed by Keith Packard
commit 35761d5f81
5 changed files with 33 additions and 48 deletions

View file

@ -155,7 +155,6 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
ClientPtr client = cl->client;
xGLXUseXFontReq *req;
FontPtr pFont;
GC *pGC;
GLuint currentListIndex;
__GLXcontext *cx;
int error;
@ -181,19 +180,9 @@ int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
** containing a font.
*/
error = dixLookupResourceByType((pointer *)&pFont,
req->font, RT_FONT,
client, DixReadAccess);
if (error != Success) {
error = dixLookupResourceByType((pointer *)&pGC,
req->font, RT_GC,
client, DixReadAccess);
if (error != Success) {
client->errorValue = req->font;
return error == BadGC ? BadFont : error;
}
pFont = pGC->font;
}
error = dixLookupFontable(&pFont, req->font, client, DixReadAccess);
if (error != Success)
return error;
return MakeBitmapsFromFont(pFont, req->first, req->count,
req->listBase);