summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorNanley Chery <nanley.g.chery@intel.com>2016-02-05 16:25:01 -0800
committerNanley Chery <nanley.g.chery@intel.com>2016-02-09 15:13:07 -0800
commitb89a8a15c240418d1859947b5114993ecdf424fb (patch)
tree2871803a9c5aa4f49f58a55005de078e2126e3e3 /src/mesa/main/readpix.c
parent605832736a6d9427ad894d403cceeb74a5b18dc1 (diff)
downloadexternal_mesa3d-b89a8a15c240418d1859947b5114993ecdf424fb.zip
external_mesa3d-b89a8a15c240418d1859947b5114993ecdf424fb.tar.gz
external_mesa3d-b89a8a15c240418d1859947b5114993ecdf424fb.tar.bz2
mesa/readpix: Don't clip in _mesa_readpixels()
The clipping is performed higher up in the call-chain. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index a5b74bc..56e9d60 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -858,21 +858,16 @@ _mesa_readpixels(struct gl_context *ctx,
const struct gl_pixelstore_attrib *packing,
GLvoid *pixels)
{
- struct gl_pixelstore_attrib clippedPacking = *packing;
-
if (ctx->NewState)
_mesa_update_state(ctx);
- /* Do all needed clipping here, so that we can forget about it later */
- if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) {
-
- pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels);
+ pixels = _mesa_map_pbo_dest(ctx, packing, pixels);
if (pixels) {
/* Try memcpy first. */
if (readpixels_memcpy(ctx, x, y, width, height, format, type,
pixels, packing)) {
- _mesa_unmap_pbo_dest(ctx, &clippedPacking);
+ _mesa_unmap_pbo_dest(ctx, packing);
return;
}
@@ -880,25 +875,24 @@ _mesa_readpixels(struct gl_context *ctx,
switch (format) {
case GL_STENCIL_INDEX:
read_stencil_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
+ packing);
break;
case GL_DEPTH_COMPONENT:
read_depth_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
+ packing);
break;
case GL_DEPTH_STENCIL_EXT:
read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels,
- &clippedPacking);
+ packing);
break;
default:
/* all other formats should be color formats */
read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
- &clippedPacking);
+ packing);
}
- _mesa_unmap_pbo_dest(ctx, &clippedPacking);
+ _mesa_unmap_pbo_dest(ctx, packing);
}
- }
}