Huw Davies : gdi32/tests: Add tests for 4 bpp brushes.

Alexandre Julliard julliard at winehq.org
Tue May 31 13:08:18 CDT 2011


Module: wine
Branch: master
Commit: 4fc0d3c3179998d0bdf58bf383e1a5d07669ca4c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4fc0d3c3179998d0bdf58bf383e1a5d07669ca4c

Author: Huw Davies <huw at codeweavers.com>
Date:   Tue May 31 10:02:06 2011 +0100

gdi32/tests: Add tests for 4 bpp brushes.

---

 dlls/gdi32/tests/dib.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/tests/dib.c b/dlls/gdi32/tests/dib.c
index a0de1b5..4322ed8 100644
--- a/dlls/gdi32/tests/dib.c
+++ b/dlls/gdi32/tests/dib.c
@@ -95,6 +95,7 @@ static const char *sha1_graphics_a8r8g8b8[] =
     "a694872f38e66a7ff471440c3e6a9310ef78328a",
     "d7398de15b2837a58a62a701ca1b3384625afec4",
     "a78b28472bb7ff480ddedd06b9cf2daa775fa7ae",
+    "5246ef357e7317b9d141a3294d300c195da76cb7",
     "e2a8eef4aeda3a0f6c950075acba38f1f9e0814d",
     "8b66f14d51ecdeea12bc993302bb9b7d3ec085a1",
     "7da9dd3d40d44d92deb9883fb7110443c2d5769a",
@@ -122,6 +123,7 @@ static const char *sha1_graphics_a8b8g8r8[] =
     "42fefefe4435570fa8038ec759140c66c76570e9",
     "3369889a67d6c79a24ee15f7d14374f9995215e4",
     "473a1fd07df800c87a5d3286b642ace10c61c6af",
+    "10cd25a0ed5cd8f978d7d68236f81d949b938e84",
     "4851c5b7d5bc18590e787c0c218a592ef504e738",
     "9aa506e3df33e0d5298755aa4144e10eb4b5adcf",
     "abdf003699364fe45fab7dc61e67c606d0063b40",
@@ -149,6 +151,7 @@ static const char *sha1_graphics_r5g5b5[] =
     "4aac89fc18c128eddb69eea658272af53138a1cb",
     "9d21bcfdeaf1ca5d47eb823bdefc24d7a95f4f56",
     "6daaf945a955928c5c124c880522ca4634fb2343",
+    "12a288390d16e1efa99d4185301de48a4d433b14",
     "3a50ce21b3563a604b4fc9f247a30f5a981f1ba6",
     "d7d97e28ed316f6596c737eb83baa5948d86b673",
     "ecc2991277d7314f55b00e0f284ae3703aeef81e",
@@ -176,6 +179,7 @@ static const char *sha1_graphics_r4g4b4[] =
     "6092ccbab6b6e073c6ac8244d122f2cfc453aa38",
     "32b6e0aa79b7e96cd0ab2da167f6463c011023a8",
     "1d283aa4d2b2114f7809fe59357d590c7c779aa7",
+    "29640e2ddd2d3016da14507c3ce9b2ce32f39bb4",
     "d591232bbc2592462c819a9486750f64180518fd",
     "0e183a4c30b3da345129cffe33fe0fc593d8666b",
     "f14d9a4bd8a365b7c8f068a0dad481b6eb2b178b",
@@ -203,6 +207,7 @@ static const char *sha1_graphics_8[] =
     "9552f48b88982633a44001227abb847dae4d06b0",
     "cfc67c325c7cdf96d90af9b3cceb8d0504cbb3b0",
     "7262364067e03c7fa498af1d59d228d6c63b460e",
+    "5241241a355a667ef0834049adf4218e8b3f16b8",
     "1f13ea0034db4b0ffa4ddcff9664fd892058f9cd",
     "3caf512cfddfd463d0750cfe3cadb58548eb2ae8",
     "4e5e7d5fd64818b2b3d3e793c88f603b699d2f0f",
@@ -230,6 +235,7 @@ static const char *sha1_graphics_4[] =
     "5070ecae5085209508f7450d5f21c69737a178e9",
     "0f44e12ecd1ea7e39433890443626d4fc35204a4",
     "eb38683e812fd13dca971ba8f4cfd2b6820d3524",
+    "73bbc83f88f1aaa6df0158b63e70bb3165163163",
     "39c16648cf6c261be71a33cec41867f28e119b94",
     "26ad5116562e7b58c76a26eaf521e2e40899e944",
     "1bcc54eaf8e3c2b7c59ecccb23c240181d7ba8b8",
@@ -404,6 +410,7 @@ static const RECT rectangles[] =
 static const BITMAPINFOHEADER dib_brush_header_32   = {sizeof(BITMAPINFOHEADER), 16, -16, 1, 32, BI_RGB, 0, 0, 0, 0, 0};
 static const BITMAPINFOHEADER dib_brush_header_555  = {sizeof(BITMAPINFOHEADER), 16, -16, 1, 16, BI_RGB, 0, 0, 0, 0, 0};
 static const BITMAPINFOHEADER dib_brush_header_8    = {sizeof(BITMAPINFOHEADER), 16, -16, 1,  8, BI_RGB, 0, 0, 0, 0, 0};
+static const BITMAPINFOHEADER dib_brush_header_4    = {sizeof(BITMAPINFOHEADER), 16, -16, 1,  4, BI_RGB, 0, 0, 0, 0, 0};
 
 static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char ***sha1)
 {
@@ -709,6 +716,31 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char ***sh
     SelectObject(hdc, orig_brush);
     DeleteObject(dib_brush);
 
+    /* 4 bpp dib pattern brush */
+
+    brush_bi->bmiHeader = dib_brush_header_4;
+    dib_brush = CreateDIBPatternBrushPt(brush_bi, DIB_RGB_COLORS);
+
+    SelectObject(hdc, dib_brush);
+    SetBrushOrgEx(hdc, 1, 1, NULL);
+
+    for(i = 0, y = 10; i < 256; i++)
+    {
+        BOOL ret;
+
+        if(!rop_uses_src(rop3[i]))
+        {
+            ret = PatBlt(hdc, 10 + i, y, 100, 20, rop3[i]);
+            ok(ret, "got FALSE for %x\n", rop3[i]);
+            y += 25;
+        }
+    }
+    compare_hash(bmi, bits, sha1, "top-down 4 bpp dib brush patblt");
+    memset(bits, 0xcc, dib_size);
+
+    SelectObject(hdc, orig_brush);
+    SetBrushOrgEx(hdc, 0, 0, NULL);
+
     /* Rectangle */
 
     SelectObject(hdc, solid_pen);




More information about the wine-cvs mailing list