34#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got)
60 ok( !
ret,
"WidenPath succeeded\n" );
65 ok( !
ret,
"WidenPath succeeded\n" );
69 ok( !
ret,
"WidenPath succeeded\n" );
83 ok( !
ret,
"WidenPath succeeded\n" );
94 ok( !
ret,
"WidenPath succeeded\n" );
108 ok( !
ret,
"WidenPath succeeded\n" );
114 ok( !
ret,
"FlattenPath succeeded\n" );
120 ok( !
ret,
"StrokePath succeeded\n" );
126 ok( !
ret,
"FillPath succeeded\n" );
132 ok( !
ret,
"StrokeAndFillPath succeeded\n" );
138 ok( !
ret,
"SelectClipPath succeeded\n" );
144 ok( !rgn,
"PathToRegion succeeded\n" );
150 ok( !
ret,
"SelectClipPath succeeded\n" );
156 ok( !
ret,
"CloseFigure succeeded\n" );
165 ok( !
ret,
"WidenPath succeeded\n" );
173 ok( !
ret,
"FlattenPath succeeded\n" );
181 ok( !
ret,
"StrokePath succeeded\n" );
189 ok( !
ret,
"FillPath succeeded\n" );
197 ok( !
ret,
"StrokeAndFillPath succeeded\n" );
206 ok( !
ret,
"SelectClipPath succeeded\n" );
215 ok( !rgn,
"PathToRegion succeeded\n" );
222 ok(
ret,
"CloseFigure failed\n" );
229 ok(
ret,
"WidenPath failed\n" );
236 ok(
ret,
"FlattenPath failed\n" );
243 ok(
ret,
"StrokePath failed\n" );
249 ok(
ret,
"FillPath failed\n" );
255 ok(
ret,
"StrokeAndFillPath failed\n" );
262 ok(
ret,
"SelectClipPath failed\n" );
269 ok( !
ret,
"SelectClipPath succeeded on empty path\n" );
277 ok( rgn != 0,
"PathToRegion failed\n" );
285 ok( !rgn,
"PathToRegion succeeded on empty path\n" );
294 ok( !
ret,
"CloseFigure succeeded\n" );
303 ok( !
ret,
"EndPath succeeded\n" );
314 HPEN greenPen, narrowPen;
343 ok(
WidenPath(
hdc),
"WidenPath fails while widening a poyline path.\n");
347 ok(
nSize != -1,
"GetPath fails after calling WidenPath.\n");
348 ok(
nSize > 6,
"Path number of points is too low. Should be more than 6 but is %d\n",
nSize);
357 "WidenPath fails while widening an open path. Return value is %d, should be %d. Error is %u\n",
ret,
FALSE,
GetLastError());
370 ok(
nSize > 6,
"WidenPath should compute a widened path with a 1px wide pen. Path length is %d, should be more than 6\n",
nSize);
403 static const char *type_string[8] = {
"Unknown (0)",
"PT_CLOSEFIGURE",
"PT_LINETO",
404 "PT_LINETO | PT_CLOSEFIGURE",
"PT_BEZIERTO",
405 "PT_BEZIERTO | PT_CLOSEFIGURE",
"PT_MOVETO",
"PT_MOVETO | PT_CLOSEFIGURE"};
414 if (
size <= 0)
return;
424 ok(
size == expected_size,
"%s: Path size %d does not match expected size %d\n",
431 static const int fudge = 2;
442 "%s: Expected #%d: %s position (%d,%d) but got (%d,%d)\n",
path_name,
idx,
489 if (!
ArcTo(
hdc, 200, 200, 400, 300, 200, 200, 400, 300) &&
493 win_skip(
"ArcTo is not available\n");
497 ArcTo(
hdc, 210, 210, 390, 290, 390, 290, 210, 210);
539 win_skip(
"AngleArc is not available\n");
588 {15, 15}, {15, 20}, {20, 20}, {20, 25},
590 {30, 30}, {30, 35}, {35, 35}, {35, 40},
591 {40, 40}, {40, 45}, {45, 45},
593 {50, 55}, {45, 50}, {55, 60},
594 {60, 60}, {60, 65}, {65, 65},
595 {70, 70}, {75, 70}, {75, 75}, {80, 80}};
618 ok(
pos.x == -20 &&
pos.y == -20,
"wrong pos %d,%d\n",
pos.x,
pos.y );
625 win_skip(
"PolyDraw is not available\n");
630 ok(
pos.x == 10 &&
pos.y == 15,
"wrong pos %d,%d\n",
pos.x,
pos.y );
633 ok(
pos.x == -10 &&
pos.y == -10,
"wrong pos %d,%d\n",
pos.x,
pos.y );
637 ok(
pos.x == 100 &&
pos.y == 100,
"wrong pos %d,%d\n",
pos.x,
pos.y );
640 ok(
pos.x == 95 &&
pos.y == 95,
"wrong pos %d,%d\n",
pos.x,
pos.y );
645 ok(
pos.x == 10 &&
pos.y == 15,
"wrong pos %d,%d\n",
pos.x,
pos.y );
650 ok(
pos.x == 10 &&
pos.y == 15,
"wrong pos %d,%d\n",
pos.x,
pos.y );
654 ok(
pos.x == 10 &&
pos.y == 15,
"wrong pos %d,%d\n",
pos.x,
pos.y );
659 ok(
pos.x == 35 &&
pos.y == 40,
"wrong pos %d,%d\n",
pos.x,
pos.y );
664 ok(
pos.x == 35 &&
pos.y == 40,
"wrong pos %d,%d\n",
pos.x,
pos.y );
669 ok(
pos.x == 35 &&
pos.y == 40,
"wrong pos %d,%d\n",
pos.x,
pos.y );
674 ok(
pos.x == 35 &&
pos.y == 40,
"wrong pos %d,%d\n",
pos.x,
pos.y );
679 ok(
pos.x == 65 &&
pos.y == 65,
"wrong pos %d,%d\n",
pos.x,
pos.y );
684 ok(
pos.x == 80 &&
pos.y == 80,
"wrong pos %d,%d\n",
pos.x,
pos.y );
689 ok(
pos.x == 80 &&
pos.y == 80,
"wrong pos %d,%d\n",
pos.x,
pos.y );
695 int nSize, nSizeWitness;
701 ok(
pos.x == 100 &&
pos.y == 100,
"wrong pos %d,%d\n",
pos.x,
pos.y );
705 ok(
pos.x == 100 &&
pos.y == 100,
"wrong pos %d,%d\n",
pos.x,
pos.y );
708 ok(
pos.x == 95 &&
pos.y == 95,
"wrong pos %d,%d\n",
pos.x,
pos.y );
711 ok(
pos.x == 95 &&
pos.y == 0,
"wrong pos %d,%d\n",
pos.x,
pos.y );
714 ok(
pos.x == 0 &&
pos.y == 95,
"wrong pos %d,%d\n",
pos.x,
pos.y );
718 ok(
pos.x == 0 &&
pos.y == 95,
"wrong pos %d,%d\n",
pos.x,
pos.y );
721 ok(
pos.x == 0 &&
pos.y == 95,
"wrong pos %d,%d\n",
pos.x,
pos.y );
735 ok(
nSize == nSizeWitness,
"Wrong number of points, no point should be added by CloseFigure\n");
743 ok((*pt)->x ==
x && (*pt)->y ==
y,
"point mismatch expect(%d,%d) got(%d,%d)\n",
744 (*pt)->x, (*pt)->y,
x,
y);
753 static const POINT array_10_20_20_40[] = {{10,20},{10,21},{11,22},{11,23},
754 {12,24},{12,25},{13,26},{13,27},
755 {14,28},{14,29},{15,30},{15,31},
756 {16,32},{16,33},{17,34},{17,35},
757 {18,36},{18,37},{19,38},{19,39},
759 static const POINT array_10_20_20_43[] = {{10,20},{10,21},{11,22},{11,23},
760 {12,24},{12,25},{13,26},{13,27},
761 {13,28},{14,29},{14,30},{15,31},
762 {15,32},{16,33},{16,34},{17,35},
763 {17,36},{17,37},{18,38},{18,39},
764 {19,40},{19,41},{20,42},{-1,-1}};
766 static const POINT array_10_20_10_20[] = {{-1,-1}};
767 static const POINT array_10_20_11_27[] = {{10,20},{10,21},{10,22},{10,23},
768 {11,24},{11,25},{11,26},{-1,-1}};
770 static const POINT array_20_43_10_20[] = {{20,43},{20,42},{19,41},{19,40},
771 {18,39},{18,38},{17,37},{17,36},
772 {17,35},{16,34},{16,33},{15,32},
773 {15,31},{14,30},{14,29},{13,28},
774 {13,27},{13,26},{12,25},{12,24},
775 {11,23},{11,22},{10,21},{-1,-1}};
777 static const POINT array_20_20_10_43[] = {{20,20},{20,21},{19,22},{19,23},
778 {18,24},{18,25},{17,26},{17,27},
779 {17,28},{16,29},{16,30},{15,31},
780 {15,32},{14,33},{14,34},{13,35},
781 {13,36},{13,37},{12,38},{12,39},
782 {11,40},{11,41},{10,42},{-1,-1}};
784 static const POINT array_20_20_43_10[] = {{20,20},{21,20},{22,19},{23,19},
785 {24,18},{25,18},{26,17},{27,17},
786 {28,17},{29,16},{30,16},{31,15},
787 {32,15},{33,14},{34,14},{35,13},
788 {36,13},{37,13},{38,12},{39,12},
789 {40,11},{41,11},{42,10},{-1,-1}};
792 pt = array_10_20_20_40;
794 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
796 pt = array_10_20_20_43;
798 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
800 pt = array_10_20_10_20;
802 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
804 pt = array_10_20_11_27;
806 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
808 pt = array_20_43_10_20;
810 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
812 pt = array_20_20_10_43;
814 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
816 pt = array_20_20_43_10;
818 ok(
pt->x == -1 &&
pt->y == -1,
"didn't find terminator\n");
1864 POINT pts[9] = {{10, 10}, {20, 10}, {10, 20}, {20, 20}, {30, 30}, {40, 20},
1865 {20, 30}, {30, 40}, {10, 50}};
1866 DWORD counts[5] = {4, 5, 0, 1, 2};
1879 Arc(
hdc, 21, 21, 39, 29, 39, 29, 21, 21 );
1881 ArcTo(
hdc, 23, 23, 37, 27, 37, 27, 23, 23 );
1883 Chord(
hdc, 42, 43, 57, 66, 39, 29, 21, 21 );
1885 Pie(
hdc, 52, 54, 65, 68, 39, 29, 21, 21 );
#define ERROR_CALL_NOT_IMPLEMENTED
#define HeapFree(x, y, z)
static char * path_name(DOS_FILE *file)
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
static void test_arcto(void)
static void test_widenpath(void)
static void test_all_functions(void)
static void WINAPI linedda_callback(INT x, INT y, LPARAM lparam)
static void test_ellipse(void)
static const path_test_t roundrect_path[]
static const path_test_t arcto_path[]
static void test_path_state(void)
static void test_rectangle(void)
static const path_test_t all_funcs_path[]
static const path_test_t anglearc_path[]
#define expect(expected, got)
static POINT polydraw_pts[]
static void test_closefigure(void)
static const path_test_t ellipse_path[]
static void ok_path(HDC hdc, const char *path_name, const path_test_t *expected, int expected_size)
static void test_roundrect(void)
static const path_test_t rectangle_path[]
static void test_linedda(void)
static void test_polydraw(void)
static BYTE polydraw_tps[]
static const path_test_t polydraw_path[]
static void test_anglearc(void)
BOOL Polygon(CONST PPOINT UnsafePoints, int Count, int polyFillMode)
BITMAPINFOHEADER bmiHeader
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
DWORD WINAPI GetLastError(void)
*nSize LPSTR _Inout_ LPDWORD nSize
#define ERROR_CAN_NOT_COMPLETE
int WINAPI SetMapMode(_In_ HDC, _In_ int)
BOOL WINAPI ArcTo(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom, _In_ INT xRadial1, _In_ INT yRadial1, _In_ INT xRadial2, _In_ INT yRadial2)
BOOL WINAPI Chord(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom, _In_ INT xRadial1, _In_ INT yRadial1, _In_ INT xRadial2, _In_ INT yRadial2)
BOOL WINAPI PolyBezier(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
BOOL WINAPI Polyline(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ int cpt)
BOOL WINAPI Ellipse(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI PolylineTo(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
int WINAPI SetGraphicsMode(_In_ HDC, _In_ int)
BOOL WINAPI SetViewportExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
BOOL WINAPI GetCurrentPositionEx(_In_ HDC, _Out_ LPPOINT)
BOOL WINAPI PolyBezierTo(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_ DWORD cpt)
BOOL WINAPI LineDDA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ LINEDDAPROC, _In_opt_ LPARAM)
int WINAPI SetArcDirection(_In_ HDC, _In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI SelectClipPath(_In_ HDC, _In_ int)
BOOL WINAPI FlattenPath(_In_ HDC)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI FillPath(_In_ HDC)
BOOL WINAPI SetWindowExtEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPSIZE)
BOOL WINAPI RestoreDC(_In_ HDC, _In_ int)
HRGN WINAPI PathToRegion(_In_ HDC)
BOOL WINAPI StrokePath(_In_ HDC)
#define AD_COUNTERCLOCKWISE
BOOL WINAPI StrokeAndFillPath(_In_ HDC)
BOOL WINAPI WidenPath(_In_ HDC)
struct tagBITMAPINFO BITMAPINFO
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI RoundRect(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI DeleteDC(_In_ HDC)
BOOL WINAPI PolyDraw(_In_ HDC hdc, _In_reads_(cpt) const POINT *apt, _In_reads_(cpt) const BYTE *aj, _In_ int cpt)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI PolyPolygon(_In_ HDC hdc, _In_ const POINT *apt, _In_reads_(csz) const INT *asz, _In_ int csz)
BOOL WINAPI EndPath(_In_ HDC)
BOOL WINAPI AngleArc(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ DWORD dwRadius, _In_ FLOAT eStartAngle, _In_ FLOAT eSweepAngle)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
BOOL WINAPI BeginPath(_In_ HDC hdc)
BOOL WINAPI PolyPolyline(_In_ HDC hdc, _In_ const POINT *apt, _In_reads_(csz) const DWORD *asz, _In_ DWORD csz)
int WINAPI SaveDC(_In_ HDC)
BOOL WINAPI CloseFigure(_In_ HDC hdc)
int WINAPI GetPath(_In_ HDC hdc, _Out_writes_opt_(cpt) LPPOINT apt, _Out_writes_opt_(cpt) LPBYTE aj, int cpt)
BOOL WINAPI AbortPath(_In_ HDC hdc)
BOOL WINAPI Pie(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)