Daniel Lehman : gdi32/tests: Add test for clipped polygon.

Alexandre Julliard julliard at winehq.org
Wed Jul 18 14:58:04 CDT 2018


Module: wine
Branch: master
Commit: 418514820f03243c192ca5e6dfd0ab00ec740fd7
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=418514820f03243c192ca5e6dfd0ab00ec740fd7

Author: Daniel Lehman <dlehman at esri.com>
Date:   Fri Jul 13 14:41:55 2018 -0700

gdi32/tests: Add test for clipped polygon.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/tests/path.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/dlls/gdi32/tests/path.c b/dlls/gdi32/tests/path.c
index 80145fc..2356b96 100644
--- a/dlls/gdi32/tests/path.c
+++ b/dlls/gdi32/tests/path.c
@@ -1894,6 +1894,31 @@ static void test_all_functions(void)
     ReleaseDC( 0, hdc );
 }
 
+static void test_clipped_polygon_fill(void)
+{
+    const POINT pts[3] = {{-10, -10}, {10, -5}, {0, 10}};
+    HBRUSH brush, oldbrush;
+    HBITMAP bmp, oldbmp;
+    HDC hdc, memdc;
+    COLORREF col;
+
+    hdc = GetDC( 0 );
+    memdc = CreateCompatibleDC( hdc );
+    bmp = CreateCompatibleBitmap( hdc, 20, 20 );
+    brush = CreateSolidBrush( RGB( 0x11, 0x22, 0x33 ) );
+    oldbrush = SelectObject( memdc, brush );
+    oldbmp = SelectObject( memdc, bmp );
+    Polygon( memdc, pts, ARRAY_SIZE(pts) );
+    col = GetPixel( memdc, 1, 1 );
+    todo_wine ok( col == RGB( 0x11, 0x22, 0x33 ), "got %06x\n", col );
+    SelectObject( memdc, oldbrush );
+    SelectObject( memdc, oldbmp );
+    DeleteObject( brush );
+    DeleteObject( bmp );
+    DeleteDC( memdc );
+    ReleaseDC( 0, hdc );
+}
+
 START_TEST(path)
 {
     test_path_state();
@@ -1906,5 +1931,6 @@ START_TEST(path)
     test_rectangle();
     test_roundrect();
     test_ellipse();
+    test_clipped_polygon_fill();
     test_all_functions();
 }




More information about the wine-cvs mailing list