lib: Add kmstest_paint_color()
authorDamien Lespiau <damien.lespiau@intel.com>
Wed, 9 Oct 2013 16:42:52 +0000 (17:42 +0100)
committerDamien Lespiau <damien.lespiau@intel.com>
Tue, 15 Oct 2013 18:32:09 +0000 (19:32 +0100)
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
lib/drmtest.c
lib/drmtest.h

index 2660af7..435a745 100644 (file)
@@ -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)
index f45780b..b7909df 100644 (file)
@@ -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);