diff options
author | brianp <brianp> | 2001-05-15 21:40:32 +0000 |
---|---|---|
committer | brianp <brianp> | 2001-05-15 21:40:32 +0000 |
commit | d3151b449323ae3508eb677d93aa0e4781a07682 (patch) | |
tree | 5f00fcb84365cadb06432deb8206300f1b21ceb7 /xc/extras/Mesa/src/X | |
parent | 09d18b022f5e320ded6113c6ebfa273beff447ea (diff) |
sync with Mesa 3.4.2 CVS - assorted bug fixes
Diffstat (limited to 'xc/extras/Mesa/src/X')
-rw-r--r-- | xc/extras/Mesa/src/X/fakeglx.c | 50 | ||||
-rw-r--r-- | xc/extras/Mesa/src/X/xmesa2.c | 29 |
2 files changed, 56 insertions, 23 deletions
diff --git a/xc/extras/Mesa/src/X/fakeglx.c b/xc/extras/Mesa/src/X/fakeglx.c index 311dadb20..c05385239 100644 --- a/xc/extras/Mesa/src/X/fakeglx.c +++ b/xc/extras/Mesa/src/X/fakeglx.c @@ -336,22 +336,40 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo ) ); } else if (is_usable_visual( visinfo )) { - /* Configure this visual as RGB, double-buffered, depth-buffered. */ - /* This is surely wrong for some people's needs but what else */ - /* can be done? They should use glXChooseVisual(). */ - return save_glx_visual( dpy, visinfo, - GL_TRUE, /* rgb */ - GL_FALSE, /* alpha */ - GL_TRUE, /* double */ - GL_FALSE, /* stereo */ - DEFAULT_SOFTWARE_DEPTH_BITS, - 8 * sizeof(GLstencil), - 8 * sizeof(GLaccum), /* r */ - 8 * sizeof(GLaccum), /* g */ - 8 * sizeof(GLaccum), /* b */ - 8 * sizeof(GLaccum), /* a */ - 0 /* level */ - ); + if (getenv("MESA_GLX_FORCE_CI")) { + /* Configure this visual as a COLOR INDEX visual. */ + return save_glx_visual( dpy, visinfo, + GL_FALSE, /* rgb */ + GL_FALSE, /* alpha */ + GL_TRUE, /* double */ + GL_FALSE, /* stereo */ + DEFAULT_SOFTWARE_DEPTH_BITS, + 8 * sizeof(GLstencil), + 0 * sizeof(GLaccum), /* r */ + 0 * sizeof(GLaccum), /* g */ + 0 * sizeof(GLaccum), /* b */ + 0 * sizeof(GLaccum), /* a */ + 0 /* level */ + ); + } + else { + /* Configure this visual as RGB, double-buffered, depth-buffered. */ + /* This is surely wrong for some people's needs but what else */ + /* can be done? They should use glXChooseVisual(). */ + return save_glx_visual( dpy, visinfo, + GL_TRUE, /* rgb */ + GL_FALSE, /* alpha */ + GL_TRUE, /* double */ + GL_FALSE, /* stereo */ + DEFAULT_SOFTWARE_DEPTH_BITS, + 8 * sizeof(GLstencil), + 8 * sizeof(GLaccum), /* r */ + 8 * sizeof(GLaccum), /* g */ + 8 * sizeof(GLaccum), /* b */ + 8 * sizeof(GLaccum), /* a */ + 0 /* level */ + ); + } } else { fprintf(stderr,"Mesa: error in glXCreateContext: bad visual\n"); diff --git a/xc/extras/Mesa/src/X/xmesa2.c b/xc/extras/Mesa/src/X/xmesa2.c index f05e95b11..10178dcba 100644 --- a/xc/extras/Mesa/src/X/xmesa2.c +++ b/xc/extras/Mesa/src/X/xmesa2.c @@ -4215,10 +4215,18 @@ static void write_span_index8_pixmap( INDEX8_SPAN_ARGS ) XMesaGC gc = xmesa->xm_buffer->gc2; register GLuint i; y = FLIP(xmesa->xm_buffer, y); - for (i=0;i<n;i++,x++) { - if (mask[i]) { - XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); - XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); + if (mask) { + for (i=0;i<n;i++,x++) { + if (mask[i]) { + XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); + XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); + } + } + } + else { + for (i=0;i<n;i++,x++) { + XMesaSetForeground( dpy, gc, (unsigned long) index[i] ); + XMesaDrawPoint( dpy, buffer, gc, (int) x, (int) y ); } } } @@ -4233,9 +4241,16 @@ static void write_span_index_ximage( INDEX_SPAN_ARGS ) XMesaImage *img = xmesa->xm_buffer->backimage; register GLuint i; y = FLIP(xmesa->xm_buffer, y); - for (i=0;i<n;i++,x++) { - if (mask[i]) { - XMesaPutPixel( img, x, y, (unsigned long) index[i] ); + if (mask) { + for (i=0;i<n;i++,x++) { + if (mask[i]) { + XMesaPutPixel( img, x, y, (unsigned long) index[i] ); + } + } + } + else { + for (i=0;i<n;i++,x++) { + XMesaPutPixel( img, x, y, (unsigned long) index[i] ); } } } |