summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
committerBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
commit1f196b786d6bd0c6a5dbdc638574ff716cc3d4de (patch)
tree5ae2753b99070f8b35c51576bd39e52df63879d6 /src/mesa/drivers/x11
parent0ea575d721821262a862ceef010db9b1a8b4a6d9 (diff)
parent086f9fc0e2aef27f54eda87c733685500555bf20 (diff)
Merge branch 'texformat-rework'
Conflicts: src/mesa/drivers/dri/radeon/radeon_fbo.c src/mesa/drivers/dri/s3v/s3v_tex.c src/mesa/drivers/dri/s3v/s3v_xmesa.c src/mesa/drivers/dri/trident/trident_context.c src/mesa/main/debug.c src/mesa/main/mipmap.c src/mesa/main/texformat.c src/mesa/main/texgetimage.c
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c8
-rw-r--r--src/mesa/drivers/x11/xm_dd.c10
2 files changed, 8 insertions, 10 deletions
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 821e2a8e082..bf386292895 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -32,6 +32,7 @@
#include "glxheader.h"
#include "xmesaP.h"
#include "main/imports.h"
+#include "main/formats.h"
#include "main/framebuffer.h"
#include "main/renderbuffer.h"
@@ -338,18 +339,15 @@ xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual,
if (visual->rgbMode) {
xrb->Base.InternalFormat = GL_RGBA;
+ xrb->Base.Format = MESA_FORMAT_RGBA8888;
xrb->Base._BaseFormat = GL_RGBA;
xrb->Base.DataType = GL_UNSIGNED_BYTE;
- xrb->Base.RedBits = visual->redBits;
- xrb->Base.GreenBits = visual->greenBits;
- xrb->Base.BlueBits = visual->blueBits;
- xrb->Base.AlphaBits = visual->alphaBits;
}
else {
xrb->Base.InternalFormat = GL_COLOR_INDEX;
+ xrb->Base.Format = MESA_FORMAT_CI8;
xrb->Base._BaseFormat = GL_COLOR_INDEX;
xrb->Base.DataType = GL_UNSIGNED_INT;
- xrb->Base.IndexBits = visual->indexBits;
}
/* only need to set Red/Green/EtcBits fields for user-created RBs */
}
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index e2d4aa9b2d1..a27d7045abe 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -448,7 +448,7 @@ can_do_DrawPixels_8R8G8B(GLcontext *ctx, GLenum format, GLenum type)
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
- xrb->Base.AlphaBits == 0) {
+ _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) {
return GL_TRUE;
}
}
@@ -582,7 +582,7 @@ can_do_DrawPixels_5R6G5B(GLcontext *ctx, GLenum format, GLenum type)
struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped);
if (xrb &&
xrb->pixmap && /* drawing to pixmap or window */
- xrb->Base.AlphaBits == 0) {
+ _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) {
return GL_TRUE;
}
}
@@ -1019,15 +1019,15 @@ test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level,
/**
* In SW, we don't really compress GL_COMPRESSED_RGB[A] textures!
*/
-static const struct gl_texture_format *
+static gl_format
choose_tex_format( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
switch (internalFormat) {
case GL_COMPRESSED_RGB_ARB:
- return &_mesa_texformat_rgb;
+ return MESA_FORMAT_RGB888;
case GL_COMPRESSED_RGBA_ARB:
- return &_mesa_texformat_rgba;
+ return MESA_FORMAT_RGBA8888;
default:
return _mesa_choose_tex_format(ctx, internalFormat, format, type);
}