From: Damien Lespiau Subject: [PATCH 4/8] lib: Add kmstest_paint_color() Date: Tue, 15 Oct 2013 19:44:30 +0100 Message-ID: <1381862674-17763-5-git-send-email-damien.lespiau@intel.com> References: <1381862674-17763-1-git-send-email-damien.lespiau@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DD75E6D38 for ; Tue, 15 Oct 2013 11:44:56 -0700 (PDT) In-Reply-To: <1381862674-17763-1-git-send-email-damien.lespiau@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org Signed-off-by: Damien Lespiau --- lib/drmtest.c | 8 ++++++++ lib/drmtest.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/lib/drmtest.c b/lib/drmtest.c index 2660af7..435a745 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 f45780b..b7909df 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); -- 1.8.3.1