gallium/util: whitespace, formatting fixes in u_debug_stack.c
[mesa.git] / src / gallium / auxiliary / util / u_surface.c
index 17591f11988522743a8c0e2fdb208414078da793..c150d92b967c8aa26849825a40b52edd652589a6 100644 (file)
@@ -196,7 +196,7 @@ util_fill_rect(ubyte * dst,
       for (i = 0; i < height; i++) {
          uint32_t *row = (uint32_t *)dst;
          for (j = 0; j < width; j++)
-            *row++ = uc->ui;
+            *row++ = uc->ui[0];
          dst += dst_stride;
       }
       break;
@@ -397,7 +397,7 @@ util_clear_render_target(struct pipe_context *pipe,
          }
       }
       else {
-         util_pack_color(color->f, dst->format, &uc);
+         util_pack_color(color->f, format, &uc);
       }
 
       util_fill_box(dst_map, dst->format,
@@ -548,30 +548,6 @@ util_clear_depth_stencil(struct pipe_context *pipe,
 }
 
 
-/* Return whether this is an RGBA, Z, S, or combined ZS format.
- */
-static unsigned
-get_format_mask(enum pipe_format format)
-{
-   const struct util_format_description *desc = util_format_description(format);
-
-   assert(desc);
-
-   if (util_format_has_depth(desc)) {
-      if (util_format_has_stencil(desc)) {
-         return PIPE_MASK_ZS;
-      } else {
-         return PIPE_MASK_Z;
-      }
-   } else {
-      if (util_format_has_stencil(desc)) {
-         return PIPE_MASK_S;
-      } else {
-         return PIPE_MASK_RGBA;
-      }
-   }
-}
-
 /* Return if the box is totally inside the resource.
  */
 static boolean
@@ -624,7 +600,8 @@ is_box_inside_resource(const struct pipe_resource *res,
       depth = res->array_size;
       assert(res->array_size % 6 == 0);
       break;
-   case PIPE_MAX_TEXTURE_TYPES:;
+   case PIPE_MAX_TEXTURE_TYPES:
+      break;
    }
 
    return box->x >= 0 &&
@@ -654,7 +631,7 @@ boolean
 util_try_blit_via_copy_region(struct pipe_context *ctx,
                               const struct pipe_blit_info *blit)
 {
-   unsigned mask = get_format_mask(blit->dst.format);
+   unsigned mask = util_format_get_mask(blit->dst.format);
 
    /* No format conversions. */
    if (blit->src.resource->format != blit->src.format ||
@@ -700,6 +677,9 @@ util_try_blit_via_copy_region(struct pipe_context *ctx,
       return FALSE;
    }
 
+   if (blit->alpha_blend)
+      return FALSE;
+
    ctx->resource_copy_region(ctx, blit->dst.resource, blit->dst.level,
                              blit->dst.box.x, blit->dst.box.y, blit->dst.box.z,
                              blit->src.resource, blit->src.level,