summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
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 821e2a8e08..bf38629289 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 e2d4aa9b2d..a27d7045ab 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);
}