"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/gdiplus/tests/metafile.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

metafile.c  (wine-5.12.tar.xz):metafile.c  (wine-5.13.tar.xz)
skipping to change at line 2956 skipping to change at line 2956
stat = GdipDeleteGraphics(graphics); stat = GdipDeleteGraphics(graphics);
expect(Ok, stat); expect(Ok, stat);
stat = GdipDisposeImage((GpImage*)bitmap); stat = GdipDisposeImage((GpImage*)bitmap);
expect(Ok, stat); expect(Ok, stat);
stat = GdipDisposeImage((GpImage*)metafile); stat = GdipDisposeImage((GpImage*)metafile);
expect(Ok, stat); expect(Ok, stat);
} }
static const emfplus_record drawdriverstring_records[] = {
{ EMR_HEADER },
{ EmfPlusRecordTypeHeader },
{ EmfPlusRecordTypeObject, ObjectTypeFont << 8 },
{ EmfPlusRecordTypeDrawDriverString, 0x8000 },
{ EmfPlusRecordTypeObject, (ObjectTypeFont << 8) | 1 },
{ EmfPlusRecordTypeObject, (ObjectTypeBrush << 8) | 2 },
{ EmfPlusRecordTypeDrawDriverString, 0x1 },
{ EmfPlusRecordTypeEndOfFile },
{ EMR_EOF },
{ 0 }
};
static void test_drawdriverstring(void)
{
static const GpPointF dst_points[3] = {{0.0,0.0},{100.0,0.0},{0.0,100.0}};
static const GpRectF frame = {0.0, 0.0, 100.0, 100.0};
static const PointF solidpos[4] = {{10.0,10.0}, {20.0,10.0}, {30.0,10.0}, {4
0.0,10.0}};
static const PointF hatchpos = {10.0,30.0};
GpBitmap *bitmap;
GpStatus stat;
GpGraphics *graphics;
GpFont *solidfont, *hatchfont;
GpBrush *solidbrush, *hatchbrush;
HDC hdc;
GpMatrix *matrix;
GpMetafile *metafile;
LOGFONTA logfont = { 0 };
hdc = CreateCompatibleDC(0);
strcpy(logfont.lfFaceName, "Times New Roman");
logfont.lfHeight = 12;
logfont.lfCharSet = DEFAULT_CHARSET;
stat = GdipCreateFontFromLogfontA(hdc, &logfont, &solidfont);
if (stat == NotTrueTypeFont || stat == FileNotFound)
{
DeleteDC(hdc);
skip("Times New Roman not installed.\n");
return;
}
stat = GdipCloneFont(solidfont, &hatchfont);
expect(Ok, stat);
stat = GdipRecordMetafile(hdc, EmfTypeEmfPlusOnly, &frame, MetafileFrameUnit
Pixel,
L"winetest", &metafile);
expect(Ok, stat);
DeleteDC(hdc);
hdc = NULL;
stat = GdipGetImageGraphicsContext((GpImage*)metafile, &graphics);
expect(Ok, stat);
stat = GdipCreateSolidFill((ARGB)0xff0000ff, (GpSolidFill**)&solidbrush);
expect(Ok, stat);
stat = GdipCreateHatchBrush(HatchStyleHorizontal, (ARGB)0xff00ff00, (ARGB)0x
ffff0000,
(GpHatch**)&hatchbrush);
expect(Ok, stat);
stat = GdipCreateMatrix(&matrix);
expect(Ok, stat);
stat = GdipDrawDriverString(graphics, L"Test", 4, solidfont, solidbrush, sol
idpos,
DriverStringOptionsCmapLookup, matrix);
expect(Ok, stat);
stat = GdipSetMatrixElements(matrix, 1.5, 0.0, 0.0, 1.5, 0.0, 0.0);
expect(Ok, stat);
stat = GdipDrawDriverString(graphics, L"Test ", 5, hatchfont, hatchbrush, &h
atchpos,
DriverStringOptionsCmapLookup|DriverStringOptionsRealizedAdvance, matrix
);
expect(Ok, stat);
stat = GdipDeleteGraphics(graphics);
graphics = NULL;
check_metafile(metafile, drawdriverstring_records, "drawdriverstring metafil
e", dst_points,
&frame, UnitPixel);
sync_metafile(&metafile, "drawdriverstring.emf");
stat = GdipCreateBitmapFromScan0(100, 100, 0, PixelFormat32bppARGB, NULL, &b
itmap);
expect(Ok, stat);
stat = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
expect(Ok, stat);
play_metafile(metafile, graphics, drawdriverstring_records, "drawdriverstrin
g playback",
dst_points, &frame, UnitPixel);
GdipDeleteMatrix(matrix);
GdipDeleteGraphics(graphics);
GdipDeleteBrush(solidbrush);
GdipDeleteBrush(hatchbrush);
GdipDeleteFont(solidfont);
GdipDeleteFont(hatchfont);
GdipDisposeImage((GpImage*)bitmap);
GdipDisposeImage((GpImage*)metafile);
}
START_TEST(metafile) START_TEST(metafile)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken; ULONG_PTR gdiplusToken;
int myARGC; int myARGC;
char **myARGV; char **myARGV;
HMODULE hmsvcrt; HMODULE hmsvcrt;
int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask); int (CDECL * _controlfp_s)(unsigned int *cur, unsigned int newval, unsigned int mask);
/* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */ /* Enable all FP exceptions except _EM_INEXACT, which gdi32 can trigger */
skipping to change at line 3005 skipping to change at line 3109
test_converttoemfplus(); test_converttoemfplus();
test_frameunit(); test_frameunit();
test_containers(); test_containers();
test_clipping(); test_clipping();
test_gditransform(); test_gditransform();
test_drawimage(); test_drawimage();
test_properties(); test_properties();
test_drawpath(); test_drawpath();
test_fillpath(); test_fillpath();
test_restoredc(); test_restoredc();
test_drawdriverstring();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 114 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)