From patchwork Fri Mar 18 17:38:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexandros.frantzis@linaro.org X-Patchwork-Id: 672 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:44:36 -0000 Delivered-To: patches@linaro.org Received: by 10.220.28.198 with SMTP id n6cs31166vcc; Fri, 18 Mar 2011 10:39:07 -0700 (PDT) Received: by 10.14.37.71 with SMTP id x47mr95993eea.60.1300469946988; Fri, 18 Mar 2011 10:39:06 -0700 (PDT) Received: from mail-ew0-f50.google.com (mail-ew0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id s8si294917eeh.88.2011.03.18.10.39.06 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 10:39:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of alexandros.frantzis@linaro.org) client-ip=209.85.215.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.50 is neither permitted nor denied by best guess record for domain of alexandros.frantzis@linaro.org) smtp.mail=alexandros.frantzis@linaro.org Received: by mail-ew0-f50.google.com with SMTP id 10so1157803ewy.37 for ; Fri, 18 Mar 2011 10:39:06 -0700 (PDT) Received: by 10.213.97.27 with SMTP id j27mr611774ebn.97.1300469946424; Fri, 18 Mar 2011 10:39:06 -0700 (PDT) Received: from localhost (77.49.212.182.dsl.dyn.forthnet.gr [77.49.212.182]) by mx.google.com with ESMTPS id q53sm93382eeh.4.2011.03.18.10.39.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 10:39:05 -0700 (PDT) From: alexandros.frantzis@linaro.org To: pixman@lists.freedesktop.org Subject: [PATCH 2/2] Add support for the r8g8b8a8 and r8g8b8x8 formats to the tests. Date: Fri, 18 Mar 2011 19:38:55 +0200 Message-Id: <1300469935-28431-3-git-send-email-alexandros.frantzis@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300469935-28431-1-git-send-email-alexandros.frantzis@linaro.org> References: <1300469935-28431-1-git-send-email-alexandros.frantzis@linaro.org> From: Alexandros Frantzis --- test/blitters-test.c | 9 +++++++-- test/composite.c | 9 +++++++++ test/fetch-test.c | 10 ++++++++++ test/stress-test.c | 2 ++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/test/blitters-test.c b/test/blitters-test.c index 63e7cb3..3ecfb09 100644 --- a/test/blitters-test.c +++ b/test/blitters-test.c @@ -88,8 +88,11 @@ free_random_image (uint32_t initcrc, uint32_t *data = pixman_image_get_data (img); uint32_t mask = (1 << PIXMAN_FORMAT_DEPTH (fmt)) - 1; - if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_BGRA) + if (PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_BGRA || + PIXMAN_FORMAT_TYPE (fmt) == PIXMAN_TYPE_RGBA) + { mask <<= (PIXMAN_FORMAT_BPP (fmt) - PIXMAN_FORMAT_DEPTH (fmt)); + } for (i = 0; i < 32; i++) mask |= mask << (i * PIXMAN_FORMAT_BPP (fmt)); @@ -182,6 +185,8 @@ static pixman_format_code_t img_fmt_list[] = { PIXMAN_x8b8g8r8, PIXMAN_b8g8r8a8, PIXMAN_b8g8r8x8, + PIXMAN_r8g8b8a8, + PIXMAN_r8g8b8x8, PIXMAN_x14r6g6b6, PIXMAN_r8g8b8, PIXMAN_b8g8r8, @@ -412,6 +417,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0x1DB8BDF8, + 0x265CDFEB, test_composite, argc, argv); } diff --git a/test/composite.c b/test/composite.c index a86e5ed..df779dc 100644 --- a/test/composite.c +++ b/test/composite.c @@ -102,6 +102,8 @@ static const format_t formats[] = P(x8b8g8r8), P(b8g8r8a8), P(b8g8r8x8), + P(r8g8b8a8), + P(r8g8b8x8), P(x2r10g10b10), P(x2b10g10r10), P(a2r10g10b10), @@ -556,6 +558,13 @@ get_pixel (pixman_image_t *image, bs = g + gs; break; + case PIXMAN_TYPE_RGBA: + as = 0; + bs = PIXMAN_FORMAT_BPP (format) - (b + g + r); + gs = b + bs; + rs = g + gs; + break; + case PIXMAN_TYPE_A: as = 0; rs = 0; diff --git a/test/fetch-test.c b/test/fetch-test.c index 60bc765..feb98d9 100644 --- a/test/fetch-test.c +++ b/test/fetch-test.c @@ -34,6 +34,16 @@ static testcase_t testcases[] = NULL, }, { + PIXMAN_r8g8b8a8, + 2, 2, + 8, + { 0x11223300, 0x55667744, + 0x99aabb88, 0xddeeffcc }, + { 0x00112233, 0x44556677, + 0x8899aabb, 0xccddeeff }, + NULL, + }, + { PIXMAN_g1, 8, 2, 4, diff --git a/test/stress-test.c b/test/stress-test.c index 166dc6d..be09e08 100644 --- a/test/stress-test.c +++ b/test/stress-test.c @@ -17,6 +17,8 @@ static const pixman_format_code_t image_formats[] = PIXMAN_x8b8g8r8, PIXMAN_b8g8r8a8, PIXMAN_b8g8r8x8, + PIXMAN_r8g8b8a8, + PIXMAN_r8g8b8x8, PIXMAN_x14r6g6b6, PIXMAN_r8g8b8, PIXMAN_b8g8r8,