mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-25 13:40:24 +01:00
glx: Fix glxUseXFont for glxWindow and glxPixmaps
The current implementation of glxUseXFont requires creating
a temporary pixmap and graphics context, which requires a real
old-school X11 Window, not a glxDrawable. This patch changes
things so that glxUseXFont will also accept a glxWindow or
glxPixmap, and lookup the underlying X11 Drawable. Without
this patch glxUseXFont generates a giant stream of Xerrors
about bad drawables and bad graphics contexts.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54372
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 291be28476)
This commit is contained in:
parent
13a4fd2430
commit
4f33ded115
1 changed files with 5 additions and 0 deletions
|
|
@ -221,6 +221,7 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
|
|||
XGCValues values;
|
||||
unsigned long valuemask;
|
||||
XFontStruct *fs;
|
||||
__GLXDRIdrawable *glxdraw;
|
||||
|
||||
GLint swapbytes, lsbfirst, rowlength;
|
||||
GLint skiprows, skippixels, alignment;
|
||||
|
|
@ -233,6 +234,10 @@ DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int lis
|
|||
dpy = CC->currentDpy;
|
||||
win = CC->currentDrawable;
|
||||
|
||||
glxdraw = GetGLXDRIDrawable(CC->currentDpy, CC->currentDrawable);
|
||||
if (glxdraw)
|
||||
win = glxdraw->xDrawable;
|
||||
|
||||
fs = XQueryFont(dpy, font);
|
||||
if (!fs) {
|
||||
__glXSetError(CC, GL_INVALID_VALUE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue