Commit 76791db0 authored by Adam Jackson's avatar Adam Jackson 🎧 Committed by Marge Bot
Browse files

mesa/x11: Remove the swrast-classic-based fake libGL



If you want this you will almost certainly be happier with the gallium
version, giving you llvmpipe instead of swrast-classic.

Reviewed-by: Emma Anholt's avatarEmma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker's avatarDylan Baker <dylan@pnwbakers.com>
Acked-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
Part-of: <mesa/mesa!10153>
parent 901e0d6a
......@@ -562,16 +562,12 @@ endif
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
elif with_glx == 'gallium-xlib'
elif with_glx == 'xlib'
if not with_gallium
error('Gallium-xlib based GLX requires at least one gallium driver')
error('xlib based GLX requires at least one gallium driver')
elif not with_gallium_softpipe
error('Gallium-xlib based GLX requires softpipe or llvmpipe.')
error('xlib based GLX requires softpipe or llvmpipe.')
elif with_dri
error('gallium-xlib conflicts with any dri driver')
endif
elif with_glx == 'xlib'
if with_dri
error('xlib conflicts with any dri driver')
endif
elif with_glx == 'dri'
......@@ -586,7 +582,7 @@ glvnd_vendor_name = get_option('glvnd-vendor-name')
if with_glvnd
if with_platform_windows
error('glvnd cannot be used on Windows')
elif with_glx == 'xlib' or with_glx == 'gallium-xlib'
elif with_glx == 'xlib'
error('Cannot build glvnd support for GLX that is not DRI based.')
elif with_glx == 'disabled' and not with_egl
error('glvnd requires DRI based GLX and/or EGL')
......@@ -2246,8 +2242,6 @@ if with_glx != 'disabled'
lines += 'GLX: DRI-based'
elif with_glx == 'xlib'
lines += 'GLX: Xlib-based'
elif with_glx == 'gallium-xlib'
lines += 'GLX: Xlib-based (Gallium)'
else
lines += 'GLX: ' + with_glx
endif
......
......@@ -290,7 +290,7 @@ option(
'glx',
type : 'combo',
value : 'auto',
choices : ['auto', 'disabled', 'dri', 'xlib', 'gallium-xlib'],
choices : ['auto', 'disabled', 'dri', 'xlib'],
description : 'Build support for GLX platform'
)
option(
......
......@@ -195,7 +195,7 @@ if with_osmesa
subdir('frontends/osmesa')
subdir('targets/osmesa')
endif
if with_glx == 'gallium-xlib'
if with_glx == 'xlib'
subdir('winsys/sw/xlib')
subdir('frontends/glx/xlib')
subdir('targets/libgl-xlib')
......
This diff is collapsed.
This diff is collapsed.
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _glxapi_h_
#define _glxapi_h_
#define GLX_GLXEXT_PROTOTYPES
#include "GL/glx.h"
/* The GLX API dispatcher (i.e. this code) is being built into stand-alone
* Mesa. We don't know anything about XFree86 or real GLX so we define a
* minimal __GLXContextRec here so some of the functions in this file can
* work properly.
*/
typedef struct __GLXcontextRec {
GLboolean isDirect;
GLXDrawable currentDrawable;
GLXDrawable currentReadable;
XID xid;
} __GLXcontext;
/*
* Almost all the GLX API functions get routed through this dispatch table.
* The exceptions are the glXGetCurrentXXX() functions.
*
* This dispatch table allows multiple GLX client-side modules to coexist.
* Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
* pseudo-GLX can be present at the same time. The former being used on
* GLX-enabled X servers and the later on non-GLX X servers.
*
* Red Hat has been using this since Red Hat Linux 7.0 (I think).
* This'll be a standard feature in XFree86 4.3. It basically allows one
* libGL to do both DRI-rendering and "fake GLX" rendering to X displays
* that lack the GLX extension.
*/
struct _glxapi_table {
/*** GLX_VERSION_1_0 ***/
XVisualInfo *(*ChooseVisual)(Display *dpy, int screen, int *list);
void (*CopyContext)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask);
GLXContext (*CreateContext)(Display *dpy, XVisualInfo *visinfo, GLXContext shareList, Bool direct);
GLXPixmap (*CreateGLXPixmap)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap);
void (*DestroyContext)(Display *dpy, GLXContext ctx);
void (*DestroyGLXPixmap)(Display *dpy, GLXPixmap pixmap);
int (*GetConfig)(Display *dpy, XVisualInfo *visinfo, int attrib, int *value);
GLXContext (*GetCurrentContext)(void);
/*GLXDrawable (*GetCurrentDrawable)(void);*/
Bool (*IsDirect)(Display *dpy, GLXContext ctx);
Bool (*MakeCurrent)(Display *dpy, GLXDrawable drawable, GLXContext ctx);
Bool (*QueryExtension)(Display *dpy, int *errorb, int *event);
Bool (*QueryVersion)(Display *dpy, int *maj, int *min);
void (*SwapBuffers)(Display *dpy, GLXDrawable drawable);
void (*UseXFont)(Font font, int first, int count, int listBase);
void (*WaitGL)(void);
void (*WaitX)(void);
/*** GLX_VERSION_1_1 ***/
const char *(*GetClientString)(Display *dpy, int name);
const char *(*QueryExtensionsString)(Display *dpy, int screen);
const char *(*QueryServerString)(Display *dpy, int screen, int name);
/*** GLX_VERSION_1_2 ***/
/*Display *(*GetCurrentDisplay)(void);*/
/*** GLX_VERSION_1_3 ***/
GLXFBConfig *(*ChooseFBConfig)(Display *dpy, int screen, const int *attribList, int *nitems);
GLXContext (*CreateNewContext)(Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct);
GLXPbuffer (*CreatePbuffer)(Display *dpy, GLXFBConfig config, const int *attribList);
GLXPixmap (*CreatePixmap)(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList);
GLXWindow (*CreateWindow)(Display *dpy, GLXFBConfig config, Window win, const int *attribList);
void (*DestroyPbuffer)(Display *dpy, GLXPbuffer pbuf);
void (*DestroyPixmap)(Display *dpy, GLXPixmap pixmap);
void (*DestroyWindow)(Display *dpy, GLXWindow window);
/*GLXDrawable (*GetCurrentReadDrawable)(void);*/
int (*GetFBConfigAttrib)(Display *dpy, GLXFBConfig config, int attribute, int *value);
GLXFBConfig *(*GetFBConfigs)(Display *dpy, int screen, int *nelements);
void (*GetSelectedEvent)(Display *dpy, GLXDrawable drawable, unsigned long *mask);
XVisualInfo *(*GetVisualFromFBConfig)(Display *dpy, GLXFBConfig config);
Bool (*MakeContextCurrent)(Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
int (*QueryContext)(Display *dpy, GLXContext ctx, int attribute, int *value);
void (*QueryDrawable)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
void (*SelectEvent)(Display *dpy, GLXDrawable drawable, unsigned long mask);
/*** GLX_SGI_swap_control ***/
int (*SwapIntervalSGI)(int);
/*** GLX_SGI_video_sync ***/
int (*GetVideoSyncSGI)(unsigned int *count);
int (*WaitVideoSyncSGI)(int divisor, int remainder, unsigned int *count);
/*** GLX_SGI_make_current_read ***/
Bool (*MakeCurrentReadSGI)(Display *, GLXDrawable, GLXDrawable, GLXContext);
/*GLXDrawable (*GetCurrentReadDrawableSGI)(void);*/
/*** GLX_SGIX_video_source (needs video library) ***/
#if defined(_VL_H_)
GLXVideoSourceSGIX (*CreateGLXVideoSourceSGIX)(Display *, int, VLServer, VLPath, int, VLNode);
void (*DestroyGLXVideoSourceSGIX)(Display *, GLXVideoSourceSGIX);
#else
void *CreateGLXVideoSourceSGIX;
void *DestroyGLXVideoSourceSGIX;
#endif
/*** GLX_EXT_import_context ***/
void (*FreeContextEXT)(Display *dpy, GLXContext context);
GLXContextID (*GetContextIDEXT)(const GLXContext context);
/*Display *(*GetCurrentDisplayEXT)(void);*/
GLXContext (*ImportContextEXT)(Display *dpy, GLXContextID contextID);
int (*QueryContextInfoEXT)(Display *dpy, GLXContext context, int attribute,int *value);
/*** GLX_SGIX_fbconfig ***/
int (*GetFBConfigAttribSGIX)(Display *, GLXFBConfigSGIX, int, int *);
GLXFBConfigSGIX * (*ChooseFBConfigSGIX)(Display *, int, int *, int *);
GLXPixmap (*CreateGLXPixmapWithConfigSGIX)(Display *, GLXFBConfigSGIX, Pixmap);
GLXContext (*CreateContextWithConfigSGIX)(Display *, GLXFBConfigSGIX, int, GLXContext, Bool);
XVisualInfo * (*GetVisualFromFBConfigSGIX)(Display *, GLXFBConfigSGIX);
GLXFBConfigSGIX (*GetFBConfigFromVisualSGIX)(Display *, XVisualInfo *);
/*** GLX_SGIX_pbuffer ***/
GLXPbufferSGIX (*CreateGLXPbufferSGIX)(Display *, GLXFBConfigSGIX, unsigned int, unsigned int, int *);
void (*DestroyGLXPbufferSGIX)(Display *, GLXPbufferSGIX);
void (*QueryGLXPbufferSGIX)(Display *, GLXPbufferSGIX, int, unsigned int *);
void (*SelectEventSGIX)(Display *, GLXDrawable, unsigned long);
void (*GetSelectedEventSGIX)(Display *, GLXDrawable, unsigned long *);
/*** GLX_SGI_cushion ***/
void (*CushionSGI)(Display *, Window, float);
/*** GLX_SGIX_video_resize ***/
int (*BindChannelToWindowSGIX)(Display *, int, int, Window);
int (*ChannelRectSGIX)(Display *, int, int, int, int, int, int);
int (*QueryChannelRectSGIX)(Display *, int, int, int *, int *, int *, int *);
int (*QueryChannelDeltasSGIX)(Display *, int, int, int *, int *, int *, int *);
int (*ChannelRectSyncSGIX)(Display *, int, int, GLenum);
/*** GLX_SGIX_dmbuffer (needs dmedia library) ***/
#if defined (_DM_BUFFER_H_)
Bool (*AssociateDMPbufferSGIX)(Display *, GLXPbufferSGIX, DMparams *, DMbuffer);
#else
void *AssociciateDMPbufferSGIX;
#endif
/*** GLX_SUN_get_transparent_index ***/
Status (*GetTransparentIndexSUN)(Display *, Window, Window, unsigned long *);
/*** GLX_MESA_copy_sub_buffer ***/
void (*CopySubBufferMESA)(Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
/*** GLX_MESA_release_buffers ***/
Bool (*ReleaseBuffersMESA)(Display *dpy, Window w);
/*** GLX_MESA_pixmap_colormap ***/
GLXPixmap (*CreateGLXPixmapMESA)(Display *dpy, XVisualInfo *visinfo, Pixmap pixmap, Colormap cmap);
/*** GLX_EXT_texture_from_pixmap ***/
void (*BindTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer,
const int *attrib_list);
void (*ReleaseTexImageEXT)(Display *dpy, GLXDrawable drawable, int buffer);
/*** GLX_ARB_create_context ***/
GLXContext (*CreateContextAttribs)(Display *dpy, GLXFBConfig config,
GLXContext share_context, Bool direct,
const int *attrib_list);
};
extern const char *
_glxapi_get_version(void);
extern const char **
_glxapi_get_extensions(void);
extern GLuint
_glxapi_get_dispatch_table_size(void);
extern void
_glxapi_set_no_op_table(struct _glxapi_table *t);
extern __GLXextFuncPtr
_glxapi_get_proc_address(const char *funcName);
#endif
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef GLX_HEADER_H
#define GLX_HEADER_H
#include "main/glheader.h"
# include <X11/Xlib.h>
# include <X11/Xlibint.h>
# include <X11/Xutil.h>
# ifdef USE_XSHM /* was SHM */
# include <sys/ipc.h>
# include <sys/shm.h>
# include <X11/extensions/XShm.h>
# endif
# include <GL/glx.h>
# include <sys/time.h>
/* this silences a compiler warning on several systems */
struct timespec;
struct itimerspec;
#endif /*GLX_HEADER*/
# Copyright © 2017 Intel Corporation
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
gl_link_with = []
if with_shared_glapi
gl_link_with += libglapi
endif
libgl = shared_library(
'GL',
files(
'fakeglx.c', 'glxapi.c', 'xfonts.c', 'xm_api.c', 'xm_buffer.c', 'xm_dd.c',
'xm_line.c', 'xm_tri.c',
),
include_directories : [
inc_include, inc_src, inc_mesa, inc_mapi, inc_gallium, inc_gallium_aux
],
link_with : [libmesa_classic, libglapi_static, gl_link_with],
dependencies : [idep_mesautil, dep_x11, dep_xext, dep_xcb, dep_thread],
version : '1.6.0',
install : true,
)
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
/* xfonts.c -- glXUseXFont() for Mesa written by
* Copyright (C) 1995 Thorsten.Ohl @ Physik.TH-Darmstadt.de
*/
#include <stdio.h>
#include "glxheader.h"
#include "main/context.h"
#include "xfonts.h"
/* Some debugging info. */
#ifdef DEBUG
#include <ctype.h>
int debug_xfonts = 0;
static void
dump_char_struct(XCharStruct * ch, char *prefix)
{
printf("%slbearing = %d, rbearing = %d, width = %d\n",
prefix, ch->lbearing, ch->rbearing, ch->width);
printf("%sascent = %d, descent = %d, attributes = %u\n",
prefix, ch->ascent, ch->descent, (unsigned int) ch->attributes);
}
static void
dump_font_struct(XFontStruct * font)
{
printf("ascent = %d, descent = %d\n", font->ascent, font->descent);
printf("char_or_byte2 = (%u,%u)\n",
font->min_char_or_byte2, font->max_char_or_byte2);
printf("byte1 = (%u,%u)\n", font->min_byte1, font->max_byte1);
printf("all_chars_exist = %s\n", font->all_chars_exist ? "True" : "False");
printf("default_char = %c (\\%03o)\n",
(char) (isprint(font->default_char) ? font->default_char : ' '),
font->default_char);
dump_char_struct(&font->min_bounds, "min> ");
dump_char_struct(&font->max_bounds, "max> ");
#if 0
for (c = font->min_char_or_byte2; c <= font->max_char_or_byte2; c++) {
char prefix[8];
sprintf(prefix, "%d> ", c);
dump_char_struct(&font->per_char[c], prefix);
}
#endif
}
static void
dump_bitmap(unsigned int width, unsigned int height, GLubyte * bitmap)
{
unsigned int x, y;
printf(" ");
for (x = 0; x < 8 * width; x++)
printf("%o", 7 - (x % 8));
putchar('\n');
for (y = 0; y < height; y++) {
printf("%3o:", y);
for (x = 0; x < 8 * width; x++)
putchar((bitmap[width * (height - y - 1) + x / 8] & (1 << (7 - (x %
8))))
? '*' : '.');
printf(" ");
for (x = 0; x < width; x++)
printf("0x%02x, ", bitmap[width * (height - y - 1) + x]);
putchar('\n');
}
}
#endif /* DEBUG */
/* Implementation. */
/* Fill a BITMAP with a character C from thew current font
in the graphics context GC. WIDTH is the width in bytes
and HEIGHT is the height in bits.
Note that the generated bitmaps must be used with
glPixelStorei (GL_UNPACK_SWAP_BYTES, GL_FALSE);
glPixelStorei (GL_UNPACK_LSB_FIRST, GL_FALSE);
glPixelStorei (GL_UNPACK_ROW_LENGTH, 0);
glPixelStorei (GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei (GL_UNPACK_SKIP_PIXELS, 0);
glPixelStorei (GL_UNPACK_ALIGNMENT, 1);
Possible optimizations:
* use only one reusable pixmap with the maximum dimensions.
* draw the entire font into a single pixmap (careful with
proportional fonts!).
*/
/*
* Generate OpenGL-compatible bitmap.
*/
static void
fill_bitmap(Display * dpy, Window win, GC gc,
unsigned int width, unsigned int height,
int x0, int y0, unsigned int c, GLubyte * bitmap)
{
XImage *image;
unsigned int x, y;
Pixmap pixmap;
XChar2b char2b;
pixmap = XCreatePixmap(dpy, win, 8 * width, height, 1);
XSetForeground(dpy, gc, 0);
XFillRectangle(dpy, pixmap, gc, 0, 0, 8 * width, height);
XSetForeground(dpy, gc, 1);
char2b.byte1 = (c >> 8) & 0xff;
char2b.byte2 = (c & 0xff);
XDrawString16(dpy, pixmap, gc, x0, y0, &char2b, 1);
image = XGetImage(dpy, pixmap, 0, 0, 8 * width, height, 1, XYPixmap);
if (image) {
/* Fill the bitmap (X11 and OpenGL are upside down wrt each other). */
for (y = 0; y < height; y++)
for (x = 0; x < 8 * width; x++)
if (XGetPixel(image, x, y))
bitmap[width * (height - y - 1) + x / 8] |=
(1 << (7 - (x % 8)));
XDestroyImage(image);
}
XFreePixmap(dpy, pixmap);
}
/*
* determine if a given glyph is valid and return the
* corresponding XCharStruct.
*/
static XCharStruct *
isvalid(XFontStruct * fs, unsigned int which)
{
unsigned int rows, pages;
unsigned int byte1 = 0, byte2 = 0;
int i, valid = 1;
rows = fs->max_byte1 - fs->min_byte1 + 1;
pages = fs->max_char_or_byte2 - fs->min_char_or_byte2 + 1;
if (rows == 1) {
/* "linear" fonts */
if ((fs->min_char_or_byte2 > which) || (fs->max_char_or_byte2 < which))
valid = 0;
}
else {
/* "matrix" fonts */
byte2 = which & 0xff;
byte1 = which >> 8;
if ((fs->min_char_or_byte2 > byte2) ||
(fs->max_char_or_byte2 < byte2) ||
(fs->min_byte1 > byte1) || (fs->max_byte1 < byte1))
valid = 0;
}
if (valid) {
if (fs->per_char) {
if (rows == 1) {
/* "linear" fonts */
return (fs->per_char + (which - fs->min_char_or_byte2));
}
else {
/* "matrix" fonts */
i = ((byte1 - fs->min_byte1) * pages) +
(byte2 - fs->min_char_or_byte2);
return (fs->per_char + i);
}
}
else {
return (&fs->min_bounds);
}
}
return (NULL);
}
void
Fake_glXUseXFont(Font font, int first, int count, int listbase)
{
Display *dpy;
Window win;
Pixmap pixmap;
GC gc;
XGCValues values;
unsigned long valuemask;
XFontStruct *fs;
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
unsigned int max_width, max_height, max_bm_width, max_bm_height;
GLubyte *bm;
int i;
dpy = glXGetCurrentDisplay();
if (!dpy)
return; /* I guess glXMakeCurrent wasn't called */
win = RootWindow(dpy, DefaultScreen(dpy));
fs = XQueryFont(dpy, font);
if (!fs) {
_mesa_error(NULL, GL_INVALID_VALUE,
"Couldn't get font structure information");
return;
}
/* Allocate a bitmap that can fit all characters. */
max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing;
max_height = fs->max_bounds.ascent + fs->max_bounds.descent;