From 3dac734bb0fb0ae1febfef9a9289cf830a87be1c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 30 May 2014 10:31:37 +0100 Subject: test: Only compute the masked pixel value if depth!=32 Minor saving for when we use a8r8g8b8. Signed-off-by: Chris Wilson --- test/test.h | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test') 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; -- cgit v1.2.3