winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
849 discussions
Start a n
N
ew thread
Hans Leidekker : msi: Fix a memory leak (valgrind).
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 2df374ac3528488bdbfaef113b98c7e8ca7d40d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2df374ac3528488bdbfaef113…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 10 12:45:41 2011 +0100 msi: Fix a memory leak (valgrind). --- dlls/msi/files.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 4736fce..7f71d1a 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -997,7 +997,6 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param) UINT ret = ERROR_SUCCESS; component = MSI_RecordGetString(row, 2); - filename = strdupW( MSI_RecordGetString(row, 3) ); dirprop = MSI_RecordGetString(row, 4); install_mode = MSI_RecordGetInteger(row, 5); @@ -1026,7 +1025,7 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param) return ERROR_OUTOFMEMORY; size = 0; - if (filename) + if ((filename = strdupW( MSI_RecordGetString(row, 3) ))) { reduce_to_longfilename( filename ); size = lstrlenW( filename );
1
0
0
0
Hans Leidekker : odbccp32: Initialize the usage count in SQLRemoveDriverManager and SQLRemoveDriver ( valgrind).
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 92405a2d988115b6ddacf07dd716275cd6052799 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=92405a2d988115b6ddacf07dd…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 10 12:45:17 2011 +0100 odbccp32: Initialize the usage count in SQLRemoveDriverManager and SQLRemoveDriver (valgrind). --- dlls/odbccp32/odbccp32.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/odbccp32/odbccp32.c b/dlls/odbccp32/odbccp32.c index ba4962d..fb4ea2c 100644 --- a/dlls/odbccp32/odbccp32.c +++ b/dlls/odbccp32/odbccp32.c @@ -845,6 +845,7 @@ BOOL WINAPI SQLRemoveDriverW(LPCWSTR lpszDriver, BOOL fRemoveDSN, { clear_errors(); FIXME("stub\n"); + if (lpdwUsageCount) *lpdwUsageCount = 1; return TRUE; } @@ -853,6 +854,7 @@ BOOL WINAPI SQLRemoveDriver(LPCSTR lpszDriver, BOOL fRemoveDSN, { clear_errors(); FIXME("stub\n"); + if (lpdwUsageCount) *lpdwUsageCount = 1; return TRUE; } @@ -860,6 +862,7 @@ BOOL WINAPI SQLRemoveDriverManager(LPDWORD pdwUsageCount) { clear_errors(); FIXME("stub\n"); + if (pdwUsageCount) *pdwUsageCount = 1; return TRUE; }
1
0
0
0
Nikolay Sivov : msxml3: Some get_attributes() tests.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 710b643b2ffe56f1ab754d030cbc651220919bfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=710b643b2ffe56f1ab754d030…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 10 04:19:29 2011 +0300 msxml3: Some get_attributes() tests. --- dlls/msxml3/pi.c | 26 ++++++- dlls/msxml3/tests/domdoc.c | 161 ++++++++++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 70 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=710b643b2ffe56f1ab754…
1
0
0
0
Vincent Povirk : gdiplus: Implement tiling wrap modes.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 5488ea14684ffc32ab3e00861f06b891db2fb285 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5488ea14684ffc32ab3e00861…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Mar 9 18:04:52 2011 -0600 gdiplus: Implement tiling wrap modes. --- dlls/gdiplus/graphics.c | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7a70f36..89cd6ca 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -481,17 +481,40 @@ static void get_bitmap_sample_size(InterpolationMode interpolation, WrapMode wra static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width, UINT height, INT x, INT y, GDIPCONST GpImageAttributes *attributes) { - static int fixme[4]; - - switch (attributes->wrap) + if (attributes->wrap == WrapModeClamp) { - default: - if (!fixme[attributes->wrap]++) - FIXME("not implemented for wrap mode %i\n", attributes->wrap); - case WrapModeClamp: if (x < 0 || y < 0 || x >= width || y >= height) return attributes->outside_color; - break; + } + else + { + /* Tiling. Make sure co-ordinates are positive as it simplifies the math. */ + if (x < 0) + x = width*2 + x % (width * 2); + if (y < 0) + y = height*2 + y % (height * 2); + + if ((attributes->wrap & 1) == 1) + { + /* Flip X */ + if ((x / width) % 2 == 0) + x = x % width; + else + x = width - 1 - x % width; + } + else + x = x % width; + + if ((attributes->wrap & 2) == 2) + { + /* Flip Y */ + if ((y / height) % 2 == 0) + y = y % height; + else + y = height - 1 - y % height; + } + else + y = y % height; } if (x < src_rect->X || y < src_rect->Y || x >= src_rect->X + src_rect->Width || y >= src_rect->Y + src_rect->Height)
1
0
0
0
Vincent Povirk : gdiplus: Apply image attributes to bitmaps before resampling them.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: d891a8c16c853fb48c400f344afca246db8ed809 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d891a8c16c853fb48c400f344…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Mar 9 17:49:48 2011 -0600 gdiplus: Apply image attributes to bitmaps before resampling them. --- dlls/gdiplus/graphics.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7b51c61..7a70f36 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2488,6 +2488,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image return OutOfMemory; } + apply_image_attributes(imageAttributes, src_data, + src_area.Width, src_area.Height, + src_stride, ColorAdjustTypeBitmap); + /* Transform the bits as needed to the destination. */ GdipTransformMatrixPoints(dst_to_src, dst_to_src_points, 3); @@ -2523,11 +2527,6 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image GdipFree(src_data); - apply_image_attributes(imageAttributes, dst_data, - dst_area.right - dst_area.left, - dst_area.bottom - dst_area.top, - dst_stride, ColorAdjustTypeBitmap); - stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top, dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride);
1
0
0
0
Vincent Povirk : gdiplus: Read drawn bitmaps in one step instead of using getpixel.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: 870fdaf6cef2fa194c17b2cfb74b14cd92cd8a81 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=870fdaf6cef2fa194c17b2cfb…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Mar 3 14:18:47 2011 -0600 gdiplus: Read drawn bitmaps in one step instead of using getpixel. --- dlls/gdiplus/graphics.c | 200 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 163 insertions(+), 37 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 09eaa01..7b51c61 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -414,6 +414,95 @@ static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE d } } +/* Given a bitmap and its source rectangle, find the smallest rectangle in the + * bitmap that contains all the pixels we may need to draw it. */ +static void get_bitmap_sample_size(InterpolationMode interpolation, WrapMode wrap, + GpBitmap* bitmap, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, + GpRect *rect) +{ + INT left, top, right, bottom; + + switch (interpolation) + { + case InterpolationModeHighQualityBilinear: + case InterpolationModeHighQualityBicubic: + /* FIXME: Include a greater range for the prefilter? */ + case InterpolationModeBicubic: + case InterpolationModeBilinear: + left = (INT)(floorf(srcx)); + top = (INT)(floorf(srcy)); + right = (INT)(ceilf(srcx+srcwidth)); + bottom = (INT)(ceilf(srcy+srcheight)); + break; + case InterpolationModeNearestNeighbor: + default: + left = roundr(srcx); + top = roundr(srcy); + right = roundr(srcx+srcwidth); + bottom = roundr(srcy+srcheight); + break; + } + + if (wrap == WrapModeClamp) + { + if (left < 0) + left = 0; + if (top < 0) + top = 0; + if (right >= bitmap->width) + right = bitmap->width-1; + if (bottom >= bitmap->height) + bottom = bitmap->height-1; + } + else + { + /* In some cases we can make the rectangle smaller here, but the logic + * is hard to get right, and tiling suggests we're likely to use the + * entire source image. */ + if (left < 0 || right >= bitmap->width) + { + left = 0; + right = bitmap->width-1; + } + + if (top < 0 || bottom >= bitmap->height) + { + top = 0; + bottom = bitmap->height-1; + } + } + + rect->X = left; + rect->Y = top; + rect->Width = right - left + 1; + rect->Height = bottom - top + 1; +} + +static ARGB sample_bitmap_pixel(GDIPCONST GpRect *src_rect, LPBYTE bits, UINT width, + UINT height, INT x, INT y, GDIPCONST GpImageAttributes *attributes) +{ + static int fixme[4]; + + switch (attributes->wrap) + { + default: + if (!fixme[attributes->wrap]++) + FIXME("not implemented for wrap mode %i\n", attributes->wrap); + case WrapModeClamp: + if (x < 0 || y < 0 || x >= width || y >= height) + return attributes->outside_color; + break; + } + + if (x < src_rect->X || y < src_rect->Y || x >= src_rect->X + src_rect->Width || y >= src_rect->Y + src_rect->Height) + { + ERR("out of range pixel requested\n"); + return 0xffcd0084; + } + + return ((DWORD*)(bits))[(x - src_rect->X) + (y - src_rect->Y) * src_rect->Width]; +} + static void brush_fill_path(GpGraphics *graphics, GpBrush* brush) { switch (brush->bt) @@ -2309,16 +2398,25 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (use_software) { - RECT src_area, dst_area; - int i, x, y, stride; + RECT dst_area; + GpRect src_area; + int i, x, y, src_stride, dst_stride; GpMatrix *dst_to_src; REAL m11, m12, m21, m22, mdx, mdy; - LPBYTE data; + LPBYTE src_data, dst_data; + BitmapData lockeddata; + InterpolationMode interpolation = graphics->interpolation; + GpPointF dst_to_src_points[3] = {{0.0, 0.0}, {1.0, 0.0}, {0.0, 1.0}}; + REAL x_dx, x_dy, y_dx, y_dy; + static const GpImageAttributes defaultImageAttributes = {WrapModeClamp, 0, FALSE}; + + if (!imageAttributes) + imageAttributes = &defaultImageAttributes; - src_area.left = srcx*dx; - src_area.top = srcy*dy; - src_area.right = (srcx+srcwidth)*dx; - src_area.bottom = (srcy+srcheight)*dy; + srcx = srcx * dx; + srcy = srcy * dy; + srcwidth = srcwidth * dx; + srcheight = srcheight * dy; dst_area.left = dst_area.right = pti[0].x; dst_area.top = dst_area.bottom = pti[0].y; @@ -2347,65 +2445,93 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image return stat; } - data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); - if (!data) + dst_data = GdipAlloc(sizeof(ARGB) * (dst_area.right - dst_area.left) * (dst_area.bottom - dst_area.top)); + if (!dst_data) + { + GdipDeleteMatrix(dst_to_src); + return OutOfMemory; + } + + dst_stride = sizeof(ARGB) * (dst_area.right - dst_area.left); + + get_bitmap_sample_size(interpolation, imageAttributes->wrap, + bitmap, srcx, srcy, srcwidth, srcheight, &src_area); + + src_data = GdipAlloc(sizeof(ARGB) * src_area.Width * src_area.Height); + if (!src_data) { + GdipFree(dst_data); GdipDeleteMatrix(dst_to_src); return OutOfMemory; } + src_stride = sizeof(ARGB) * src_area.Width; + + /* Read the bits we need from the source bitmap into an ARGB buffer. */ + lockeddata.Width = src_area.Width; + lockeddata.Height = src_area.Height; + lockeddata.Stride = src_stride; + lockeddata.PixelFormat = PixelFormat32bppARGB; + lockeddata.Scan0 = src_data; - stride = sizeof(ARGB) * (dst_area.right - dst_area.left); + stat = GdipBitmapLockBits(bitmap, &src_area, ImageLockModeRead|ImageLockModeUserInputBuf, + PixelFormat32bppARGB, &lockeddata); + + if (stat == Ok) + stat = GdipBitmapUnlockBits(bitmap, &lockeddata); - if (imageAttributes && - (imageAttributes->wrap != WrapModeClamp || - imageAttributes->outside_color != 0x00000000 || - imageAttributes->clamp)) + if (stat != Ok) { - static int fixme; - if (!fixme++) - FIXME("Image wrap mode not implemented\n"); + if (src_data != dst_data) + GdipFree(src_data); + GdipFree(dst_data); + GdipDeleteMatrix(dst_to_src); + return OutOfMemory; } + /* Transform the bits as needed to the destination. */ + GdipTransformMatrixPoints(dst_to_src, dst_to_src_points, 3); + + x_dx = dst_to_src_points[1].X - dst_to_src_points[0].X; + x_dy = dst_to_src_points[1].Y - dst_to_src_points[0].Y; + y_dx = dst_to_src_points[2].X - dst_to_src_points[0].X; + y_dy = dst_to_src_points[2].Y - dst_to_src_points[0].Y; + for (x=dst_area.left; x<dst_area.right; x++) { for (y=dst_area.top; y<dst_area.bottom; y++) { GpPointF src_pointf; - int src_x, src_y; - ARGB *src_color; - - src_pointf.X = x; - src_pointf.Y = y; + INT src_x, src_y; + ARGB *dst_color; - GdipTransformMatrixPoints(dst_to_src, &src_pointf, 1); + src_pointf.X = dst_to_src_points[0].X + x * x_dx + y * y_dx; + src_pointf.Y = dst_to_src_points[0].Y + x * x_dy + y * y_dy; src_x = roundr(src_pointf.X); src_y = roundr(src_pointf.Y); - src_color = (ARGB*)(data + stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); + dst_color = (ARGB*)(dst_data + dst_stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); - if (src_x < src_area.left || src_x >= src_area.right || - src_y < src_area.top || src_y >= src_area.bottom) - *src_color = 0; + if (src_pointf.X >= srcx && src_pointf.X < srcx + srcwidth && src_pointf.Y >= srcy && src_pointf.Y < srcy+srcheight) + *dst_color = sample_bitmap_pixel(&src_area, src_data, bitmap->width, bitmap->height, src_x, src_y, imageAttributes); else - GdipBitmapGetPixel(bitmap, src_x, src_y, src_color); + *dst_color = 0; } } GdipDeleteMatrix(dst_to_src); - if (imageAttributes) - { - apply_image_attributes(imageAttributes, data, - dst_area.right - dst_area.left, - dst_area.bottom - dst_area.top, - stride, ColorAdjustTypeBitmap); - } + GdipFree(src_data); + + apply_image_attributes(imageAttributes, dst_data, + dst_area.right - dst_area.left, + dst_area.bottom - dst_area.top, + dst_stride, ColorAdjustTypeBitmap); stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top, - data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, stride); + dst_data, dst_area.right - dst_area.left, dst_area.bottom - dst_area.top, dst_stride); - GdipFree(data); + GdipFree(dst_data); return stat; }
1
0
0
0
Vincent Povirk : gdiplus: Move ImageAttributes mapping into a helper function.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: a7f95eeb7ef5d0205945fb65b66562019e5f6562 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a7f95eeb7ef5d0205945fb65b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Mar 3 13:30:45 2011 -0600 gdiplus: Move ImageAttributes mapping into a helper function. --- dlls/gdiplus/graphics.c | 163 +++++++++++++++++++++++++---------------------- 1 files changed, 87 insertions(+), 76 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4827bb0..09eaa01 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -331,6 +331,89 @@ static ARGB blend_line_gradient(GpLineGradient* brush, REAL position) } } +static void apply_image_attributes(const GpImageAttributes *attributes, LPBYTE data, + UINT width, UINT height, INT stride, ColorAdjustType type) +{ + UINT x, y, i; + + if (attributes->colorkeys[type].enabled || + attributes->colorkeys[ColorAdjustTypeDefault].enabled) + { + const struct color_key *key; + BYTE min_blue, min_green, min_red; + BYTE max_blue, max_green, max_red; + + if (attributes->colorkeys[type].enabled) + key = &attributes->colorkeys[type]; + else + key = &attributes->colorkeys[ColorAdjustTypeDefault]; + + min_blue = key->low&0xff; + min_green = (key->low>>8)&0xff; + min_red = (key->low>>16)&0xff; + + max_blue = key->high&0xff; + max_green = (key->high>>8)&0xff; + max_red = (key->high>>16)&0xff; + + for (x=0; x<width; x++) + for (y=0; y<height; y++) + { + ARGB *src_color; + BYTE blue, green, red; + src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x); + blue = *src_color&0xff; + green = (*src_color>>8)&0xff; + red = (*src_color>>16)&0xff; + if (blue >= min_blue && green >= min_green && red >= min_red && + blue <= max_blue && green <= max_green && red <= max_red) + *src_color = 0x00000000; + } + } + + if (attributes->colorremaptables[type].enabled || + attributes->colorremaptables[ColorAdjustTypeDefault].enabled) + { + const struct color_remap_table *table; + + if (attributes->colorremaptables[type].enabled) + table = &attributes->colorremaptables[type]; + else + table = &attributes->colorremaptables[ColorAdjustTypeDefault]; + + for (x=0; x<width; x++) + for (y=0; y<height; y++) + { + ARGB *src_color; + src_color = (ARGB*)(data + stride * y + sizeof(ARGB) * x); + for (i=0; i<table->mapsize; i++) + { + if (*src_color == table->colormap[i].oldColor.Argb) + { + *src_color = table->colormap[i].newColor.Argb; + break; + } + } + } + } + + if (attributes->colormatrices[type].enabled || + attributes->colormatrices[ColorAdjustTypeDefault].enabled) + { + static int fixme; + if (!fixme++) + FIXME("Color transforms not implemented\n"); + } + + if (attributes->gamma_enabled[type] || + attributes->gamma_enabled[ColorAdjustTypeDefault]) + { + static int fixme; + if (!fixme++) + FIXME("Gamma adjustment not implemented\n"); + } +} + static void brush_fill_path(GpGraphics *graphics, GpBrush* brush) { switch (brush->bt) @@ -2313,82 +2396,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (imageAttributes) { - if (imageAttributes->colorkeys[ColorAdjustTypeBitmap].enabled || - imageAttributes->colorkeys[ColorAdjustTypeDefault].enabled) - { - const struct color_key *key; - BYTE min_blue, min_green, min_red; - BYTE max_blue, max_green, max_red; - - if (imageAttributes->colorkeys[ColorAdjustTypeBitmap].enabled) - key = &imageAttributes->colorkeys[ColorAdjustTypeBitmap]; - else - key = &imageAttributes->colorkeys[ColorAdjustTypeDefault]; - - min_blue = key->low&0xff; - min_green = (key->low>>8)&0xff; - min_red = (key->low>>16)&0xff; - - max_blue = key->high&0xff; - max_green = (key->high>>8)&0xff; - max_red = (key->high>>16)&0xff; - - for (x=dst_area.left; x<dst_area.right; x++) - for (y=dst_area.top; y<dst_area.bottom; y++) - { - ARGB *src_color; - BYTE blue, green, red; - src_color = (ARGB*)(data + stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); - blue = *src_color&0xff; - green = (*src_color>>8)&0xff; - red = (*src_color>>16)&0xff; - if (blue >= min_blue && green >= min_green && red >= min_red && - blue <= max_blue && green <= max_green && red <= max_red) - *src_color = 0x00000000; - } - } - - if (imageAttributes->colorremaptables[ColorAdjustTypeBitmap].enabled || - imageAttributes->colorremaptables[ColorAdjustTypeDefault].enabled) - { - const struct color_remap_table *table; - - if (imageAttributes->colorremaptables[ColorAdjustTypeBitmap].enabled) - table = &imageAttributes->colorremaptables[ColorAdjustTypeBitmap]; - else - table = &imageAttributes->colorremaptables[ColorAdjustTypeDefault]; - - for (x=dst_area.left; x<dst_area.right; x++) - for (y=dst_area.top; y<dst_area.bottom; y++) - { - ARGB *src_color; - src_color = (ARGB*)(data + stride * (y - dst_area.top) + sizeof(ARGB) * (x - dst_area.left)); - for (i=0; i<table->mapsize; i++) - { - if (*src_color == table->colormap[i].oldColor.Argb) - { - *src_color = table->colormap[i].newColor.Argb; - break; - } - } - } - } - - if (imageAttributes->colormatrices[ColorAdjustTypeBitmap].enabled || - imageAttributes->colormatrices[ColorAdjustTypeDefault].enabled) - { - static int fixme; - if (!fixme++) - FIXME("Color transforms not implemented\n"); - } - - if (imageAttributes->gamma_enabled[ColorAdjustTypeBitmap] || - imageAttributes->gamma_enabled[ColorAdjustTypeDefault]) - { - static int fixme; - if (!fixme++) - FIXME("Gamma adjustment not implemented\n"); - } + apply_image_attributes(imageAttributes, data, + dst_area.right - dst_area.left, + dst_area.bottom - dst_area.top, + stride, ColorAdjustTypeBitmap); } stat = alpha_blend_pixels(graphics, dst_area.left, dst_area.top,
1
0
0
0
Vincent Povirk : gdiplus: Add tests for interpolation mode and make them pass.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: a2631ae1d283481c5b1509876cef202d66f41a52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2631ae1d283481c5b1509876…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Mar 3 14:57:19 2011 -0600 gdiplus: Add tests for interpolation mode and make them pass. --- dlls/gdiplus/graphics.c | 12 +++++-- dlls/gdiplus/tests/graphics.c | 70 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index e9412c8..4827bb0 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1364,7 +1364,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra (*graphics)->owndc = FALSE; (*graphics)->smoothing = SmoothingModeDefault; (*graphics)->compqual = CompositingQualityDefault; - (*graphics)->interpolation = InterpolationModeDefault; + (*graphics)->interpolation = InterpolationModeBilinear; (*graphics)->pixeloffset = PixelOffsetModeDefault; (*graphics)->compmode = CompositingModeSourceOver; (*graphics)->unit = UnitDisplay; @@ -1403,7 +1403,7 @@ GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) (*graphics)->image = image; (*graphics)->smoothing = SmoothingModeDefault; (*graphics)->compqual = CompositingQualityDefault; - (*graphics)->interpolation = InterpolationModeDefault; + (*graphics)->interpolation = InterpolationModeBilinear; (*graphics)->pixeloffset = PixelOffsetModeDefault; (*graphics)->compmode = CompositingModeSourceOver; (*graphics)->unit = UnitDisplay; @@ -4638,12 +4638,18 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, { TRACE("(%p, %d)\n", graphics, mode); - if(!graphics) + if(!graphics || mode == InterpolationModeInvalid || mode > InterpolationModeHighQualityBicubic) return InvalidParameter; if(graphics->busy) return ObjectBusy; + if (mode == InterpolationModeDefault || mode == InterpolationModeLowQuality) + mode = InterpolationModeBilinear; + + if (mode == InterpolationModeHighQuality) + mode = InterpolationModeHighQualityBicubic; + graphics->interpolation = mode; return Ok; diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 275c237..ecdbe93 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3012,6 +3012,75 @@ static void test_string_functions(void) ReleaseDC(hwnd, hdc); } +static void test_get_set_interpolation(void) +{ + GpGraphics *graphics; + HDC hdc = GetDC( hwnd ); + GpStatus status; + InterpolationMode mode; + + ok(hdc != NULL, "Expected HDC to be initialized\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + ok(graphics != NULL, "Expected graphics to be initialized\n"); + + status = GdipGetInterpolationMode(NULL, &mode); + expect(InvalidParameter, status); + + if (0) + { + /* Crashes on Windows XP */ + status = GdipGetInterpolationMode(graphics, NULL); + expect(InvalidParameter, status); + } + + status = GdipSetInterpolationMode(NULL, InterpolationModeNearestNeighbor); + expect(InvalidParameter, status); + + /* out of range */ + status = GdipSetInterpolationMode(graphics, InterpolationModeHighQualityBicubic+1); + expect(InvalidParameter, status); + + status = GdipSetInterpolationMode(graphics, InterpolationModeInvalid); + expect(InvalidParameter, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeNearestNeighbor); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeNearestNeighbor, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeDefault); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeLowQuality); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeBilinear, mode); + + status = GdipSetInterpolationMode(graphics, InterpolationModeHighQuality); + expect(Ok, status); + + status = GdipGetInterpolationMode(graphics, &mode); + expect(Ok, status); + expect(InterpolationModeHighQualityBicubic, mode); + + GdipDeleteGraphics(graphics); + + ReleaseDC(hwnd, hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3070,6 +3139,7 @@ START_TEST(graphics) test_textcontrast(); test_fromMemoryBitmap(); test_string_functions(); + test_get_set_interpolation(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd );
1
0
0
0
Alexandre Julliard : gdiplus: Use signed types in convert_pixels to avoid problems on 64-bit.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: b3c333e91633cdcd34e6a1ba2d7755aa883938b5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b3c333e91633cdcd34e6a1ba2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Mar 10 14:09:56 2011 +0100 gdiplus: Use signed types in convert_pixels to avoid problems on 64-bit. --- dlls/gdiplus/gdiplus_private.h | 2 +- dlls/gdiplus/image.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 68998df..4575875 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -112,7 +112,7 @@ extern const char *debugstr_pointf(CONST PointF* pt); extern void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height, BYTE *dst_bits, INT dst_stride, const BYTE *src_bits, INT src_stride); -extern GpStatus convert_pixels(UINT width, UINT height, +extern GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette); diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 2582ae2..1916524 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -498,11 +498,11 @@ GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y, return Ok; } -GpStatus convert_pixels(UINT width, UINT height, +GpStatus convert_pixels(INT width, INT height, INT dst_stride, BYTE *dst_bits, PixelFormat dst_format, INT src_stride, const BYTE *src_bits, PixelFormat src_format, ARGB *src_palette) { - UINT x, y; + INT x, y; if (src_format == dst_format || (dst_format == PixelFormat32bppRGB && PIXELFORMATBPP(src_format) == 32))
1
0
0
0
Joris Huizer : dbghelp: dwarf2_get_cpp_name: fix off-by-one error.
by Alexandre Julliard
10 Mar '11
10 Mar '11
Module: wine Branch: master Commit: a2793d62ade0ecc0026cf285f4b71506ab6bdcbf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a2793d62ade0ecc0026cf285f…
Author: Joris Huizer <joris_huizer(a)yahoo.com> Date: Wed Mar 9 22:57:19 2011 +0100 dbghelp: dwarf2_get_cpp_name: fix off-by-one error. --- dlls/dbghelp/dwarf.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c index 8714c90..e78026f 100644 --- a/dlls/dbghelp/dwarf.c +++ b/dlls/dbghelp/dwarf.c @@ -962,7 +962,7 @@ static const char* dwarf2_get_cpp_name(dwarf2_parse_context_t* ctx, dwarf2_debug if (di->abbrev->tag == DW_TAG_compile_unit) return name; if (!ctx->cpp_name) ctx->cpp_name = pool_alloc(&ctx->pool, MAX_SYM_NAME); - last = ctx->cpp_name + MAX_SYM_NAME - strlen(name); + last = ctx->cpp_name + MAX_SYM_NAME - strlen(name) - 1; strcpy(last, name); /* if the di is a definition, but has also a (previous) declaration, then scope must
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
85
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
Results per page:
10
25
50
100
200