summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-30 10:31:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-05-30 23:14:15 +0100
commit3dac734bb0fb0ae1febfef9a9289cf830a87be1c (patch)
treecac0a241a04c73b7c2afd852fa3d0c39a976cfb6 /test
parent961139f5878572ebea268a0bbf47caf05af9093f (diff)
test: Only compute the masked pixel value if depth!=32
Minor saving for when we use a8r8g8b8. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test')
-rw-r--r--test/test.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/test.h b/test/test.h
index 568e000c..3ee9411c 100644
--- a/test/test.h
+++ b/test/test.h
@@ -52,15 +52,11 @@ int pixel_difference(uint32_t a, uint32_t b);
static inline int pixel_equal(int depth, uint32_t a, uint32_t b)
{
- uint32_t mask;
-
- if (depth == 32)
- mask = 0xffffffff;
- else
- mask = (1 << depth) - 1;
-
- a &= mask;
- b &= mask;
+ if (depth != 32) {
+ uint32_t mask = (1 << depth) - 1;
+ a &= mask;
+ b &= mask;
+ }
if (a == b)
return 1;