summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/debug.c')
-rw-r--r--src/mesa/main/debug.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 80bc6afc4c2..1c8c44fcb96 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -24,12 +24,15 @@
*/
#include "mtypes.h"
+#include "attrib.h"
#include "colormac.h"
#include "context.h"
#include "hash.h"
#include "imports.h"
#include "debug.h"
#include "get.h"
+#include "pixelstore.h"
+#include "readpix.h"
#include "texobj.h"
#include "texformat.h"
@@ -282,7 +285,7 @@ write_texture_image(struct gl_texture_object *texObj)
case MESA_FORMAT_RGB565:
{
GLubyte *buf2 = (GLubyte *) _mesa_malloc(img->Width * img->Height * 3);
- GLint i;
+ GLuint i;
for (i = 0; i < img->Width * img->Height; i++) {
GLint r, g, b;
GLushort s = ((GLushort *) img->Data)[i];
@@ -353,11 +356,11 @@ _mesa_dump_color_buffer(const char *filename)
buf = (GLubyte *) _mesa_malloc(w * h * 4);
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
- glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf);
+ _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf);
_mesa_printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n",
ctx->ReadBuffer->_ColorReadBuffer,
@@ -367,7 +370,7 @@ _mesa_dump_color_buffer(const char *filename)
_mesa_printf("Writing %d x %d color buffer to %s\n", w, h, filename);
write_ppm(filename, buf, w, h, 4, 0, 1, 2);
- glPopClientAttrib();
+ _mesa_PopClientAttrib();
_mesa_free(buf);
}
@@ -386,11 +389,11 @@ _mesa_dump_depth_buffer(const char *filename)
buf = (GLuint *) _mesa_malloc(w * h * 4); /* 4 bpp */
buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
- glReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf);
+ _mesa_ReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf);
/* spread 24 bits of Z across R, G, B */
for (i = 0; i < w * h; i++) {
@@ -402,7 +405,7 @@ _mesa_dump_depth_buffer(const char *filename)
_mesa_printf("Writing %d x %d depth buffer to %s\n", w, h, filename);
write_ppm(filename, buf2, w, h, 3, 0, 1, 2);
- glPopClientAttrib();
+ _mesa_PopClientAttrib();
_mesa_free(buf);
_mesa_free(buf2);
@@ -422,11 +425,11 @@ _mesa_dump_stencil_buffer(const char *filename)
buf = (GLubyte *) _mesa_malloc(w * h); /* 1 bpp */
buf2 = (GLubyte *) _mesa_malloc(w * h * 3); /* 3 bpp */
- glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
- glPixelStorei(GL_PACK_ALIGNMENT, 1);
- glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
+ _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
+ _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1);
+ _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
- glReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf);
+ _mesa_ReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf);
for (i = 0; i < w * h; i++) {
buf2[i*3+0] = buf[i];
@@ -437,7 +440,7 @@ _mesa_dump_stencil_buffer(const char *filename)
_mesa_printf("Writing %d x %d stencil buffer to %s\n", w, h, filename);
write_ppm(filename, buf2, w, h, 3, 0, 1, 2);
- glPopClientAttrib();
+ _mesa_PopClientAttrib();
_mesa_free(buf);
_mesa_free(buf2);