Commit e4105824 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Improve GdipSetMetafileDownLevelRasterizationLimit.

parent 6c061964
......@@ -4028,9 +4028,15 @@ GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *metaf
{
TRACE("(%p,%u)\n", metafile, limitDpi);
if (!metafile)
if (limitDpi == 0)
limitDpi = 96;
if (!metafile || limitDpi < 10)
return InvalidParameter;
if (!metafile->record_dc)
return WrongState;
metafile->limit_dpi = limitDpi;
return Ok;
......
......@@ -428,6 +428,23 @@ static void test_empty(void)
expect(Ok, stat);
ok(limit_dpi == 255, "limit_dpi was %d\n", limit_dpi);
stat = GdipSetMetafileDownLevelRasterizationLimit(metafile, 0);
expect(Ok, stat);
limit_dpi = 0xdeadbeef;
stat = GdipGetMetafileDownLevelRasterizationLimit(metafile, &limit_dpi);
expect(Ok, stat);
ok(limit_dpi == 96, "limit_dpi was %d\n", limit_dpi);
stat = GdipSetMetafileDownLevelRasterizationLimit(metafile, 1);
expect(InvalidParameter, stat);
stat = GdipSetMetafileDownLevelRasterizationLimit(metafile, 9);
expect(InvalidParameter, stat);
stat = GdipSetMetafileDownLevelRasterizationLimit(metafile, 10);
expect(Ok, stat);
stat = GdipGetHemfFromMetafile(metafile, &hemf);
expect(InvalidParameter, stat);
......@@ -445,6 +462,9 @@ static void test_empty(void)
expect(WrongState, stat);
expect(0xdeadbeef, limit_dpi);
stat = GdipSetMetafileDownLevelRasterizationLimit(metafile, 200);
expect(WrongState, stat);
check_metafile(metafile, empty_records, "empty metafile", dst_points, &frame, UnitPixel);
sync_metafile(&metafile, "empty.emf");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment