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
September 2017
----- 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
446 discussions
Start a n
N
ew thread
Vincent Povirk : gdiplus: Send paths to gdi32 in device coordinates.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: e127101122e08e0f5bab196dc4f0349f9a281235 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e127101122e08e0f5bab196dc…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 31 14:14:07 2017 -0500 gdiplus: Send paths to gdi32 in device coordinates. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 59 ++++++++++++++++++++++++++++++++++++++----------- dlls/gdiplus/region.c | 4 ++++ 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3ac9952..f4dc3e6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -249,6 +249,14 @@ static INT prepare_dc(GpGraphics *graphics, GpPen *pen) width *= units_to_pixels(pen->width, pen->unit == UnitWorld ? graphics->unit : pen->unit, graphics->xres); width *= graphics->scale; + + pt[0].X = 0.0; + pt[0].Y = 0.0; + pt[1].X = 1.0; + pt[1].Y = 1.0; + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceDevice, pt, 2); + 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); } if(pen->dash == DashStyleCustom){ @@ -1573,7 +1581,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s ptf[3].X = x2 - dbig; ptf[2].X = x2 + dsmall; - transform_and_round_points(graphics, pt, ptf, 4); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); + Polygon(graphics->hdc, pt, 4); break; @@ -1595,7 +1606,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s ptf[2].X = x2; ptf[2].Y = y2; - transform_and_round_points(graphics, pt, ptf, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); + Polygon(graphics->hdc, pt, 3); break; @@ -1607,7 +1621,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s ptf[1].X = x2 + dx; ptf[1].Y = y2 + dy; - transform_and_round_points(graphics, pt, ptf, 2); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); + Ellipse(graphics->hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y); break; @@ -1627,7 +1644,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s ptf[2].X = x2 + dx; ptf[2].Y = y2 + dy; - transform_and_round_points(graphics, pt, ptf, 3); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); + Polygon(graphics->hdc, pt, 3); break; @@ -1647,7 +1667,10 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s ptf[3].X = x2 + dx; ptf[3].Y = y2 + dy; - transform_and_round_points(graphics, pt, ptf, 4); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); + Pie(graphics->hdc, pt[0].x, pt[0].y, pt[1].x, pt[1].y, pt[2].x, pt[2].y, pt[3].x, pt[3].y); @@ -1673,7 +1696,9 @@ static void draw_cap(GpGraphics *graphics, COLORREF color, GpLineCap cap, REAL s GdipTranslateMatrix(&matrix, x2, y2, MatrixOrderAppend); GdipTransformMatrixPoints(&matrix, custptf, count); - transform_and_round_points(graphics, custpt, custptf, count); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 3); + + round_points(pt, ptf, 3); for(i = 0; i < count; i++) tp[i] = convert_path_point_type(custom->pathdata.Types[i]); @@ -1896,7 +1921,9 @@ static GpStatus draw_poly(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF * } } - transform_and_round_points(graphics, pti, ptcopy, count); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptcopy, count); + + round_points(pti, ptcopy, count); for(i = 0; i < count; i++){ tp[i] = convert_path_point_type(types[i]); @@ -3433,9 +3460,13 @@ static GpStatus GDI32_GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *pat if (hrgn) ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + gdi_transform_acquire(graphics); + retval = draw_poly(graphics, pen, path->pathdata.Points, path->pathdata.Types, path->pathdata.Count, TRUE); + gdi_transform_release(graphics); + end: restore_dc(graphics, save_state); DeleteObject(hrgn); @@ -4114,17 +4145,19 @@ static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath if (hrgn) ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + gdi_transform_acquire(graphics); + BeginPath(graphics->hdc); retval = draw_poly(graphics, NULL, path->pathdata.Points, path->pathdata.Types, path->pathdata.Count, FALSE); - if(retval != Ok) - goto end; - - EndPath(graphics->hdc); - brush_fill_path(graphics, brush); + if(retval == Ok) + { + EndPath(graphics->hdc); + brush_fill_path(graphics, brush); + } - retval = Ok; + gdi_transform_release(graphics); end: RestoreDC(graphics->hdc, save_state); diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 015b677..8a2ca6b 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1059,6 +1059,8 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn) SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE : WINDING)); + gdi_transform_acquire(graphics); + stat = trace_path(graphics, path); if (stat == Ok) { @@ -1066,6 +1068,8 @@ static GpStatus get_path_hrgn(GpPath *path, GpGraphics *graphics, HRGN *hrgn) stat = *hrgn ? Ok : OutOfMemory; } + gdi_transform_release(graphics); + RestoreDC(graphics->hdc, save_state); if (new_hdc) {
1
0
0
0
Vincent Povirk : gdiplus: Account for gdi32 transform in GdipDrawImage.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: 93e8507aeada4eef8550aad44e6d38c877e52ea3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93e8507aeada4eef8550aad44…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 31 14:14:06 2017 -0500 gdiplus: Account for gdi32 transform in GdipDrawImage. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 49 +++++++++++++++++++------------------------------ 1 file changed, 19 insertions(+), 30 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index a7da283..3ac9952 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -284,43 +284,23 @@ static void restore_dc(GpGraphics *graphics, INT state) RestoreDC(graphics->hdc, state); } -/* This helper applies all the changes that the points listed in ptf need in - * order to be drawn on the device context. In the end, this should include at - * least: - * -scaling by page unit - * -applying world transformation - * -converting from float to int - * Native gdiplus uses gdi32 to do all this (via SetMapMode, SetViewportExtEx, - * SetWindowExtEx, SetWorldTransform, etc.) but we cannot because we are using - * gdi to draw, and these functions would irreparably mess with line widths. - */ -static void transform_and_round_points(GpGraphics *graphics, POINT *pti, - GpPointF *ptf, INT count) +static void round_points(POINT *pti, GpPointF *ptf, INT count) { - REAL scale_x, scale_y; - GpMatrix matrix; int i; - scale_x = units_to_pixels(1.0, graphics->unit, graphics->xres); - scale_y = units_to_pixels(1.0, graphics->unit, graphics->yres); - - /* apply page scale */ - if(graphics->unit != UnitDisplay) - { - scale_x *= graphics->scale; - scale_y *= graphics->scale; - } - - matrix = graphics->worldtrans; - GdipScaleMatrix(&matrix, scale_x, scale_y, MatrixOrderAppend); - GdipTransformMatrixPoints(&matrix, ptf, count); - for(i = 0; i < count; i++){ pti[i].x = gdip_round(ptf[i].X); pti[i].y = gdip_round(ptf[i].Y); } } +static void transform_and_round_points(GpGraphics *graphics, POINT *pti, + GpPointF *ptf, INT count) +{ + gdip_transform_points(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, ptf, count); + round_points(pti, ptf, count); +} + static void gdi_alpha_blend(GpGraphics *graphics, INT dst_x, INT dst_y, INT dst_width, INT dst_height, HDC hdc, INT src_x, INT src_y, INT src_width, INT src_height) { @@ -2943,7 +2923,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; if (!srcwidth || !srcheight || (ptf[3].X == ptf[0].X && ptf[3].Y == ptf[0].Y)) return Ok; - transform_and_round_points(graphics, pti, ptf, 4); + gdip_transform_points(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, ptf, 4); + round_points(pti, ptf, 4); TRACE("%s %s %s %s\n", wine_dbgstr_point(&pti[0]), wine_dbgstr_point(&pti[1]), wine_dbgstr_point(&pti[2]), wine_dbgstr_point(&pti[3])); @@ -3005,7 +2986,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y; } - stat = get_graphics_bounds(graphics, &graphics_bounds); + stat = get_graphics_device_bounds(graphics, &graphics_bounds); if (stat != Ok) return stat; if (graphics_bounds.X > dst_area.left) dst_area.left = floorf(graphics_bounds.X); @@ -3121,10 +3102,14 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image dst_stride = src_stride; } + gdi_transform_acquire(graphics); + 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, lockeddata.PixelFormat); + gdi_transform_release(graphics); + heap_free(src_data); heap_free(dst_dyn_data); @@ -3208,6 +3193,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image DeleteObject(hrgn); } + gdi_transform_acquire(graphics); + if (bitmap->format & (PixelFormatAlpha|PixelFormatPAlpha)) { gdi_alpha_blend(graphics, pti[0].x, pti[0].y, pti[1].x - pti[0].x, pti[2].y - pti[0].y, @@ -3219,6 +3206,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image hdc, srcx, srcy, srcwidth, srcheight, SRCCOPY); } + gdi_transform_release(graphics); + RestoreDC(graphics->hdc, save_state); if (temp_hdc)
1
0
0
0
Vincent Povirk : gdiplus: Use SOFTWARE_GdipDrawPath with alpha hdc's.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: be952527f2c95c85532fd4a7e28e3ab5689235ed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be952527f2c95c85532fd4a7e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 31 14:14:05 2017 -0500 gdiplus: Use SOFTWARE_GdipDrawPath with alpha hdc's. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index e19fefc..a7da283 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3859,7 +3859,7 @@ GpStatus WINGDIPAPI GdipDrawPath(GpGraphics *graphics, GpPen *pen, GpPath *path) if (graphics->image && graphics->image->type == ImageTypeMetafile) retval = METAFILE_DrawPath((GpMetafile*)graphics->image, pen, path); - else if (!graphics->hdc || !brush_can_fill_path(pen->brush, FALSE)) + else if (!graphics->hdc || graphics->alpha_hdc || !brush_can_fill_path(pen->brush, FALSE)) retval = SOFTWARE_GdipDrawPath(graphics, pen, path); else retval = GDI32_GdipDrawPath(graphics, pen, path);
1
0
0
0
Vincent Povirk : gdiplus: Account for gdi transform in brush_fill_pixels.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: 0914f626af73b6fb10826178d6736a873113fc84 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0914f626af73b6fb10826178d…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 31 14:14:04 2017 -0500 gdiplus: Account for gdi transform in brush_fill_pixels. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/graphics.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 7aa1dac..e19fefc 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1169,8 +1169,8 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush, /* Transform the points to a co-ordinate space where X is the point's * position in the gradient, 0.0 being the start point and 1.0 the * end point. */ - stat = GdipTransformPoints(graphics, CoordinateSpaceWorld, - CoordinateSpaceDevice, draw_points, 3); + stat = gdip_transform_points(graphics, CoordinateSpaceWorld, + WineCoordinateSpaceGdiDevice, draw_points, 3); if (stat == Ok) { @@ -1230,8 +1230,8 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush, draw_points[2].Y = fill_area->Y+1; /* Transform the points to the co-ordinate space of the bitmap. */ - stat = GdipTransformPoints(graphics, CoordinateSpaceWorld, - CoordinateSpaceDevice, draw_points, 3); + stat = gdip_transform_points(graphics, CoordinateSpaceWorld, + WineCoordinateSpaceGdiDevice, draw_points, 3); if (stat == Ok) { @@ -1361,7 +1361,7 @@ static GpStatus brush_fill_pixels(GpGraphics *graphics, GpBrush *brush, if (stat != Ok) return stat; - stat = get_graphics_transform(graphics, CoordinateSpaceDevice, + stat = get_graphics_transform(graphics, WineCoordinateSpaceGdiDevice, CoordinateSpaceWorld, &world_to_device); if (stat == Ok) {
1
0
0
0
Paul Gofman : d3dx9: Do not fail effect creation if a shader cannot be created.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: 6c7c511a277d1413bab0d805756f7bf2782a0150 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c7c511a277d1413bab0d8057…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Aug 31 21:56:58 2017 +0300 d3dx9: Do not fail effect creation if a shader cannot be created. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/effect.c | 4 ++-- dlls/d3dx9_36/tests/effect.c | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c index 864f0e5..2cd0c22 100644 --- a/dlls/d3dx9_36/effect.c +++ b/dlls/d3dx9_36/effect.c @@ -5938,7 +5938,7 @@ static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_o (IDirect3DVertexShader9 **)param->data))) { WARN("Failed to create vertex shader.\n"); - return hr; + return D3D_OK; } break; case D3DXPT_PIXELSHADER: @@ -5946,7 +5946,7 @@ static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_o (IDirect3DPixelShader9 **)param->data))) { WARN("Failed to create pixel shader.\n"); - return hr; + return D3D_OK; } break; default: diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 66abd0a..bb26fe4 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -7087,17 +7087,13 @@ static void test_effect_unsupported_shader(void) hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob), NULL, NULL, NULL, 0, NULL, &effect, NULL); - todo_wine ok(hr == D3D_OK, "Got result %#x.\n", hr); - if (FAILED(hr)) - { - skip("Failed to create effect, skipping test.\n"); - goto cleanup; - } hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique"); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); hr = effect->lpVtbl->ValidateTechnique(effect, "tech0"); + todo_wine ok(hr == E_FAIL, "Got result %#x.\n", hr); hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); @@ -7105,6 +7101,7 @@ static void test_effect_unsupported_shader(void) effect->lpVtbl->SetInt(effect, "i", 1); ok(hr == D3D_OK, "Got result %#x.\n", hr); hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); + todo_wine ok(hr == E_FAIL, "Got result %#x.\n", hr); effect->lpVtbl->SetInt(effect, "i", 0); hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); @@ -7158,7 +7155,7 @@ static void test_effect_unsupported_shader(void) ok(!vshader, "Got non NULL vshader.\n"); effect->lpVtbl->Release(effect); -cleanup: + refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); IDirect3D9_Release(d3d);
1
0
0
0
Paul Gofman : d3dx9/tests: Add test for effect with unsupported shader.
by Alexandre Julliard
01 Sep '17
01 Sep '17
Module: wine Branch: master Commit: c3677ecfc8ec919fcf6f0a70cb4fc866c376e9f7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c3677ecfc8ec919fcf6f0a70c…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Thu Aug 31 21:56:57 2017 +0300 d3dx9/tests: Add test for effect with unsupported shader. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/tests/effect.c | 185 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c index 9658d2d..66abd0a 100644 --- a/dlls/d3dx9_36/tests/effect.c +++ b/dlls/d3dx9_36/tests/effect.c @@ -6981,6 +6981,190 @@ static void test_effect_skip_constants(IDirect3DDevice9 *device) effect->lpVtbl->Release(effect); } +#if 0 +vertexshader vs_arr[2] = +{ + asm + { + vs_3_0 + def c0, 1, 1, 1, 1 + dcl_position o0 + mov o0, c0 + }, + + asm + { + vs_3_sw + def c256, 1, 1, 1, 1 + dcl_position o0 + mov o0, c256 + }, +}; + +int i; + +technique tech0 +{ + pass p0 + { + VertexShader = vs_arr[1]; + } +} +technique tech1 +{ + pass p0 + { + VertexShader = vs_arr[i]; + } +} +#endif +static const DWORD test_effect_unsupported_shader_blob[] = +{ + 0xfeff0901, 0x000000ac, 0x00000000, 0x00000010, 0x00000004, 0x00000020, 0x00000000, 0x00000002, + 0x00000001, 0x00000002, 0x00000007, 0x615f7376, 0x00007272, 0x00000002, 0x00000000, 0x0000004c, + 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000000, 0x00000002, 0x00000069, 0x00000003, + 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00003070, 0x00000006, + 0x68636574, 0x00000030, 0x00000004, 0x00000010, 0x00000004, 0x00000000, 0x00000000, 0x00000000, + 0x00000003, 0x00003070, 0x00000006, 0x68636574, 0x00000031, 0x00000002, 0x00000002, 0x00000006, + 0x00000005, 0x00000004, 0x00000018, 0x00000000, 0x00000000, 0x0000002c, 0x00000048, 0x00000000, + 0x00000000, 0x00000074, 0x00000000, 0x00000001, 0x0000006c, 0x00000000, 0x00000001, 0x00000092, + 0x00000000, 0x00000058, 0x00000054, 0x000000a0, 0x00000000, 0x00000001, 0x00000098, 0x00000000, + 0x00000001, 0x00000092, 0x00000000, 0x00000084, 0x00000080, 0x00000002, 0x00000002, 0x00000001, + 0x00000038, 0xfffe0300, 0x05000051, 0xa00f0000, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40000, 0x0000ffff, 0x00000002, + 0x00000038, 0xfffe03ff, 0x05000051, 0xa00f0100, 0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000, + 0x0200001f, 0x80000000, 0xe00f0000, 0x02000001, 0xe00f0000, 0xa0e40100, 0x0000ffff, 0x00000001, + 0x00000000, 0xffffffff, 0x00000000, 0x00000002, 0x000000e4, 0x00000008, 0x615f7376, 0x00007272, + 0x46580200, 0x0023fffe, 0x42415443, 0x0000001c, 0x00000057, 0x46580200, 0x00000001, 0x0000001c, + 0x00000100, 0x00000054, 0x00000030, 0x00000002, 0x00000001, 0x00000034, 0x00000044, 0xabab0069, + 0x00020000, 0x00010001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x4d007874, 0x6f726369, 0x74666f73, 0x29522820, 0x534c4820, 0x6853204c, 0x72656461, 0x6d6f4320, + 0x656c6970, 0x2e392072, 0x392e3932, 0x332e3235, 0x00313131, 0x0002fffe, 0x54494c43, 0x00000000, + 0x000cfffe, 0x434c5846, 0x00000001, 0x10000001, 0x00000001, 0x00000000, 0x00000002, 0x00000000, + 0x00000000, 0x00000004, 0x00000000, 0xf0f0f0f0, 0x0f0f0f0f, 0x0000ffff, 0x00000000, 0x00000000, + 0xffffffff, 0x00000000, 0x00000001, 0x0000000a, 0x615f7376, 0x315b7272, 0x0000005d, +}; + +#define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS 81 +#define TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN 14 + +static void test_effect_unsupported_shader(void) +{ + D3DPRESENT_PARAMETERS present_parameters = {0}; + IDirect3DVertexShader9 *vshader; + unsigned int passes_count; + IDirect3DDevice9 *device; + UINT byte_code_size; + ID3DXEffect *effect; + IDirect3D9 *d3d; + void *byte_code; + ULONG refcount; + HWND window; + HRESULT hr; + + if (!(window = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, + 640, 480, NULL, NULL, NULL, NULL))) + { + skip("Couldn't create application window\n"); + return; + } + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Couldn't create IDirect3D9 object\n"); + DestroyWindow(window); + return; + } + present_parameters.Windowed = TRUE; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); + if (FAILED(hr)) { + skip("Failed to create IDirect3DDevice9 object, hr %#x\n", hr); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = D3DXCreateEffectEx(device, test_effect_unsupported_shader_blob, sizeof(test_effect_unsupported_shader_blob), + NULL, NULL, NULL, 0, NULL, &effect, NULL); + todo_wine + ok(hr == D3D_OK, "Got result %#x.\n", hr); + if (FAILED(hr)) + { + skip("Failed to create effect, skipping test.\n"); + goto cleanup; + } + + hr = effect->lpVtbl->ValidateTechnique(effect, "missing_technique"); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x.\n", hr); + hr = effect->lpVtbl->ValidateTechnique(effect, "tech0"); + ok(hr == E_FAIL, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + effect->lpVtbl->SetInt(effect, "i", 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); + ok(hr == E_FAIL, "Got result %#x.\n", hr); + effect->lpVtbl->SetInt(effect, "i", 0); + hr = effect->lpVtbl->ValidateTechnique(effect, "tech1"); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->SetTechnique(effect, "tech0"); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->Begin(effect, &passes_count, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->BeginPass(effect, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = IDirect3DDevice9_GetVertexShader(device, &vshader); + ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr); + ok(!vshader, "Got non NULL vshader.\n"); + + hr = effect->lpVtbl->EndPass(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->End(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = effect->lpVtbl->SetTechnique(effect, "tech1"); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->Begin(effect, &passes_count, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->BeginPass(effect, 0); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + + hr = IDirect3DDevice9_GetVertexShader(device, &vshader); + ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK).\n", hr); + ok(!!vshader, "Got NULL vshader.\n"); + hr = IDirect3DVertexShader9_GetFunction(vshader, NULL, &byte_code_size); + ok(hr == D3D_OK, "Got result %x.\n", hr); + byte_code = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, byte_code_size); + hr = IDirect3DVertexShader9_GetFunction(vshader, byte_code, &byte_code_size); + ok(hr == D3D_OK, "Got result %x.\n", hr); + ok(byte_code_size == TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_LEN * sizeof(DWORD), + "Got unexpected byte code size %u.\n", byte_code_size); + ok(!memcmp(byte_code, + &test_effect_unsupported_shader_blob[TEST_EFFECT_UNSUPPORTED_SHADER_BYTECODE_VS_3_0_POS], + byte_code_size), "Incorrect shader selected.\n"); + HeapFree(GetProcessHeap(), 0, byte_code); + IDirect3DVertexShader9_Release(vshader); + + effect->lpVtbl->SetInt(effect, "i", 1); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = effect->lpVtbl->CommitChanges(effect); + ok(hr == D3D_OK, "Got result %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexShader(device, &vshader); + ok(hr == D3D_OK, "Got result %x.\n", hr); + ok(!vshader, "Got non NULL vshader.\n"); + + effect->lpVtbl->Release(effect); +cleanup: + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(effect) { HWND wnd; @@ -7033,6 +7217,7 @@ START_TEST(effect) test_effect_large_address_aware_flag(device); test_effect_get_pass_desc(device); test_effect_skip_constants(device); + test_effect_unsupported_shader(); count = IDirect3DDevice9_Release(device); ok(count == 0, "The device was not properly freed: refcount %u\n", count);
1
0
0
0
← Newer
1
...
42
43
44
45
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
Results per page:
10
25
50
100
200