gdi32: Add support in DeviceCaps CURVECAPS, LINECAPS, POLYGONALCAPS for EnhMetafiles.

This commit is contained in:
Alistair Leslie-Hughes 2011-05-18 14:24:01 +10:00 committed by Alexandre Julliard
parent 73b9acf273
commit 5a7dba5a70
2 changed files with 20 additions and 0 deletions

View File

@ -541,6 +541,15 @@ INT CDECL EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap)
return physDev->planes;
case NUMCOLORS:
return physDev->numcolors;
case CURVECAPS:
return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT);
case LINECAPS:
return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
LC_STYLED | LC_WIDESTYLED | LC_INTERIORS);
case POLYGONALCAPS:
return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE |
PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS);
default:
FIXME("Unimplemented cap %d\n", cap);
return 0;

View File

@ -2806,6 +2806,7 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc)
METAHEADER *mh = NULL;
METARECORD *rec;
INT horz_res, vert_res, horz_size, vert_size;
INT curve_caps, line_caps, poly_caps;
display_dc = GetDC(NULL);
ok(display_dc != NULL, "display_dc is NULL\n");
@ -2817,6 +2818,16 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc)
emf_dc = CreateEnhMetaFileA(display_dc, NULL, rc, NULL);
ok(emf_dc != NULL, "emf_dc is NULL\n");
curve_caps = GetDeviceCaps(emf_dc, CURVECAPS);
ok(curve_caps == 511, "expect 511 got %d\n", curve_caps);
line_caps = GetDeviceCaps(emf_dc, LINECAPS);
ok(line_caps == 254, "expect 254 got %d\n", line_caps);
poly_caps = GetDeviceCaps(emf_dc, POLYGONALCAPS);
ok(poly_caps == 255, "expect 511 got %d\n", poly_caps);
for(i = 0; i < 3000; i++) /* This is enough to take emf_size > 0xffff */
Rectangle(emf_dc, 0, 0, 1000, 20);
emf = CloseEnhMetaFile(emf_dc);