Mesa (10.3): glx: Fix glxUseXFont for glxWindow and glxPixmaps

Emil Velikov evelikov at kemper.freedesktop.org
Sun Oct 19 18:08:09 UTC 2014


Module: Mesa
Branch: 10.3
Commit: 4f33ded115bb01f6417d12e2b8eadc7b86f24f96
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f33ded115bb01f6417d12e2b8eadc7b86f24f96

Author: Daniel Manjarres <danmanj at gmail.com>
Date:   Sun Jun 22 09:47:58 2014 -0700

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 at lists.freedesktop.org
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit 291be28476ea60c6fb1eb2a882e2e25def5d3735)

---

 src/glx/xfont.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/glx/xfont.c b/src/glx/xfont.c
index 316c585..a086b7a 100644
--- a/src/glx/xfont.c
+++ b/src/glx/xfont.c
@@ -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);




More information about the mesa-commit mailing list