diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2013-10-09 17:42:52 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-10-15 19:32:09 +0100 |
commit | 252dca1c7b41410e7ff4ab61590a1433a8747e1f (patch) | |
tree | 204318c0add6680f30fc7539789fdb443050b0ad /lib | |
parent | 5a97ea91e11a4d2a2cfd46f18e0a69c2f0f279af (diff) |
lib: Add kmstest_paint_color()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/drmtest.c | 8 | ||||
-rw-r--r-- | lib/drmtest.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 2660af724..435a7458f 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -1347,6 +1347,14 @@ static int create_bo_for_fb(int fd, int width, int height, int bpp, return 0; } +void kmstest_paint_color(cairo_t *cr, int x, int y, int w, int h, + double r, double g, double b) +{ + cairo_rectangle(cr, x, y, w, h); + cairo_set_source_rgb(cr, r, g, b); + 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 f45780b45..b7909df80 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -359,6 +359,8 @@ unsigned int kmstest_create_fb2(int fd, int width, int height, uint32_t format, bool tiled, struct kmstest_fb *fb); 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_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); |