diff options
author | Christoph Bumiller <[email protected]> | 2010-12-19 21:46:33 +0100 |
---|---|---|
committer | Christoph Bumiller <[email protected]> | 2010-12-19 21:46:33 +0100 |
commit | 0f68236a2487dbeb0396b996debcda595b0b54a1 (patch) | |
tree | 938ae3b779349b6dba6f5a891550604f9a9ca895 /src/mesa/swrast/s_drawpix.c | |
parent | d047168d81cfeb39a98f3ae16416872facc6237c (diff) | |
parent | 237880463d5168cad8df0bae6018b5fd76617777 (diff) |
Merge remote branch 'origin/master' into nvc0-new
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 4e9b5307cc7..4d0666898b4 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -720,13 +720,16 @@ _swrast_DrawPixels( struct gl_context *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - pixels = _mesa_map_pbo_source(ctx, unpack, pixels); - if (!pixels) { - swrast_render_finish(ctx); - _mesa_set_vp_override(ctx, save_vp_override); - return; - } + pixels = _mesa_map_pbo_source(ctx, unpack, pixels); + if (!pixels) { + swrast_render_finish(ctx); + _mesa_set_vp_override(ctx, save_vp_override); + 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); |