Alexander Dorofeyev : ddraw/tests: Add KEYSRCOVERRIDE test in p8_primary_test.

Alexandre Julliard julliard at winehq.org
Fri May 9 06:27:19 CDT 2008


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

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Fri May  9 01:12:30 2008 +0300

ddraw/tests: Add KEYSRCOVERRIDE test in p8_primary_test.

---

 dlls/ddraw/tests/visual.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c
index 8bbd14c..5b67d45 100644
--- a/dlls/ddraw/tests/visual.c
+++ b/dlls/ddraw/tests/visual.c
@@ -2314,6 +2314,31 @@ static void p8_primary_test()
             "got R %02X G %02X B %02X, expected R 00 G 00 B FF\n",
             GetRValue(color), GetGValue(color), GetBValue(color));
 
+    rect.left = 100;
+    rect.top = 200;
+    rect.right = 116;
+    rect.bottom = 216;
+
+    memset(&ddbltfx, 0, sizeof(ddbltfx));
+    ddbltfx.dwSize = sizeof(ddbltfx);
+    ddbltfx.ddckSrcColorkey.dwColorSpaceLowValue = ddbltfx.ddckSrcColorkey.dwColorSpaceHighValue = 2;
+    hr = IDirectDrawSurface_Blt(Surface1, &rect, offscreen, NULL,
+        DDBLT_WAIT | DDBLT_KEYSRC | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
+    ok(hr==DDERR_INVALIDPARAMS, "IDirectDrawSurface_Blt returned: %x\n", hr);
+    hr = IDirectDrawSurface_Blt(Surface1, &rect, offscreen, NULL,
+        DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &ddbltfx);
+    ok(hr==DD_OK, "IDirectDrawSurface_Blt returned: %x\n", hr);
+
+    color = getPixelColor_GDI(Surface1, 105, 205);
+    ok(GetRValue(color) == 0x80 && GetGValue(color) == 0 && GetBValue(color) == 0,
+            "got R %02X G %02X B %02X, expected R 80 G 00 B 00\n",
+            GetRValue(color), GetGValue(color), GetBValue(color));
+
+    color = getPixelColor_GDI(Surface1, 112, 212);
+    ok(GetRValue(color) == 0 && GetGValue(color) == 0xFF && GetBValue(color) == 0,
+            "got R %02X G %02X B %02X, expected R 00 G FF B 00\n",
+            GetRValue(color), GetGValue(color), GetBValue(color));
+
     /* Test blitting and locking patterns that are likely to trigger bugs in opengl renderer (p8
        surface conversion and uploading/downloading to/from opengl texture). Similar patterns (
        blitting front buffer areas to/from an offscreen surface mixed with locking) are used by C&C




More information about the wine-cvs mailing list