X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fxfont.c;h=fdf8f992139cf785d09c6e0d07715bb1958cd731;hb=04e8eaf4e82270d4eea578cd6d43eb1deea05a4d;hp=db3a57011005be40734667b88f448d0e690e202d;hpb=7b7845a076c933e096ac511b4184141ba194449a;p=mesa.git diff --git a/src/glx/xfont.c b/src/glx/xfont.c index db3a5701100..fdf8f992139 100644 --- a/src/glx/xfont.c +++ b/src/glx/xfont.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 3.1 * * Copyright (C) 1999 Brian Paul All Rights Reserved. * @@ -17,9 +16,10 @@ * 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 - * BRIAN PAUL 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. + * 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. */ @@ -129,7 +129,7 @@ dump_bitmap(unsigned int width, unsigned int height, GLubyte * bitmap) * Generate OpenGL-compatible bitmap. */ static void -fill_bitmap(Display * dpy, Window win, GC gc, +fill_bitmap(Display * dpy, int screen, GC gc, unsigned int width, unsigned int height, int x0, int y0, unsigned int c, GLubyte * bitmap) { @@ -138,7 +138,7 @@ fill_bitmap(Display * dpy, Window win, GC gc, Pixmap pixmap; XChar2b char2b; - pixmap = XCreatePixmap(dpy, win, 8 * width, height, 1); + pixmap = XCreatePixmap(dpy, RootWindow(dpy, screen), 8 * width, height, 1); XSetForeground(dpy, gc, 0); XFillRectangle(dpy, pixmap, gc, 0, 0, 8 * width, height); XSetForeground(dpy, gc, 1); @@ -212,10 +212,10 @@ isvalid(XFontStruct * fs, int which) } _X_HIDDEN void -DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) +DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int listbase) { Display *dpy; - Window win; + int screen; Pixmap pixmap; GC gc; XGCValues values; @@ -231,7 +231,7 @@ DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) int i; dpy = CC->currentDpy; - win = CC->currentDrawable; + screen = CC->screen; fs = XQueryFont(dpy, font); if (!fs) { @@ -245,7 +245,7 @@ DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) max_bm_width = (max_width + 7) / 8; max_bm_height = max_height; - bm = (GLubyte *) Xmalloc((max_bm_width * max_bm_height) * sizeof(GLubyte)); + bm = malloc((max_bm_width * max_bm_height) * sizeof(GLubyte)); if (!bm) { XFreeFontInfo(NULL, fs, 1); __glXSetError(CC, GL_OUT_OF_MEMORY); @@ -279,7 +279,7 @@ DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - pixmap = XCreatePixmap(dpy, win, 10, 10, 1); + pixmap = XCreatePixmap(dpy, RootWindow(dpy, screen), 10, 10, 1); values.foreground = BlackPixel(dpy, DefaultScreen(dpy)); values.background = WhitePixel(dpy, DefaultScreen(dpy)); values.font = fs->fid; @@ -342,7 +342,7 @@ DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) if (valid && (bm_width > 0) && (bm_height > 0)) { memset(bm, '\0', bm_width * bm_height); - fill_bitmap(dpy, win, gc, bm_width, bm_height, x, y, c, bm); + fill_bitmap(dpy, screen, gc, bm_width, bm_height, x, y, c, bm); glBitmap(width, height, x0, y0, dx, dy, bm); #ifdef DEBUG @@ -359,7 +359,7 @@ DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) glEndList(); } - Xfree(bm); + free(bm); XFreeFontInfo(NULL, fs, 1); XFreeGC(dpy, gc);