From 471ec64de83b21316cd7f4d86a9337f4d017a907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 18 Oct 2013 21:43:14 +0300 Subject: [PATCH] lib/drmtest: Add kmstest_paint_color_alpha() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kmstest_paint_color_alpha() just like kmstest_paint_color() except you also get to specify the alpha channel. Signed-off-by: Ville Syrjälä --- lib/drmtest.c | 8 ++++++++ lib/drmtest.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/lib/drmtest.c b/lib/drmtest.c index d035f5e7..abcbba95 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1367,6 +1367,14 @@ void kmstest_paint_color(cairo_t *cr, int x, int y, int w, int h, cairo_fill(cr); } +void kmstest_paint_color_alpha(cairo_t *cr, int x, int y, int w, int h, + double r, double g, double b, double a) +{ + cairo_rectangle(cr, x, y, w, h); + cairo_set_source_rgba(cr, r, g, b, a); + cairo_fill(cr); +} + void kmstest_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, int r, int g, int b) diff --git a/lib/drmtest.h b/lib/drmtest.h index 3a3900ef..609e7d84 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -363,6 +363,8 @@ void kmstest_remove_fb(int fd, struct kmstest_fb *fb_info); cairo_t *kmstest_get_cairo_ctx(int fd, struct kmstest_fb *fb); void kmstest_paint_color(cairo_t *cr, int x, int y, int w, int h, double r, double g, double b); +void kmstest_paint_color_alpha(cairo_t *cr, int x, int y, int w, int h, + double r, double g, double b, double a); void kmstest_paint_color_gradient(cairo_t *cr, int x, int y, int w, int h, int r, int g, int b); void kmstest_paint_test_pattern(cairo_t *cr, int width, int height);