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
August 2010
----- 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
884 discussions
Start a n
N
ew thread
Vincent Povirk : gdiplus: Stub GdipGetPathGradientTransform.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 1a710ac36f4f6b7dfe56cf1f4a47b48e62cd9caa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1a710ac36f4f6b7dfe56cf1f4…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 24 17:27:30 2010 -0500 gdiplus: Stub GdipGetPathGradientTransform. --- dlls/gdiplus/brush.c | 13 +++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 39e78fb..c31ed4d 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1627,6 +1627,19 @@ GpStatus WINGDIPAPI GdipSetPathGradientTransform(GpPathGradient *grad, return NotImplemented; } +GpStatus WINGDIPAPI GdipGetPathGradientTransform(GpPathGradient *grad, + GpMatrix *matrix) +{ + static int calls; + + TRACE("(%p,%p)\n", grad, matrix); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform(GpPathGradient *grad, GDIPCONST GpMatrix *matrix, GpMatrixOrder order) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index c4309e5..4a98a43 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -340,7 +340,7 @@ @ stdcall GdipGetPathGradientRectI(ptr ptr) @ stdcall GdipGetPathGradientSurroundColorCount(ptr ptr) @ stdcall GdipGetPathGradientSurroundColorsWithCount(ptr ptr ptr) -@ stub GdipGetPathGradientTransform +@ stdcall GdipGetPathGradientTransform(ptr ptr) @ stdcall GdipGetPathGradientWrapMode(ptr ptr) @ stdcall GdipGetPathLastPoint(ptr ptr) @ stdcall GdipGetPathPoints(ptr ptr long)
1
0
0
0
Vincent Povirk : gdiplus: Stub GdipSetPathGradientLinearBlend.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 41f42632778dbb1a9f956b7efc729cb8c83b676e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41f42632778dbb1a9f956b7ef…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 24 17:26:12 2010 -0500 gdiplus: Stub GdipSetPathGradientLinearBlend. --- dlls/gdiplus/brush.c | 13 +++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 44b0279..39e78fb 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1467,6 +1467,19 @@ GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST RE return NotImplemented; } +GpStatus WINGDIPAPI GdipSetPathGradientLinearBlend(GpPathGradient *brush, + REAL focus, REAL scale) +{ + static int calls; + + TRACE("(%p,%0.2f,%0.2f)\n", brush, focus, scale); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient *brush, GDIPCONST ARGB *blend, GDIPCONST REAL *pos, INT count) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 8b3257e..c4309e5 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -554,7 +554,7 @@ @ stdcall GdipSetPathGradientCenterPointI(ptr ptr) @ stdcall GdipSetPathGradientFocusScales(ptr long long) @ stdcall GdipSetPathGradientGammaCorrection(ptr long) -@ stub GdipSetPathGradientLinearBlend +@ stdcall GdipSetPathGradientLinearBlend(ptr long long) @ stub GdipSetPathGradientPath @ stdcall GdipSetPathGradientPresetBlend(ptr ptr ptr long) @ stdcall GdipSetPathGradientSigmaBlend(ptr long long)
1
0
0
0
Vincent Povirk : gdiplus: Stub GdipScalePathGradientTransform.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 462c5993350fd4c1cfe71a09931360975e2fc8e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=462c5993350fd4c1cfe71a099…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 24 17:24:11 2010 -0500 gdiplus: Stub GdipScalePathGradientTransform. --- dlls/gdiplus/brush.c | 13 +++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 1d81f62..44b0279 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1640,6 +1640,19 @@ GpStatus WINGDIPAPI GdipRotatePathGradientTransform(GpPathGradient *grad, return NotImplemented; } +GpStatus WINGDIPAPI GdipScalePathGradientTransform(GpPathGradient *grad, + REAL sx, REAL sy, GpMatrixOrder order) +{ + static int calls; + + TRACE("(%p,%0.2f,%0.2f,%i)\n", grad, sx, sy, order); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb) { TRACE("(%p, %x)\n", sf, argb); diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 90ad933..8b3257e 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -498,7 +498,7 @@ @ stdcall GdipSaveImageToStream(ptr ptr ptr ptr) @ stdcall GdipScaleLineTransform(ptr long long long) @ stdcall GdipScaleMatrix(ptr long long long) -@ stub GdipScalePathGradientTransform +@ stdcall GdipScalePathGradientTransform(ptr long long long) @ stdcall GdipScalePenTransform(ptr long long long) @ stdcall GdipScaleTextureTransform(ptr long long long) @ stdcall GdipScaleWorldTransform(ptr long long long)
1
0
0
0
Vincent Povirk : gdiplus: Stub GdipRotatePathGradientTransform.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: b56f3c3b21f7ba139eac7eedeb3ccd7a874aa62b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b56f3c3b21f7ba139eac7eede…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 24 17:24:11 2010 -0500 gdiplus: Stub GdipRotatePathGradientTransform. --- dlls/gdiplus/brush.c | 13 +++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 4b90dac..1d81f62 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1627,6 +1627,19 @@ GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform(GpPathGradient *grad, return NotImplemented; } +GpStatus WINGDIPAPI GdipRotatePathGradientTransform(GpPathGradient *grad, + REAL angle, GpMatrixOrder order) +{ + static int calls; + + TRACE("(%p,%0.2f,%i)\n", grad, angle, order); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb) { TRACE("(%p, %x)\n", sf, argb); diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 91e3e59..90ad933 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -487,7 +487,7 @@ @ stdcall GdipReversePath(ptr) @ stdcall GdipRotateLineTransform(ptr long long) @ stdcall GdipRotateMatrix(ptr long long) -@ stub GdipRotatePathGradientTransform +@ stdcall GdipRotatePathGradientTransform(ptr long long) @ stdcall GdipRotatePenTransform(ptr long long) @ stdcall GdipRotateTextureTransform(ptr long long) @ stdcall GdipRotateWorldTransform(ptr long long)
1
0
0
0
Vincent Povirk : gdiplus: Stub GdipSetPathGradientTransform.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 1fdecda9da804f33bfa31a2b67922f990b839e08 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fdecda9da804f33bfa31a2b6…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 24 17:19:18 2010 -0500 gdiplus: Stub GdipSetPathGradientTransform. --- dlls/gdiplus/brush.c | 13 +++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 3063a64..4b90dac 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1601,6 +1601,19 @@ GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient *grad, return Ok; } +GpStatus WINGDIPAPI GdipSetPathGradientTransform(GpPathGradient *grad, + GpMatrix *matrix) +{ + static int calls; + + TRACE("(%p,%p)\n", grad, matrix); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipMultiplyPathGradientTransform(GpPathGradient *grad, GDIPCONST GpMatrix *matrix, GpMatrixOrder order) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 5cb755c..91e3e59 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -559,7 +559,7 @@ @ stdcall GdipSetPathGradientPresetBlend(ptr ptr ptr long) @ stdcall GdipSetPathGradientSigmaBlend(ptr long long) @ stdcall GdipSetPathGradientSurroundColorsWithCount(ptr ptr ptr) -@ stub GdipSetPathGradientTransform +@ stdcall GdipSetPathGradientTransform(ptr ptr) @ stdcall GdipSetPathGradientWrapMode(ptr long) @ stdcall GdipSetPathMarker(ptr) @ stdcall GdipSetPenBrushFill(ptr ptr)
1
0
0
0
Vincent Povirk : gdiplus: Create HBITMAP-less bitmap objects for exotic pixel formats.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 9a6eabf0b52e7d8f9728ba7a3afe2659a7ebed73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a6eabf0b52e7d8f9728ba7a3…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 16:18:40 2010 -0500 gdiplus: Create HBITMAP-less bitmap objects for exotic pixel formats. --- dlls/gdiplus/gdiplus_private.h | 3 + dlls/gdiplus/graphics.c | 39 +++++++++++++++ dlls/gdiplus/image.c | 103 ++++++++++++++++++++++++++-------------- dlls/gdiplus/tests/graphics.c | 6 +- 4 files changed, 113 insertions(+), 38 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 908a1b7..f3393d4 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -49,6 +49,8 @@ extern REAL gdiplus_atan2(REAL dy, REAL dx); extern GpStatus hresult_to_status(HRESULT res); extern REAL convert_unit(REAL logpixels, GpUnit unit); +extern GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics); + extern void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2); extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, @@ -269,6 +271,7 @@ struct GpBitmap{ HDC hdc; BYTE *bits; /* actual image bits if this is a DIB */ INT stride; /* stride of bits if this is a DIB */ + BYTE *own_bits; /* image bits that need to be freed with this object */ }; struct GpCachedBitmap{ diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 79290b5..e748477 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1254,6 +1254,45 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra return Ok; } +GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) +{ + GpStatus retval; + + *graphics = GdipAlloc(sizeof(GpGraphics)); + if(!*graphics) return OutOfMemory; + + if((retval = GdipCreateMatrix(&(*graphics)->worldtrans)) != Ok){ + GdipFree(*graphics); + return retval; + } + + if((retval = GdipCreateRegion(&(*graphics)->clip)) != Ok){ + GdipFree((*graphics)->worldtrans); + GdipFree(*graphics); + return retval; + } + + (*graphics)->hdc = NULL; + (*graphics)->hwnd = NULL; + (*graphics)->owndc = FALSE; + (*graphics)->image = image; + (*graphics)->smoothing = SmoothingModeDefault; + (*graphics)->compqual = CompositingQualityDefault; + (*graphics)->interpolation = InterpolationModeDefault; + (*graphics)->pixeloffset = PixelOffsetModeDefault; + (*graphics)->compmode = CompositingModeSourceOver; + (*graphics)->unit = UnitDisplay; + (*graphics)->scale = 1.0; + (*graphics)->busy = FALSE; + (*graphics)->textcontrast = 4; + list_init(&(*graphics)->containers); + (*graphics)->contid = 0; + + TRACE("<-- %p\n", *graphics); + + return Ok; +} + GpStatus WINGDIPAPI GdipCreateFromHWND(HWND hwnd, GpGraphics **graphics) { GpStatus ret; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 57c9f83..536eebb 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1626,10 +1626,10 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { BITMAPINFO* pbmi; - HBITMAP hbitmap; + HBITMAP hbitmap=NULL; INT row_size, dib_stride; HDC hdc; - BYTE *bits; + BYTE *bits=NULL, *own_bits=NULL; int i; REAL xres, yres; GpStatus stat; @@ -1655,39 +1655,63 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, if(stride == 0) stride = dib_stride; - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - if (!pbmi) - return OutOfMemory; + if (format & PixelFormatGDI) + { + 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 */ - 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; + 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 */ + 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) { + GdipFree(pbmi); + return GenericError; + } - hdc = CreateCompatibleDC(NULL); - if (!hdc) { + hbitmap = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + + DeleteDC(hdc); GdipFree(pbmi); - return GenericError; - } - hbitmap = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); + if (!hbitmap) return GenericError; + } + else + { + /* Not a GDI format; don't try to make an HBITMAP. */ + if (scan0) + { + /* FIXME: We should do this with GDI formats too when scan0 is + * provided, but for now we need the HDC for most drawing + * operations. */ + bits = scan0; + } + else + { + INT size = abs(stride) * height; - DeleteDC(hdc); - GdipFree(pbmi); + own_bits = bits = GdipAlloc(size); + if (!own_bits) return OutOfMemory; - if (!hbitmap) return GenericError; + if (stride < 0) + bits += stride * (1 - height); + } + } /* copy bits to the dib if necessary */ /* FIXME: should reference the bits instead of copying them */ - if (scan0) + if (scan0 && bits != scan0) for (i=0; i<height; i++) memcpy(bits+i*dib_stride, scan0+i*stride, row_size); @@ -1695,6 +1719,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, if(!*bitmap) { DeleteObject(hbitmap); + GdipFree(own_bits); return OutOfMemory; } @@ -1715,6 +1740,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, (*bitmap)->hdc = NULL; (*bitmap)->bits = bits; (*bitmap)->stride = dib_stride; + (*bitmap)->own_bits = own_bits; if (format == PixelFormat1bppIndexed || format == PixelFormat4bppIndexed || @@ -1916,6 +1942,7 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) dst->hdc = src->hdc; dst->bits = src->bits; dst->stride = src->stride; + dst->own_bits = src->own_bits; GdipFree(src); } @@ -1932,6 +1959,7 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) if (image->type == ImageTypeBitmap) { GdipFree(((GpBitmap*)image)->bitmapbits); + GdipFree(((GpBitmap*)image)->own_bits); DeleteDC(((GpBitmap*)image)->hdc); DeleteObject(((GpBitmap*)image)->hbitmap); } @@ -2048,18 +2076,23 @@ GpStatus WINGDIPAPI GdipGetImageGraphicsContext(GpImage *image, return NotImplemented; } - hdc = ((GpBitmap*)image)->hdc; + if (((GpBitmap*)image)->hbitmap) + { + hdc = ((GpBitmap*)image)->hdc; - if(!hdc){ - hdc = CreateCompatibleDC(0); - SelectObject(hdc, ((GpBitmap*)image)->hbitmap); - ((GpBitmap*)image)->hdc = hdc; - } + if(!hdc){ + hdc = CreateCompatibleDC(0); + SelectObject(hdc, ((GpBitmap*)image)->hbitmap); + ((GpBitmap*)image)->hdc = hdc; + } - stat = GdipCreateFromHDC(hdc, graphics); + stat = GdipCreateFromHDC(hdc, graphics); - if (stat == Ok) - (*graphics)->image = image; + if (stat == Ok) + (*graphics)->image = image; + } + else + stat = graphics_from_image(image, graphics); return stat; } diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 441367e..609f426 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -2616,7 +2616,7 @@ static void test_GdipGetNearestColor(void) GdipDisposeImage((GpImage*)bitmap); status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat48bppRGB, NULL, &bitmap); - todo_wine expect(Ok, status); + expect(Ok, status); if (status == Ok) { status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); @@ -2629,7 +2629,7 @@ static void test_GdipGetNearestColor(void) } status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppARGB, NULL, &bitmap); - todo_wine expect(Ok, status); + expect(Ok, status); if (status == Ok) { status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics); @@ -2642,7 +2642,7 @@ static void test_GdipGetNearestColor(void) } status = GdipCreateBitmapFromScan0(10, 10, 10, PixelFormat64bppPARGB, NULL, &bitmap); - todo_wine expect(Ok, status); + expect(Ok, status); if (status == Ok) { status = GdipGetImageGraphicsContext((GpImage*)bitmap, &graphics);
1
0
0
0
Vincent Povirk : gdiplus: Don' t require an HDC to get the resolution of a graphics object.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 963c7090d558a7bd2991e13620b1112348a921df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=963c7090d558a7bd2991e1362…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 15:53:08 2010 -0500 gdiplus: Don't require an HDC to get the resolution of a graphics object. --- dlls/gdiplus/graphics.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index ccec25d..79290b5 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4574,7 +4574,10 @@ GpStatus WINGDIPAPI GdipGetDpiX(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); + if (graphics->image) + *dpi = graphics->image->xres; + else + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); return Ok; } @@ -4589,7 +4592,10 @@ GpStatus WINGDIPAPI GdipGetDpiY(GpGraphics *graphics, REAL* dpi) if(graphics->busy) return ObjectBusy; - *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); + if (graphics->image) + *dpi = graphics->image->yres; + else + *dpi = (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSY); return Ok; }
1
0
0
0
Vincent Povirk : gdiplus: Give a nice warning when we try to draw to an HDC-less graphics.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: c3ca6be2b9e51faeb2469ed2d064e49a88c02cee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3ca6be2b9e51faeb2469ed2d…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 15:34:23 2010 -0500 gdiplus: Give a nice warning when we try to draw to an HDC-less graphics. --- dlls/gdiplus/graphics.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 86 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index ced0d40..ccec25d 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -94,10 +94,17 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) { HPEN gdipen; REAL width; - INT save_state = SaveDC(graphics->hdc), i, numdashes; + INT save_state, i, numdashes; GpPointF pt[2]; DWORD dash_array[MAX_DASHLEN]; + if (!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + } + + save_state = SaveDC(graphics->hdc); + EndPath(graphics->hdc); if(pen->unit == UnitPixel){ @@ -1973,6 +1980,11 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (image->picture) { + if (!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + } + /* FIXME: partially implemented (only works for rectangular parallelograms) */ if(srcUnit == UnitInch) dx = dy = (REAL) INCH_HIMETRIC; @@ -2772,6 +2784,12 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + ptf[0].X = x; ptf[0].Y = y; ptf[1].X = x + width; @@ -2814,6 +2832,12 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *p if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE @@ -2851,6 +2875,12 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + save_state = SaveDC(graphics->hdc); EndPath(graphics->hdc); @@ -2890,6 +2920,12 @@ GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics *graphics, GpBrush *brush, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + ptf = GdipAlloc(count * sizeof(GpPointF)); pti = GdipAlloc(count * sizeof(POINT)); if(!ptf || !pti){ @@ -2937,6 +2973,12 @@ GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics *graphics, GpBrush *brush, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + ptf = GdipAlloc(count * sizeof(GpPointF)); pti = GdipAlloc(count * sizeof(POINT)); if(!ptf || !pti){ @@ -3002,6 +3044,12 @@ GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + ptf[0].X = x; ptf[0].Y = y; ptf[1].X = x + width; @@ -3042,6 +3090,12 @@ GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + ptf[0].X = x; ptf[0].Y = y; ptf[1].X = x + width; @@ -3134,6 +3188,12 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush, if(graphics->busy) return ObjectBusy; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return Ok; + } + status = GdipGetRegionHRgn(region, graphics, &hrgn); if(status != Ok) return status; @@ -3744,6 +3804,12 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, if (regionCount < stringFormat->range_count) return InvalidParameter; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return NotImplemented; + } + if (stringFormat->attr) TRACE("may be ignoring some format flags: attr %x\n", stringFormat->attr); @@ -3813,6 +3879,12 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, if(!graphics || !string || !font || !rect || !bounds) return InvalidParameter; + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return NotImplemented; + } + if(linesfilled) *linesfilled = 0; if(codepointsfitted) *codepointsfitted = 0; @@ -3886,6 +3958,12 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string return NotImplemented; } + if(!graphics->hdc) + { + FIXME("graphics object has no HDC\n"); + return NotImplemented; + } + if(format){ TRACE("may be ignoring some format flags: attr %x\n", format->attr); @@ -4549,6 +4627,13 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc) if(graphics->busy) return ObjectBusy; + if (!graphics->hdc) + { + WARN("no HDC for this graphics\n"); + *hdc = NULL; + return GenericError; + } + *hdc = graphics->hdc; graphics->busy = TRUE;
1
0
0
0
Vincent Povirk : gdiplus: Don't require an HDC in get_graphics_bounds.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 5601860b76fe61ae8d6a1ea18ad737674f91256b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5601860b76fe61ae8d6a1ea18…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 15:31:03 2010 -0500 gdiplus: Don't require an HDC in get_graphics_bounds. --- dlls/gdiplus/graphics.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 094ed61..ced0d40 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1137,6 +1137,8 @@ static GpStatus restore_container(GpGraphics* graphics, static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect) { RECT wnd_rect; + GpStatus stat=Ok; + GpUnit unit; if(graphics->hwnd) { if(!GetClientRect(graphics->hwnd, &wnd_rect)) @@ -1146,6 +1148,10 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect) rect->Y = wnd_rect.top; rect->Width = wnd_rect.right - wnd_rect.left; rect->Height = wnd_rect.bottom - wnd_rect.top; + }else if (graphics->image){ + stat = GdipGetImageBounds(graphics->image, rect, &unit); + if (stat == Ok && unit != UnitPixel) + FIXME("need to convert from unit %i\n", unit); }else{ rect->X = 0; rect->Y = 0; @@ -1153,7 +1159,7 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect) rect->Height = GetDeviceCaps(graphics->hdc, VERTRES); } - return Ok; + return stat; } /* on success, rgn will contain the region of the graphics object which
1
0
0
0
Vincent Povirk : gdiplus: Don' t require an HDC for the convert_unit function.
by Alexandre Julliard
17 Aug '10
17 Aug '10
Module: wine Branch: master Commit: 85a57106881158ef7c7399cf2d10da445cfd529c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=85a57106881158ef7c7399cf2…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Sun Aug 8 15:24:45 2010 -0500 gdiplus: Don't require an HDC for the convert_unit function. --- dlls/gdiplus/gdiplus.c | 10 +++++----- dlls/gdiplus/gdiplus_private.h | 2 +- dlls/gdiplus/graphics.c | 12 +++++++++--- dlls/gdiplus/image.c | 23 +++++++++++++---------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 383f536..9bb9fab 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -314,18 +314,18 @@ GpStatus hresult_to_status(HRESULT res) } /* converts a given unit to its value in pixels */ -REAL convert_unit(HDC hdc, GpUnit unit) +REAL convert_unit(REAL logpixels, GpUnit unit) { switch(unit) { case UnitInch: - return (REAL) GetDeviceCaps(hdc, LOGPIXELSX); + return logpixels; case UnitPoint: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 72.0; + return logpixels / 72.0; case UnitDocument: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 300.0; + return logpixels / 300.0; case UnitMillimeter: - return ((REAL)GetDeviceCaps(hdc, LOGPIXELSX)) / 25.4; + return logpixels / 25.4; case UnitWorld: ERR("cannot convert UnitWorld\n"); return 0.0; diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index eafed7c..908a1b7 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -47,7 +47,7 @@ extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, REAL startAngle, REAL sweepAngle); extern REAL gdiplus_atan2(REAL dy, REAL dx); extern GpStatus hresult_to_status(HRESULT res); -extern REAL convert_unit(HDC hdc, GpUnit unit); +extern REAL convert_unit(REAL logpixels, GpUnit unit); extern void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2); diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index ada2c58..094ed61 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -84,6 +84,12 @@ static BYTE convert_path_point_type(BYTE type) return ret; } +static REAL graphics_res(GpGraphics *graphics) +{ + if (graphics->image) return graphics->image->xres; + else return (REAL)GetDeviceCaps(graphics->hdc, LOGPIXELSX); +} + static INT prepare_dc(GpGraphics *graphics, GpPen *pen) { HPEN gdipen; @@ -108,7 +114,7 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) width = sqrt((pt[1].X - pt[0].X) * (pt[1].X - pt[0].X) + (pt[1].Y - pt[0].Y) * (pt[1].Y - pt[0].Y)) / sqrt(2.0); - width *= pen->width * convert_unit(graphics->hdc, + width *= pen->width * convert_unit(graphics_res(graphics), pen->unit == UnitWorld ? graphics->unit : pen->unit); } @@ -156,7 +162,7 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti, GpMatrix *matrix; int i; - unitscale = convert_unit(graphics->hdc, graphics->unit); + unitscale = convert_unit(graphics_res(graphics), graphics->unit); /* apply page scale */ if(graphics->unit != UnitDisplay) @@ -4602,7 +4608,7 @@ GpStatus WINGDIPAPI GdipTransformPoints(GpGraphics *graphics, GpCoordinateSpace stat = GdipCreateMatrix(&matrix); if (stat == Ok) { - unitscale = convert_unit(graphics->hdc, graphics->unit); + unitscale = convert_unit(graphics_res(graphics), graphics->unit); if(graphics->unit != UnitDisplay) unitscale *= graphics->scale; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index d72ae8d..57c9f83 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2008,14 +2008,15 @@ GpStatus WINGDIPAPI GdipGetImageDimension(GpImage *image, REAL *width, if(image->type == ImageTypeMetafile){ HDC hdc = GetDC(0); + REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); - *height = convert_unit(hdc, ((GpMetafile*)image)->unit) * + ReleaseDC(0, hdc); + + *height = convert_unit(res, ((GpMetafile*)image)->unit) * ((GpMetafile*)image)->bounds.Height; - *width = convert_unit(hdc, ((GpMetafile*)image)->unit) * + *width = convert_unit(res, ((GpMetafile*)image)->unit) * ((GpMetafile*)image)->bounds.Width; - - ReleaseDC(0, hdc); } else if(image->type == ImageTypeBitmap){ @@ -2072,11 +2073,12 @@ GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height) if(image->type == ImageTypeMetafile){ HDC hdc = GetDC(0); - - *height = roundr(convert_unit(hdc, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Height); + REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); ReleaseDC(0, hdc); + + *height = roundr(convert_unit(res, ((GpMetafile*)image)->unit) * + ((GpMetafile*)image)->bounds.Height); } else if(image->type == ImageTypeBitmap) *height = ((GpBitmap*)image)->height; @@ -2178,11 +2180,12 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width) if(image->type == ImageTypeMetafile){ HDC hdc = GetDC(0); - - *width = roundr(convert_unit(hdc, ((GpMetafile*)image)->unit) * - ((GpMetafile*)image)->bounds.Width); + REAL res = (REAL)GetDeviceCaps(hdc, LOGPIXELSX); ReleaseDC(0, hdc); + + *width = roundr(convert_unit(res, ((GpMetafile*)image)->unit) * + ((GpMetafile*)image)->bounds.Width); } else if(image->type == ImageTypeBitmap) *width = ((GpBitmap*)image)->width;
1
0
0
0
← Newer
1
...
57
58
59
60
61
62
63
...
89
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
86
87
88
89
Results per page:
10
25
50
100
200