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:28 -0800
committerNanley Chery <nanley.g.chery@intel.com>2016-02-09 15:13:07 -0800
commitc624241ef47c3a6ea2d1177969328bd4547e45a2 (patch)
treeded66d74c32cd406624b4764465e863a6731fb48 /src/mesa/main/readpix.c
parentb89a8a15c240418d1859947b5114993ecdf424fb (diff)
downloadexternal_mesa3d-c624241ef47c3a6ea2d1177969328bd4547e45a2.zip
external_mesa3d-c624241ef47c3a6ea2d1177969328bd4547e45a2.tar.gz
external_mesa3d-c624241ef47c3a6ea2d1177969328bd4547e45a2.tar.bz2
mesa/readpix: Dedent former _mesa_readpixels() if block
Formatting patch split out for easy reviewing. 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.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 56e9d60..470182a 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -861,38 +861,38 @@ _mesa_readpixels(struct gl_context *ctx,
if (ctx->NewState)
_mesa_update_state(ctx);
- 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, packing);
- return;
- }
-
- /* Otherwise take the slow path. */
- switch (format) {
- case GL_STENCIL_INDEX:
- read_stencil_pixels(ctx, x, y, width, height, type, pixels,
- packing);
- break;
- case GL_DEPTH_COMPONENT:
- read_depth_pixels(ctx, x, y, width, height, type, pixels,
- packing);
- break;
- case GL_DEPTH_STENCIL_EXT:
- read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels,
- packing);
- break;
- default:
- /* all other formats should be color formats */
- read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
- packing);
- }
+ 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, packing);
+ return;
+ }
+
+ /* Otherwise take the slow path. */
+ switch (format) {
+ case GL_STENCIL_INDEX:
+ read_stencil_pixels(ctx, x, y, width, height, type, pixels,
+ packing);
+ break;
+ case GL_DEPTH_COMPONENT:
+ read_depth_pixels(ctx, x, y, width, height, type, pixels,
+ packing);
+ break;
+ case GL_DEPTH_STENCIL_EXT:
+ read_depth_stencil_pixels(ctx, x, y, width, height, type, pixels,
+ packing);
+ break;
+ default:
+ /* all other formats should be color formats */
+ read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
+ packing);
}
+
+ _mesa_unmap_pbo_dest(ctx, packing);
+ }
}