mesa/readpix: Dedent former _mesa_readpixels() if block
authorNanley Chery <nanley.g.chery@intel.com>
Sat, 6 Feb 2016 00:25:28 +0000 (16:25 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Tue, 9 Feb 2016 23:13:07 +0000 (15:13 -0800)
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>
src/mesa/main/readpix.c

index 56e9d60bb110785f2bbb01738fda1a0cbe0515d3..470182ab23d7796abd373c0258a4c40fd937a59d 100644 (file)
@@ -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);
+   }
 }