summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_surface.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-06-08 14:41:48 -0600
committerBrian Paul <[email protected]>2016-06-30 14:32:06 -0600
commita029d9f074c510d86c487b249f4ca535e8782df7 (patch)
tree6584cdedebc686b4acdd95a4f03301c50104421a /src/gallium/auxiliary/util/u_surface.c
parent5d31ea4b8faf011e855fa056186e1205bf5abcf1 (diff)
gallium/util: simplify a few things in util_can_blit_via_copy_region()
Since only the src box can have negative dims for flipping, just comparing the src/dst box sizes is enough to detect flips. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/util/u_surface.c')
-rw-r--r--src/gallium/auxiliary/util/u_surface.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c
index 8d22bcfeb11..e2229bc7d13 100644
--- a/src/gallium/auxiliary/util/u_surface.c
+++ b/src/gallium/auxiliary/util/u_surface.c
@@ -701,21 +701,20 @@ util_can_blit_via_copy_region(const struct pipe_blit_info *blit)
return FALSE;
}
- /* No masks, no filtering, no scissor. */
+ /* No masks, no filtering, no scissor, no blending */
if ((blit->mask & mask) != mask ||
blit->filter != PIPE_TEX_FILTER_NEAREST ||
- blit->scissor_enable) {
+ blit->scissor_enable ||
+ blit->alpha_blend) {
return FALSE;
}
- /* No flipping. */
- if (blit->src.box.width < 0 ||
- blit->src.box.height < 0 ||
- blit->src.box.depth < 0) {
- return FALSE;
- }
+ /* Only the src box can have negative dims for flipping */
+ assert(blit->dst.box.width >= 1);
+ assert(blit->dst.box.height >= 1);
+ assert(blit->dst.box.depth >= 1);
- /* No scaling. */
+ /* No scaling or flipping */
if (blit->src.box.width != blit->dst.box.width ||
blit->src.box.height != blit->dst.box.height ||
blit->src.box.depth != blit->dst.box.depth) {
@@ -736,9 +735,6 @@ util_can_blit_via_copy_region(const struct pipe_blit_info *blit)
return FALSE;
}
- if (blit->alpha_blend)
- return FALSE;
-
return TRUE;
}