[GDIPLUS]

* Sync with Wine 1.5.26.

svn path=/trunk/; revision=59073
This commit is contained in:
Amine Khaldi 2013-05-23 17:23:00 +00:00
parent 5d69f70bd6
commit f1d5f64d5f
11 changed files with 263 additions and 684 deletions

View file

@ -973,7 +973,7 @@ GpStatus WINGDIPAPI GdipGetLineWrapMode(GpLineGradient *brush, GpWrapMode *wrapm
{ {
TRACE("(%p, %p)\n", brush, wrapmode); TRACE("(%p, %p)\n", brush, wrapmode);
if(!brush || !wrapmode) if(!brush || !wrapmode || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
*wrapmode = brush->wrap; *wrapmode = brush->wrap;
@ -986,7 +986,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientBlend(GpPathGradient *brush, REAL *blend,
{ {
TRACE("(%p, %p, %p, %d)\n", brush, blend, positions, count); TRACE("(%p, %p, %p, %d)\n", brush, blend, positions, count);
if(!brush || !blend || !positions || count <= 0) if(!brush || !blend || !positions || count <= 0 || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
if(count < brush->blendcount) if(count < brush->blendcount)
@ -1004,7 +1004,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(GpPathGradient *brush, INT *co
{ {
TRACE("(%p, %p)\n", brush, count); TRACE("(%p, %p)\n", brush, count);
if(!brush || !count) if(!brush || !count || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*count = brush->blendcount; *count = brush->blendcount;
@ -1017,7 +1017,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad,
{ {
TRACE("(%p, %p)\n", grad, point); TRACE("(%p, %p)\n", grad, point);
if(!grad || !point) if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
point->X = grad->center.X; point->X = grad->center.X;
@ -1052,7 +1052,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientCenterColor(GpPathGradient *grad,
{ {
TRACE("(%p,%p)\n", grad, colors); TRACE("(%p,%p)\n", grad, colors);
if (!grad || !colors) if (!grad || !colors || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*colors = grad->centercolor; *colors = grad->centercolor;
@ -1065,7 +1065,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad,
{ {
TRACE("(%p, %p, %p)\n", grad, x, y); TRACE("(%p, %p, %p)\n", grad, x, y);
if(!grad || !x || !y) if(!grad || !x || !y || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*x = grad->focus.X; *x = grad->focus.X;
@ -1079,7 +1079,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient *grad,
{ {
TRACE("(%p, %p)\n", grad, gamma); TRACE("(%p, %p)\n", grad, gamma);
if(!grad || !gamma) if(!grad || !gamma || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*gamma = grad->gamma; *gamma = grad->gamma;
@ -1104,7 +1104,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient *grad,
{ {
TRACE("(%p, %p)\n", grad, count); TRACE("(%p, %p)\n", grad, count);
if(!grad || !count) if(!grad || !count || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*count = grad->path->pathdata.Count; *count = grad->path->pathdata.Count;
@ -1118,7 +1118,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect
TRACE("(%p, %p)\n", brush, rect); TRACE("(%p, %p)\n", brush, rect);
if(!brush || !rect) if(!brush || !rect || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
stat = GdipGetPathWorldBounds(brush->path, rect, NULL, NULL); stat = GdipGetPathWorldBounds(brush->path, rect, NULL, NULL);
@ -1154,7 +1154,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient
TRACE("(%p,%p,%p)\n", grad, argb, count); TRACE("(%p,%p,%p)\n", grad, argb, count);
if(!grad || !argb || !count || (*count < grad->path->pathdata.Count)) if(!grad || !argb || !count || (*count < grad->path->pathdata.Count) || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
for (i=0; i<grad->path->pathdata.Count; i++) for (i=0; i<grad->path->pathdata.Count; i++)
@ -1174,7 +1174,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorCount(GpPathGradient *brush,
{ {
TRACE("(%p, %p)\n", brush, count); TRACE("(%p, %p)\n", brush, count);
if (!brush || !count) if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
/* Yes, this actually returns the number of points in the path (which is the /* Yes, this actually returns the number of points in the path (which is the
@ -1191,7 +1191,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient *brush,
{ {
TRACE("(%p, %p)\n", brush, wrapmode); TRACE("(%p, %p)\n", brush, wrapmode);
if(!brush || !wrapmode) if(!brush || !wrapmode || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*wrapmode = brush->wrap; *wrapmode = brush->wrap;
@ -1302,7 +1302,7 @@ GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush,
TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count); TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
if(!brush || !factors || !positions || count <= 0 || if(!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient ||
(count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f))) (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f)))
return InvalidParameter; return InvalidParameter;
@ -1334,7 +1334,7 @@ GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient *brush, REAL *factors,
{ {
TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count); TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
if (!brush || !factors || !positions || count <= 0) if (!brush || !factors || !positions || count <= 0 || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
if (count < brush->blendcount) if (count < brush->blendcount)
@ -1350,7 +1350,7 @@ GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient *brush, INT *count)
{ {
TRACE("(%p, %p)\n", brush, count); TRACE("(%p, %p)\n", brush, count);
if (!brush || !count) if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
*count = brush->blendcount; *count = brush->blendcount;
@ -1363,7 +1363,7 @@ GpStatus WINGDIPAPI GdipSetLineGammaCorrection(GpLineGradient *line,
{ {
TRACE("(%p, %d)\n", line, usegamma); TRACE("(%p, %d)\n", line, usegamma);
if(!line) if(!line || line->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
line->gamma = usegamma; line->gamma = usegamma;
@ -1385,7 +1385,7 @@ GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient *line, REAL focus,
TRACE("(%p, %0.2f, %0.2f)\n", line, focus, scale); TRACE("(%p, %0.2f, %0.2f)\n", line, focus, scale);
if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0) if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || line->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
/* we want 2 standard deviations */ /* we want 2 standard deviations */
@ -1432,7 +1432,7 @@ GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient *line,
{ {
TRACE("(%p, %d)\n", line, wrap); TRACE("(%p, %d)\n", line, wrap);
if(!line || wrap == WrapModeClamp) if(!line || wrap == WrapModeClamp || line->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
line->wrap = wrap; line->wrap = wrap;
@ -1447,7 +1447,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST RE
TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count); TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
if(!brush || !blend || !pos || count <= 0 || if(!brush || !blend || !pos || count <= 0 || brush->brush.bt != BrushTypePathGradient ||
(count >= 2 && (pos[0] != 0.0f || pos[count-1] != 1.0f))) (count >= 2 && (pos[0] != 0.0f || pos[count-1] != 1.0f)))
return InvalidParameter; return InvalidParameter;
@ -1483,7 +1483,8 @@ GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend(GpPathGradient *brush,
TRACE("(%p,%0.2f,%0.2f)\n", brush, focus, scale); TRACE("(%p,%0.2f,%0.2f)\n", brush, focus, scale);
if (!brush) return InvalidParameter; if (!brush || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter;
if (focus != 0.0) if (focus != 0.0)
{ {
@ -1513,7 +1514,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient *brush,
REAL *new_pos; REAL *new_pos;
TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count); TRACE("(%p,%p,%p,%i)\n", brush, blend, pos, count);
if (!brush || !blend || !pos || count < 2 || if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient ||
pos[0] != 0.0f || pos[count-1] != 1.0f) pos[0] != 0.0f || pos[count-1] != 1.0f)
{ {
return InvalidParameter; return InvalidParameter;
@ -1549,7 +1550,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPresetBlend(GpPathGradient *brush,
if (count < 0) if (count < 0)
return OutOfMemory; return OutOfMemory;
if (!brush || !blend || !pos || count < 2) if (!brush || !blend || !pos || count < 2 || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
if (brush->pblendcount == 0) if (brush->pblendcount == 0)
@ -1573,7 +1574,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientPresetBlendCount(GpPathGradient *brush,
{ {
TRACE("(%p,%p)\n", brush, count); TRACE("(%p,%p)\n", brush, count);
if (!brush || !count) if (!brush || !count || brush->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*count = brush->pblendcount; *count = brush->pblendcount;
@ -1586,7 +1587,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad,
{ {
TRACE("(%p, %x)\n", grad, argb); TRACE("(%p, %x)\n", grad, argb);
if(!grad) if(!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->centercolor = argb; grad->centercolor = argb;
@ -1598,7 +1599,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad,
{ {
TRACE("(%p, %s)\n", grad, debugstr_pointf(point)); TRACE("(%p, %s)\n", grad, debugstr_pointf(point));
if(!grad || !point) if(!grad || !point || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->center.X = point->X; grad->center.X = point->X;
@ -1628,7 +1629,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient *grad,
{ {
TRACE("(%p, %.2f, %.2f)\n", grad, x, y); TRACE("(%p, %.2f, %.2f)\n", grad, x, y);
if(!grad) if(!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->focus.X = x; grad->focus.X = x;
@ -1642,7 +1643,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection(GpPathGradient *grad,
{ {
TRACE("(%p, %d)\n", grad, gamma); TRACE("(%p, %d)\n", grad, gamma);
if(!grad) if(!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->gamma = gamma; grad->gamma = gamma;
@ -1664,7 +1665,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient *grad,
TRACE("(%p,%0.2f,%0.2f)\n", grad, focus, scale); TRACE("(%p,%0.2f,%0.2f)\n", grad, focus, scale);
if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0) if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0 || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
/* we want 2 standard deviations */ /* we want 2 standard deviations */
@ -1714,7 +1715,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient
TRACE("(%p,%p,%p)\n", grad, argb, count); TRACE("(%p,%p,%p)\n", grad, argb, count);
if(!grad || !argb || !count || (*count <= 0) || if(!grad || !argb || !count || (*count <= 0) || grad->brush.bt != BrushTypePathGradient ||
(*count > grad->path->pathdata.Count)) (*count > grad->path->pathdata.Count))
return InvalidParameter; return InvalidParameter;
@ -1750,7 +1751,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient *grad,
{ {
TRACE("(%p, %d)\n", grad, wrap); TRACE("(%p, %d)\n", grad, wrap);
if(!grad) if(!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->wrap = wrap; grad->wrap = wrap;
@ -1763,7 +1764,7 @@ GpStatus WINGDIPAPI GdipSetPathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%p)\n", grad, matrix); TRACE("(%p,%p)\n", grad, matrix);
if (!grad || !matrix) if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
grad->transform = *matrix; grad->transform = *matrix;
@ -1776,7 +1777,7 @@ GpStatus WINGDIPAPI GdipGetPathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%p)\n", grad, matrix); TRACE("(%p,%p)\n", grad, matrix);
if (!grad || !matrix) if (!grad || !matrix || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
*matrix = grad->transform; *matrix = grad->transform;
@ -1789,7 +1790,7 @@ GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%p,%i)\n", grad, matrix, order); TRACE("(%p,%p,%i)\n", grad, matrix, order);
if (!grad) if (!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
return GdipMultiplyMatrix(&grad->transform, matrix, order); return GdipMultiplyMatrix(&grad->transform, matrix, order);
@ -1799,7 +1800,7 @@ GpStatus WINGDIPAPI GdipResetPathGradientTransform(GpPathGradient *grad)
{ {
TRACE("(%p)\n", grad); TRACE("(%p)\n", grad);
if (!grad) if (!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
return GdipSetMatrixElements(&grad->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0); return GdipSetMatrixElements(&grad->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
@ -1810,7 +1811,7 @@ GpStatus WINGDIPAPI GdipRotatePathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%0.2f,%i)\n", grad, angle, order); TRACE("(%p,%0.2f,%i)\n", grad, angle, order);
if (!grad) if (!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
return GdipRotateMatrix(&grad->transform, angle, order); return GdipRotateMatrix(&grad->transform, angle, order);
@ -1821,7 +1822,7 @@ GpStatus WINGDIPAPI GdipScalePathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, sx, sy, order); TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, sx, sy, order);
if (!grad) if (!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
return GdipScaleMatrix(&grad->transform, sx, sy, order); return GdipScaleMatrix(&grad->transform, sx, sy, order);
@ -1832,7 +1833,7 @@ GpStatus WINGDIPAPI GdipTranslatePathGradientTransform(GpPathGradient *grad,
{ {
TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, dx, dy, order); TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, dx, dy, order);
if (!grad) if (!grad || grad->brush.bt != BrushTypePathGradient)
return InvalidParameter; return InvalidParameter;
return GdipTranslateMatrix(&grad->transform, dx, dy, order); return GdipTranslateMatrix(&grad->transform, dx, dy, order);
@ -1887,7 +1888,7 @@ GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
{ {
TRACE("(%p, %x, %x)\n", brush, color1, color2); TRACE("(%p, %x, %x)\n", brush, color1, color2);
if(!brush) if(!brush || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
brush->startcolor = color1; brush->startcolor = color1;
@ -1900,7 +1901,7 @@ GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
{ {
TRACE("(%p, %p)\n", brush, colors); TRACE("(%p, %p)\n", brush, colors);
if(!brush || !colors) if(!brush || !colors || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
colors[0] = brush->startcolor; colors[0] = brush->startcolor;
@ -1962,7 +1963,7 @@ GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush,
REAL *new_pos; REAL *new_pos;
TRACE("(%p,%p,%p,%i)\n", brush, blend, positions, count); TRACE("(%p,%p,%p,%i)\n", brush, blend, positions, count);
if (!brush || !blend || !positions || count < 2 || if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient ||
positions[0] != 0.0f || positions[count-1] != 1.0f) positions[0] != 0.0f || positions[count-1] != 1.0f)
{ {
return InvalidParameter; return InvalidParameter;
@ -1993,7 +1994,7 @@ GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush,
GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush, GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush,
ARGB *blend, REAL* positions, INT count) ARGB *blend, REAL* positions, INT count)
{ {
if (!brush || !blend || !positions || count < 2) if (!brush || !blend || !positions || count < 2 || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
if (brush->pblendcount == 0) if (brush->pblendcount == 0)
@ -2011,7 +2012,7 @@ GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush,
GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient *brush, GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient *brush,
INT *count) INT *count)
{ {
if (!brush || !count) if (!brush || !count || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
*count = brush->pblendcount; *count = brush->pblendcount;
@ -2113,7 +2114,7 @@ GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
{ {
TRACE("(%p, %p)\n", brush, rect); TRACE("(%p, %p)\n", brush, rect);
if(!brush || !rect) if(!brush || !rect || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
*rect = brush->rect; *rect = brush->rect;
@ -2150,7 +2151,7 @@ GpStatus WINGDIPAPI GdipRotateLineTransform(GpLineGradient* brush,
TRACE("(%p,%0.2f,%u)\n", brush, angle, order); TRACE("(%p,%0.2f,%u)\n", brush, angle, order);
if(!brush) if(!brush || brush->brush.bt != BrushTypeLinearGradient)
return InvalidParameter; return InvalidParameter;
if(!(calls++)) if(!(calls++))

View file

@ -979,12 +979,12 @@ GpStatus WINGDIPAPI GdipIsStyleAvailable(GDIPCONST GpFontFamily* family,
*IsStyleAvailable = FALSE; *IsStyleAvailable = FALSE;
hdc = GetDC(0); hdc = CreateCompatibleDC(0);
if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style)) if(!EnumFontFamiliesW(hdc, family->FamilyName, font_has_style_proc, (LPARAM)style))
*IsStyleAvailable = TRUE; *IsStyleAvailable = TRUE;
ReleaseDC(0, hdc); DeleteDC(hdc);
return Ok; return Ok;
} }
@ -1276,7 +1276,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
HDC hdc; HDC hdc;
LOGFONTW lfw; LOGFONTW lfw;
hdc = GetDC(0); hdc = CreateCompatibleDC(0);
lfw.lfCharSet = DEFAULT_CHARSET; lfw.lfCharSet = DEFAULT_CHARSET;
lstrcpyW(lfw.lfFaceName, name); lstrcpyW(lfw.lfFaceName, name);
@ -1288,7 +1288,7 @@ GpStatus WINGDIPAPI GdipPrivateAddMemoryFont(GpFontCollection* fontCollection,
return OutOfMemory; return OutOfMemory;
} }
ReleaseDC(0, hdc); DeleteDC(hdc);
} }
return Ok; return Ok;
} }
@ -1403,7 +1403,7 @@ GpStatus WINGDIPAPI GdipNewInstalledFontCollection(
HDC hdc; HDC hdc;
LOGFONTW lfw; LOGFONTW lfw;
hdc = GetDC(0); hdc = CreateCompatibleDC(0);
lfw.lfCharSet = DEFAULT_CHARSET; lfw.lfCharSet = DEFAULT_CHARSET;
lfw.lfFaceName[0] = 0; lfw.lfFaceName[0] = 0;
@ -1416,7 +1416,7 @@ GpStatus WINGDIPAPI GdipNewInstalledFontCollection(
return OutOfMemory; return OutOfMemory;
} }
ReleaseDC(0, hdc); DeleteDC(hdc);
} }
*fontCollection = &installedFontCollection; *fontCollection = &installedFontCollection;

View file

@ -442,9 +442,9 @@ void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height,
for (x=0; x<width; x++) for (x=0; x<width; x++)
{ {
BYTE alpha=src[3]; BYTE alpha=src[3];
*dst++ = *src++ * alpha / 255; *dst++ = (*src++ * alpha + 127) / 255;
*dst++ = *src++ * alpha / 255; *dst++ = (*src++ * alpha + 127) / 255;
*dst++ = *src++ * alpha / 255; *dst++ = (*src++ * alpha + 127) / 255;
*dst++ = *src++; *dst++ = *src++;
} }
} }

View file

@ -187,7 +187,7 @@
187 stdcall GdipDrawRectangleI(ptr ptr long long long long) 187 stdcall GdipDrawRectangleI(ptr ptr long long long long)
188 stdcall GdipDrawRectangles(ptr ptr ptr long) 188 stdcall GdipDrawRectangles(ptr ptr ptr long)
189 stdcall GdipDrawRectanglesI(ptr ptr ptr long) 189 stdcall GdipDrawRectanglesI(ptr ptr ptr long)
190 stdcall GdipDrawString(ptr ptr long ptr ptr ptr ptr) 190 stdcall GdipDrawString(ptr wstr long ptr ptr ptr ptr)
191 stdcall GdipEmfToWmfBits(ptr long ptr long long) 191 stdcall GdipEmfToWmfBits(ptr long ptr long long)
192 stdcall GdipEndContainer(ptr ptr) 192 stdcall GdipEndContainer(ptr ptr)
193 stub GdipEnumerateMetafileDestPoint 193 stub GdipEnumerateMetafileDestPoint

View file

@ -158,6 +158,7 @@ struct GpGraphics{
BOOL owndc; BOOL owndc;
BOOL alpha_hdc; BOOL alpha_hdc;
GpImage *image; GpImage *image;
ImageType image_type;
SmoothingMode smoothing; SmoothingMode smoothing;
CompositingQuality compqual; CompositingQuality compqual;
InterpolationMode interpolation; InterpolationMode interpolation;
@ -445,7 +446,7 @@ typedef GpStatus (*gdip_format_string_callback)(HDC hdc,
GpStatus gdip_format_string(HDC hdc, GpStatus gdip_format_string(HDC hdc,
GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font, GDIPCONST WCHAR *string, INT length, GDIPCONST GpFont *font,
GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, int ignore_empty_clip,
gdip_format_string_callback callback, void *user_data) DECLSPEC_HIDDEN; gdip_format_string_callback callback, void *user_data) DECLSPEC_HIDDEN;
void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN; void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN;

File diff suppressed because it is too large Load diff

View file

@ -1009,7 +1009,8 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT
args.maxY = 0; args.maxY = 0;
args.scale = emSize / native_height; args.scale = emSize / native_height;
args.ascent = textmetric.tmAscent * args.scale; args.ascent = textmetric.tmAscent * args.scale;
status = gdip_format_string(dc, string, length, NULL, &scaled_layout_rect, format, format_string_callback, &args); status = gdip_format_string(dc, string, length, NULL, &scaled_layout_rect,
format, TRUE, format_string_callback, &args);
DeleteDC(dc); DeleteDC(dc);
DeleteObject(hfont); DeleteObject(hfont);
@ -1702,6 +1703,13 @@ static void add_bevel_point(const GpPointF *endpoint, const GpPointF *nextpoint,
REAL distance = pen->width/2.0; REAL distance = pen->width/2.0;
REAL bevel_dx, bevel_dy; REAL bevel_dx, bevel_dy;
if (segment_length == 0.0)
{
*last_point = add_path_list_node(*last_point, endpoint->X,
endpoint->Y, PathPointTypeLine);
return;
}
if (right_side) if (right_side)
{ {
bevel_dx = -distance * segment_dy / segment_length; bevel_dx = -distance * segment_dy / segment_length;

View file

@ -17,20 +17,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
//#include <stdarg.h> #include <stdarg.h>
#include <assert.h> #include <assert.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define NONAMELESSUNION #define NONAMELESSUNION
//#include "windef.h" #include <windef.h>
//#include "winbase.h" #include <winbase.h>
//#include "winuser.h" //#include "winuser.h"
//#include "wingdi.h" //#include "wingdi.h"
#define COBJMACROS #define COBJMACROS
//#include "objbase.h" //#include "objbase.h"
#include <ole2.h>
#include <olectl.h> #include <olectl.h>
//#include "ole2.h"
#include <initguid.h> #include <initguid.h>
//#include "wincodec.h" //#include "wincodec.h"
@ -116,10 +120,9 @@ static INT ipicture_pixel_height(IPicture *pic)
IPicture_get_Height(pic, &y); IPicture_get_Height(pic, &y);
hdcref = GetDC(0); hdcref = CreateCompatibleDC(0);
y = MulDiv(y, GetDeviceCaps(hdcref, LOGPIXELSY), INCH_HIMETRIC); y = MulDiv(y, GetDeviceCaps(hdcref, LOGPIXELSY), INCH_HIMETRIC);
ReleaseDC(0, hdcref); DeleteDC(hdcref);
return y; return y;
} }
@ -131,11 +134,9 @@ static INT ipicture_pixel_width(IPicture *pic)
IPicture_get_Width(pic, &x); IPicture_get_Width(pic, &x);
hdcref = GetDC(0); hdcref = CreateCompatibleDC(0);
x = MulDiv(x, GetDeviceCaps(hdcref, LOGPIXELSX), INCH_HIMETRIC); x = MulDiv(x, GetDeviceCaps(hdcref, LOGPIXELSX), INCH_HIMETRIC);
DeleteDC(hdcref);
ReleaseDC(0, hdcref);
return x; return x;
} }
@ -300,7 +301,6 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y,
BYTE r, g, b, a; BYTE r, g, b, a;
BYTE index; BYTE index;
BYTE *row; BYTE *row;
TRACE("%p %d %d %p\n", bitmap, x, y, color);
if(!bitmap || !color || if(!bitmap || !color ||
x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height) x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
@ -370,7 +370,7 @@ static inline UINT get_palette_index(BYTE r, BYTE g, BYTE b, BYTE a, ColorPalett
BYTE index = 0; BYTE index = 0;
int best_distance = 0x7fff; int best_distance = 0x7fff;
int distance; int distance;
int i; UINT i;
if (!palette) return 0; if (!palette) return 0;
/* This algorithm scans entire palette, /* This algorithm scans entire palette,
@ -506,7 +506,6 @@ GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y,
{ {
BYTE a, r, g, b; BYTE a, r, g, b;
BYTE *row; BYTE *row;
TRACE("bitmap:%p, x:%d, y:%d, color:%08x\n", bitmap, x, y, color);
if(!bitmap || x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height) if(!bitmap || x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height)
return InvalidParameter; return InvalidParameter;
@ -1600,12 +1599,9 @@ GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref,
return NotImplemented; return NotImplemented;
} }
/* FIXME: this should create a bitmap in the given size with the attributes
* (resolution etc.) of the graphics object */
GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height,
GpGraphics* target, GpBitmap** bitmap) GpGraphics* target, GpBitmap** bitmap)
{ {
static int calls;
GpStatus ret; GpStatus ret;
TRACE("(%d, %d, %p, %p)\n", width, height, target, bitmap); TRACE("(%d, %d, %p, %p)\n", width, height, target, bitmap);
@ -1613,12 +1609,15 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height,
if(!target || !bitmap) if(!target || !bitmap)
return InvalidParameter; return InvalidParameter;
if(!(calls++)) ret = GdipCreateBitmapFromScan0(width, height, 0, PixelFormat32bppPARGB,
FIXME("hacked stub\n");
ret = GdipCreateBitmapFromScan0(width, height, 0, PixelFormat24bppRGB,
NULL, bitmap); NULL, bitmap);
if (ret == Ok)
{
GdipGetDpiX(target, &(*bitmap)->image.xres);
GdipGetDpiY(target, &(*bitmap)->image.yres);
}
return ret; return ret;
} }
@ -1628,13 +1627,12 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
ICONINFO iinfo; ICONINFO iinfo;
BITMAP bm; BITMAP bm;
int ret; int ret;
UINT width, height; UINT width, height, stride;
GpRect rect; GpRect rect;
BitmapData lockeddata; BitmapData lockeddata;
HDC screendc; HDC screendc;
BOOL has_alpha; BOOL has_alpha;
int x, y; int x, y;
BYTE *bits;
BITMAPINFOHEADER bih; BITMAPINFOHEADER bih;
DWORD *src; DWORD *src;
BYTE *dst_row; BYTE *dst_row;
@ -1654,24 +1652,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
} }
width = bm.bmWidth; width = bm.bmWidth;
height = iinfo.hbmColor ? abs(bm.bmHeight) : abs(bm.bmHeight) / 2;
stride = width * 4;
if (iinfo.hbmColor) stat = GdipCreateBitmapFromScan0(width, height, stride, PixelFormat32bppARGB, NULL, bitmap);
height = abs(bm.bmHeight);
else /* combined bitmap + mask */
height = abs(bm.bmHeight) / 2;
bits = HeapAlloc(GetProcessHeap(), 0, 4*width*height);
if (!bits) {
DeleteObject(iinfo.hbmColor);
DeleteObject(iinfo.hbmMask);
return OutOfMemory;
}
stat = GdipCreateBitmapFromScan0(width, height, 0, PixelFormat32bppARGB, NULL, bitmap);
if (stat != Ok) { if (stat != Ok) {
DeleteObject(iinfo.hbmColor); DeleteObject(iinfo.hbmColor);
DeleteObject(iinfo.hbmMask); DeleteObject(iinfo.hbmMask);
HeapFree(GetProcessHeap(), 0, bits);
return stat; return stat;
} }
@ -1684,14 +1671,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
if (stat != Ok) { if (stat != Ok) {
DeleteObject(iinfo.hbmColor); DeleteObject(iinfo.hbmColor);
DeleteObject(iinfo.hbmMask); DeleteObject(iinfo.hbmMask);
HeapFree(GetProcessHeap(), 0, bits);
GdipDisposeImage((GpImage*)*bitmap); GdipDisposeImage((GpImage*)*bitmap);
return stat; return stat;
} }
bih.biSize = sizeof(bih); bih.biSize = sizeof(bih);
bih.biWidth = width; bih.biWidth = width;
bih.biHeight = -height; bih.biHeight = iinfo.hbmColor ? -height: -height * 2;
bih.biPlanes = 1; bih.biPlanes = 1;
bih.biBitCount = 32; bih.biBitCount = 32;
bih.biCompression = BI_RGB; bih.biCompression = BI_RGB;
@ -1701,17 +1687,17 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
bih.biClrUsed = 0; bih.biClrUsed = 0;
bih.biClrImportant = 0; bih.biClrImportant = 0;
screendc = GetDC(0); screendc = CreateCompatibleDC(0);
if (iinfo.hbmColor) if (iinfo.hbmColor)
{ {
GetDIBits(screendc, iinfo.hbmColor, 0, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS); GetDIBits(screendc, iinfo.hbmColor, 0, height, lockeddata.Scan0, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
if (bm.bmBitsPixel == 32) if (bm.bmBitsPixel == 32)
{ {
has_alpha = FALSE; has_alpha = FALSE;
/* If any pixel has a non-zero alpha, ignore hbmMask */ /* If any pixel has a non-zero alpha, ignore hbmMask */
src = (DWORD*)bits; src = (DWORD*)lockeddata.Scan0;
for (x=0; x<width && !has_alpha; x++) for (x=0; x<width && !has_alpha; x++)
for (y=0; y<height && !has_alpha; y++) for (y=0; y<height && !has_alpha; y++)
if ((*src++ & 0xff000000) != 0) if ((*src++ & 0xff000000) != 0)
@ -1721,24 +1707,16 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
} }
else else
{ {
GetDIBits(screendc, iinfo.hbmMask, 0, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS); GetDIBits(screendc, iinfo.hbmMask, 0, height, lockeddata.Scan0, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
has_alpha = FALSE; has_alpha = FALSE;
} }
/* copy the image data to the Bitmap */
src = (DWORD*)bits;
dst_row = lockeddata.Scan0;
for (y=0; y<height; y++)
{
memcpy(dst_row, src, width*4);
src += width;
dst_row += lockeddata.Stride;
}
if (!has_alpha) if (!has_alpha)
{ {
if (iinfo.hbmMask) if (iinfo.hbmMask)
{ {
BYTE *bits = HeapAlloc(GetProcessHeap(), 0, height * stride);
/* read alpha data from the mask */ /* read alpha data from the mask */
if (iinfo.hbmColor) if (iinfo.hbmColor)
GetDIBits(screendc, iinfo.hbmMask, 0, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS); GetDIBits(screendc, iinfo.hbmMask, 0, height, bits, (BITMAPINFO*)&bih, DIB_RGB_COLORS);
@ -1760,11 +1738,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
} }
dst_row += lockeddata.Stride; dst_row += lockeddata.Stride;
} }
HeapFree(GetProcessHeap(), 0, bits);
} }
else else
{ {
/* set constant alpha of 255 */ /* set constant alpha of 255 */
dst_row = bits; dst_row = lockeddata.Scan0;
for (y=0; y<height; y++) for (y=0; y<height; y++)
{ {
dst = (DWORD*)dst_row; dst = (DWORD*)dst_row;
@ -1775,15 +1755,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHICON(HICON hicon, GpBitmap** bitmap)
} }
} }
ReleaseDC(0, screendc); DeleteDC(screendc);
DeleteObject(iinfo.hbmColor); DeleteObject(iinfo.hbmColor);
DeleteObject(iinfo.hbmMask); DeleteObject(iinfo.hbmMask);
GdipBitmapUnlockBits(*bitmap, &lockeddata); GdipBitmapUnlockBits(*bitmap, &lockeddata);
HeapFree(GetProcessHeap(), 0, bits);
return Ok; return Ok;
} }
@ -1827,14 +1805,14 @@ static void generate_halftone_palette(ARGB *entries, UINT count)
static GpStatus get_screen_resolution(REAL *xres, REAL *yres) static GpStatus get_screen_resolution(REAL *xres, REAL *yres)
{ {
HDC screendc = GetDC(0); HDC screendc = CreateCompatibleDC(0);
if (!screendc) return GenericError; if (!screendc) return GenericError;
*xres = (REAL)GetDeviceCaps(screendc, LOGPIXELSX); *xres = (REAL)GetDeviceCaps(screendc, LOGPIXELSX);
*yres = (REAL)GetDeviceCaps(screendc, LOGPIXELSY); *yres = (REAL)GetDeviceCaps(screendc, LOGPIXELSY);
ReleaseDC(0, screendc); DeleteDC(screendc);
return Ok; return Ok;
} }
@ -3814,7 +3792,8 @@ static GpStatus get_decoder_info(IStream* stream, const struct image_codec **res
LARGE_INTEGER seek; LARGE_INTEGER seek;
HRESULT hr; HRESULT hr;
UINT bytesread; UINT bytesread;
int i, j, sig; int i;
DWORD j, sig;
/* seek to the start of the stream */ /* seek to the start of the stream */
seek.QuadPart = 0; seek.QuadPart = 0;
@ -4724,28 +4703,17 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
if (retval == Ok && hpal) if (retval == Ok && hpal)
{ {
WORD num_palette_entries; PALETTEENTRY entry[256];
PALETTEENTRY *palette_entries=NULL;
ColorPalette *palette=NULL; ColorPalette *palette=NULL;
int i; int i, num_palette_entries;
if (!GetObjectW(hpal, sizeof(num_palette_entries), &num_palette_entries)) num_palette_entries = GetPaletteEntries(hpal, 0, 256, entry);
if (!num_palette_entries)
retval = GenericError; retval = GenericError;
if (retval == Ok) palette = GdipAlloc(sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries-1));
{ if (!palette)
palette_entries = GdipAlloc(sizeof(PALETTEENTRY) * num_palette_entries); retval = OutOfMemory;
palette = GdipAlloc(sizeof(ColorPalette) + sizeof(ARGB) * (num_palette_entries-1));
if (!palette_entries || !palette)
retval = OutOfMemory;
}
if (retval == Ok)
{
if (!GetPaletteEntries(hpal, 0, num_palette_entries, palette_entries))
retval = GenericError;
}
if (retval == Ok) if (retval == Ok)
{ {
@ -4754,15 +4722,13 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
for (i=0; i<num_palette_entries; i++) for (i=0; i<num_palette_entries; i++)
{ {
PALETTEENTRY * entry = &palette_entries[i]; palette->Entries[i] = 0xff000000 | entry[i].peRed << 16 |
palette->Entries[i] = 0xff000000 | entry->peRed << 16 | entry[i].peGreen << 8 | entry[i].peBlue;
entry->peGreen << 8 | entry->peBlue;
} }
retval = GdipSetImagePalette((GpImage*)*bitmap, palette); retval = GdipSetImagePalette((GpImage*)*bitmap, palette);
} }
GdipFree(palette_entries);
GdipFree(palette); GdipFree(palette);
} }

View file

@ -410,7 +410,7 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile,
if (record) if (record)
{ {
record->iType = recordType; record->iType = recordType;
record->nSize = dataSize; record->nSize = dataSize + 8;
memcpy(record->dParm, data, dataSize); memcpy(record->dParm, data, dataSize);
PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table, PlayEnhMetaFileRecord(metafile->playback_dc, metafile->handle_table,
@ -536,7 +536,9 @@ GpStatus WINGDIPAPI GdipEnumerateMetafileSrcRectDestPoints(GpGraphics *graphics,
memcpy(real_metafile->playback_points, destPoints, sizeof(PointF) * 3); memcpy(real_metafile->playback_points, destPoints, sizeof(PointF) * 3);
stat = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, real_metafile->playback_points, 3); stat = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, real_metafile->playback_points, 3);
if (stat == Ok && metafile->metafile_type == MetafileTypeEmf) if (stat == Ok && (metafile->metafile_type == MetafileTypeEmf ||
metafile->metafile_type == MetafileTypeWmfPlaceable ||
metafile->metafile_type == MetafileTypeWmf))
stat = METAFILE_PlaybackGetDC((GpMetafile*)metafile); stat = METAFILE_PlaybackGetDC((GpMetafile*)metafile);
if (stat == Ok) if (stat == Ok)

View file

@ -282,7 +282,7 @@ GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region,
region_element *left, *right = NULL; region_element *left, *right = NULL;
GpStatus stat; GpStatus stat;
TRACE("%p %p %d\n", region, rect, mode); TRACE("%p %s %d\n", region, debugstr_rectf(rect), mode);
if (!(region && rect)) if (!(region && rect))
return InvalidParameter; return InvalidParameter;
@ -588,7 +588,7 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
GpStatus stat; GpStatus stat;
GpPath* path; GpPath* path;
GpRegion* local; GpRegion* local;
int i; DWORD i;
TRACE("(%p, %p)\n", hrgn, region); TRACE("(%p, %p)\n", hrgn, region);
@ -894,7 +894,7 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
if (!graphics) if (!graphics)
{ {
new_hdc = GetDC(0); new_hdc = CreateCompatibleDC(0);
if (!new_hdc) if (!new_hdc)
return OutOfMemory; return OutOfMemory;
@ -902,13 +902,13 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
graphics = new_graphics; graphics = new_graphics;
if (stat != Ok) if (stat != Ok)
{ {
ReleaseDC(0, new_hdc); DeleteDC(new_hdc);
return stat; return stat;
} }
} }
else if (!graphics->hdc) else if (!graphics->hdc)
{ {
graphics->hdc = new_hdc = GetDC(0); graphics->hdc = new_hdc = CreateCompatibleDC(0);
if (!new_hdc) if (!new_hdc)
return OutOfMemory; return OutOfMemory;
} }
@ -929,7 +929,7 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn)
RestoreDC(graphics->hdc, save_state); RestoreDC(graphics->hdc, save_state);
if (new_hdc) if (new_hdc)
{ {
ReleaseDC(0, new_hdc); DeleteDC(new_hdc);
if (new_graphics) if (new_graphics)
GdipDeleteGraphics(new_graphics); GdipDeleteGraphics(new_graphics);
else else
@ -1467,7 +1467,7 @@ GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMat
GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *count, GpMatrix *matrix) GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *count, GpMatrix *matrix)
{ {
GpStatus stat; GpStatus stat;
INT i; DWORD i;
LPRGNDATA data; LPRGNDATA data;
RECT *rects; RECT *rects;
@ -1501,7 +1501,7 @@ GpStatus WINGDIPAPI GdipGetRegionScansI(GpRegion *region, GpRect *scans, INT *co
GpStatus WINGDIPAPI GdipGetRegionScans(GpRegion *region, GpRectF *scans, INT *count, GpMatrix *matrix) GpStatus WINGDIPAPI GdipGetRegionScans(GpRegion *region, GpRectF *scans, INT *count, GpMatrix *matrix)
{ {
GpStatus stat; GpStatus stat;
INT i; DWORD i;
LPRGNDATA data; LPRGNDATA data;
RECT *rects; RECT *rects;

View file

@ -63,7 +63,7 @@ reactos/dll/win32/dciman32 # Synced to Wine-1.5.19
reactos/dll/win32/dwmapi # Synced to Wine-1.5.19 reactos/dll/win32/dwmapi # Synced to Wine-1.5.19
reactos/dll/win32/faultrep # Synced to Wine-1.5.4 reactos/dll/win32/faultrep # Synced to Wine-1.5.4
reactos/dll/win32/fusion # Synced to Wine-1.5.26 reactos/dll/win32/fusion # Synced to Wine-1.5.26
reactos/dll/win32/gdiplus # Synced to Wine-1.5.4 reactos/dll/win32/gdiplus # Synced to Wine-1.5.26
reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.5.26 reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.5.26
reactos/dll/win32/hlink # Synced to Wine-1.5.4 reactos/dll/win32/hlink # Synced to Wine-1.5.4
reactos/dll/win32/hnetcfg # Synced to Wine-1.5.4 reactos/dll/win32/hnetcfg # Synced to Wine-1.5.4