summaryrefslogtreecommitdiff
path: root/test/test.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-05-17 20:45:25 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-05-18 09:05:30 +0100
commitb10ef9cf5c9cc844f432e9024deeb78fa1034a8e (patch)
treede92d6fe730f1514f3396f69e55d0a948c1f94cb /test/test.h
parent6d64063750535f1c2b94e075d1d525ed289821aa (diff)
sna/glyphs: Improve handling of low bitdepth mask format conversions
We shouldn't just discard the mask if the user requests that we render the glyphs through a low bitdepth mask - and in doing so we should also be careful not to improve the bitdepth of that mask (since we don't take into account the extra quantisation desired). Testcase: render-glyphs Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/test.h')
-rw-r--r--test/test.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test.h b/test/test.h
index a3ef979d..9eec1cf9 100644
--- a/test/test.h
+++ b/test/test.h
@@ -107,6 +107,15 @@ static inline uint32_t color(uint8_t red, uint8_t green, uint8_t blue, uint8_t a
return alpha << 24 | ra >> 8 << 16 | ga >> 8 << 8 | ba >> 8;
}
+static inline uint32_t xrender_color(const XRenderColor *c)
+{
+ uint32_t ra = c->red * c->alpha;
+ uint32_t ga = c->green * c->alpha;
+ uint32_t ba = c->blue * c->alpha;
+
+ return c->alpha >> 8 << 24 | ra >> 24 << 16 | ga >> 24 << 8 | ba >> 24;
+}
+
void test_timer_start(struct test_display *t, struct timespec *tv);
double test_timer_stop(struct test_display *t, struct timespec *tv);