summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-12-03 14:48:01 -0700
committerBrian Paul <[email protected]>2010-12-03 14:48:03 -0700
commit75746e3779f9100fab8ac76242124152772dd8d9 (patch)
treea4d90424d62a98953396692586b77bbb988cbca4 /src
parentb87369e863c4c9650ef3a04a111e9ca79bca9e08 (diff)
swrast: allow GL_RG format in glDrawPixels()
Restructure the switch statement to avoid having to add additional color formats in the future. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=32086
Diffstat (limited to 'src')
-rw-r--r--src/mesa/swrast/s_drawpix.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 4e9b5307cc7..526837ed257 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -727,6 +727,9 @@ _swrast_DrawPixels( struct gl_context *ctx,
return;
}
+ /*
+ * By time we get here, all error checking should have been done.
+ */
switch (format) {
case GL_STENCIL_INDEX:
draw_stencil_pixels( ctx, x, y, width, height, type, unpack, pixels );
@@ -734,27 +737,12 @@ _swrast_DrawPixels( struct gl_context *ctx,
case GL_DEPTH_COMPONENT:
draw_depth_pixels( ctx, x, y, width, height, type, unpack, pixels );
break;
- case GL_COLOR_INDEX:
- case GL_RED:
- case GL_GREEN:
- case GL_BLUE:
- case GL_ALPHA:
- case GL_LUMINANCE:
- case GL_LUMINANCE_ALPHA:
- case GL_RGB:
- case GL_BGR:
- case GL_RGBA:
- case GL_BGRA:
- case GL_ABGR_EXT:
- draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels);
- break;
case GL_DEPTH_STENCIL_EXT:
- draw_depth_stencil_pixels(ctx, x, y, width, height,
- type, unpack, pixels);
+ draw_depth_stencil_pixels(ctx, x, y, width, height, type, unpack, pixels);
break;
default:
- _mesa_problem(ctx, "unexpected format 0x%x in _swrast_DrawPixels", format);
- /* don't return yet, clean-up */
+ /* all other formats should be color formats */
+ draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels);
}
swrast_render_finish(ctx);