Author: cwittich
Date: Sat Mar 6 13:15:38 2010
New Revision: 45924
URL:
http://svn.reactos.org/svn/reactos?rev=45924&view=rev
Log:
[GDIPLUS]
sync gdiplus to wine 1.1.40
Modified:
trunk/reactos/dll/win32/gdiplus/gdiplus.spec
trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
trunk/reactos/dll/win32/gdiplus/graphics.c
trunk/reactos/dll/win32/gdiplus/image.c
trunk/reactos/dll/win32/gdiplus/imageattributes.c
trunk/reactos/dll/win32/gdiplus/region.c
trunk/reactos/include/psdk/gdipluscolormatrix.h
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus.spec [iso-8859-1] Sat Mar 6 13:15:38 2010
@@ -290,7 +290,7 @@
@ stdcall GdipGetImageGraphicsContext(ptr ptr)
@ stdcall GdipGetImageHeight(ptr ptr)
@ stdcall GdipGetImageHorizontalResolution(ptr ptr)
-@ stub GdipGetImageItemData
+@ stdcall GdipGetImageItemData(ptr ptr)
@ stdcall GdipGetImagePalette(ptr ptr long)
@ stdcall GdipGetImagePaletteSize(ptr ptr)
@ stdcall GdipGetImagePixelFormat(ptr ptr)
@@ -381,7 +381,7 @@
@ stdcall GdipGetRegionDataSize(ptr ptr)
@ stdcall GdipGetRegionHRgn(ptr ptr ptr)
@ stub GdipGetRegionScans
-@ stub GdipGetRegionScansCount
+@ stdcall GdipGetRegionScansCount(ptr ptr ptr)
@ stub GdipGetRegionScansI
@ stub GdipGetRenderingOrigin
@ stdcall GdipGetSmoothingMode(ptr ptr)
Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Sat Mar 6 13:15:38
2010
@@ -264,10 +264,17 @@
ColorMatrix graymatrix;
};
+struct color_remap_table{
+ BOOL enabled;
+ INT mapsize;
+ GDIPCONST ColorMap *colormap;
+};
+
struct GpImageAttributes{
WrapMode wrap;
struct color_key colorkeys[ColorAdjustTypeCount];
struct color_matrix colormatrices[ColorAdjustTypeCount];
+ struct color_remap_table colorremaptables[ColorAdjustTypeCount];
BOOL gamma_enabled[ColorAdjustTypeCount];
REAL gamma[ColorAdjustTypeCount];
};
Modified: trunk/reactos/dll/win32/gdiplus/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Sat Mar 6 13:15:38 2010
@@ -3173,9 +3173,10 @@
return Ok;
}
+/* FIXME: Need to handle color depths less than 24bpp */
GpStatus WINGDIPAPI GdipGetNearestColor(GpGraphics *graphics, ARGB* argb)
{
- FIXME("(%p, %p): stub\n", graphics, argb);
+ FIXME("(%p, %p): Passing color unmodified\n", graphics, argb);
if(!graphics || !argb)
return InvalidParameter;
@@ -3183,7 +3184,7 @@
if(graphics->busy)
return ObjectBusy;
- return NotImplemented;
+ return Ok;
}
GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics *graphics, REAL *scale)
Modified: trunk/reactos/dll/win32/gdiplus/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Sat Mar 6 13:15:38 2010
@@ -1614,7 +1614,7 @@
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
PixelFormat format, BYTE* scan0, GpBitmap** bitmap)
{
- BITMAPINFOHEADER bmih;
+ BITMAPINFO* pbmi;
HBITMAP hbitmap;
INT row_size, dib_stride;
HDC hdc;
@@ -1644,26 +1644,33 @@
if(stride == 0)
stride = dib_stride;
- bmih.biSize = sizeof(BITMAPINFOHEADER);
- bmih.biWidth = width;
- bmih.biHeight = -height;
- bmih.biPlanes = 1;
+ pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
+ if (!pbmi)
+ return OutOfMemory;
+
+ pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ pbmi->bmiHeader.biWidth = width;
+ pbmi->bmiHeader.biHeight = -height;
+ pbmi->bmiHeader.biPlanes = 1;
/* FIXME: use the rest of the data from format */
- bmih.biBitCount = PIXELFORMATBPP(format);
- bmih.biCompression = BI_RGB;
- bmih.biSizeImage = 0;
- bmih.biXPelsPerMeter = 0;
- bmih.biYPelsPerMeter = 0;
- bmih.biClrUsed = 0;
- bmih.biClrImportant = 0;
+ pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(format);
+ pbmi->bmiHeader.biCompression = BI_RGB;
+ pbmi->bmiHeader.biSizeImage = 0;
+ pbmi->bmiHeader.biXPelsPerMeter = 0;
+ pbmi->bmiHeader.biYPelsPerMeter = 0;
+ pbmi->bmiHeader.biClrUsed = 0;
+ pbmi->bmiHeader.biClrImportant = 0;
hdc = CreateCompatibleDC(NULL);
- if (!hdc) return GenericError;
-
- hbitmap = CreateDIBSection(hdc, (BITMAPINFO*)&bmih, DIB_RGB_COLORS,
(void**)&bits,
- NULL, 0);
+ if (!hdc) {
+ GdipFree(pbmi);
+ return GenericError;
+ }
+
+ hbitmap = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0);
DeleteDC(hdc);
+ GdipFree(pbmi);
if (!hbitmap) return GenericError;
@@ -1837,6 +1844,7 @@
{
GdipFree(((GpBitmap*)image)->bitmapbits);
DeleteDC(((GpBitmap*)image)->hdc);
+ DeleteObject(((GpBitmap*)image)->hbitmap);
}
GdipFree(image->palette_entries);
GdipFree(image);
@@ -1852,6 +1860,18 @@
if(!image || !item)
return InvalidParameter;
+
+ if (!(calls++))
+ FIXME("not implemented\n");
+
+ return NotImplemented;
+}
+
+GpStatus WINGDIPAPI GdipGetImageItemData(GpImage *image, ImageItemData *item)
+{
+ static int calls;
+
+ TRACE("(%p,%p)\n", image, item);
if (!(calls++))
FIXME("not implemented\n");
Modified: trunk/reactos/dll/win32/gdiplus/imageattributes.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/imageatt…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/imageattributes.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/imageattributes.c [iso-8859-1] Sat Mar 6 13:15:38
2010
@@ -204,14 +204,23 @@
ColorAdjustType type, BOOL enableFlag, UINT mapSize,
GDIPCONST ColorMap *map)
{
- static int calls;
-
TRACE("(%p,%u,%i,%u,%p)\n", imageAttr, type, enableFlag, mapSize, map);
- if(!(calls++))
- FIXME("not implemented\n");
-
- return NotImplemented;
+ if(!imageAttr || type >= ColorAdjustTypeCount)
+ return InvalidParameter;
+
+ if (enableFlag)
+ {
+ if(!map || !mapSize)
+ return InvalidParameter;
+
+ imageAttr->colorremaptables[type].mapsize = mapSize;
+ imageAttr->colorremaptables[type].colormap = map;
+ }
+
+ imageAttr->colorremaptables[type].enabled = enableFlag;
+
+ return Ok;
}
GpStatus WINGDIPAPI GdipSetImageAttributesThreshold(GpImageAttributes *imageAttr,
Modified: trunk/reactos/dll/win32/gdiplus/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] Sat Mar 6 13:15:38 2010
@@ -1306,3 +1306,15 @@
return GdipTranslateRegion(region, (REAL)dx, (REAL)dy);
}
+
+GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMatrix
*matrix)
+{
+ static int calls;
+
+ TRACE("(%p, %p, %p)\n", region, count, matrix);
+
+ if (!(calls++))
+ FIXME("not implemented\n");
+
+ return NotImplemented;
+}
Modified: trunk/reactos/include/psdk/gdipluscolormatrix.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/gdipluscolorm…
==============================================================================
--- trunk/reactos/include/psdk/gdipluscolormatrix.h [iso-8859-1] (original)
+++ trunk/reactos/include/psdk/gdipluscolormatrix.h [iso-8859-1] Sat Mar 6 13:15:38 2010
@@ -45,7 +45,7 @@
struct ColorMap
{
Color oldColor;
- Color newCOlor;
+ Color newColor;
};
#ifndef __cplusplus