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
July 2012
----- 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
712 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdiplus: Factor out units_to_pixels() helper.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: ed8a3304c45ad7878cb514a3bfc101d0ee5ecd8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ed8a3304c45ad7878cb514a3b…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Jul 16 14:56:30 2012 +0900 gdiplus: Factor out units_to_pixels() helper. --- dlls/gdiplus/font.c | 70 ++++------------------------------------ dlls/gdiplus/gdiplus.c | 26 +++++++++++++++ dlls/gdiplus/gdiplus_private.h | 1 + 3 files changed, 34 insertions(+), 63 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index f4b75ef..26cd49d 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -118,41 +118,8 @@ typedef struct static GpStatus clone_font_family(const GpFontFamily *, GpFontFamily **); -static const REAL mm_per_inch = 25.4; -static const REAL inch_per_point = 1.0/72.0; - static GpFontCollection installedFontCollection = {0}; -static LONG em_size_to_pixel(REAL em_size, Unit unit, LONG dpi) -{ - switch (unit) - { - default: - FIXME("Unhandled unit type: %d\n", unit); - return 0; - - case UnitPixel: - case UnitWorld: - /* FIXME: Figure out when World != Pixel */ - return em_size; - case UnitDisplay: - FIXME("Unknown behavior for UnitDisplay! Please report!\n"); - /* FIXME: Figure out how this works... - * MSDN says that if "DISPLAY" is a monitor, then pixel should be - * used. That's not what I got. Tests on Windows revealed no output, - * and the tests in tests/font crash windows */ - return 0; - case UnitPoint: - return em_size * dpi * inch_per_point; - case UnitInch: - return em_size * dpi; - case UnitDocument: - return em_size * dpi / 300.0; /* Per MSDN */ - case UnitMillimeter: - return em_size * dpi / mm_per_inch; - } -} - /******************************************************************************* * GdipCreateFont [GDIPLUS.@] * @@ -195,7 +162,7 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, stat = GdipGetFamilyName(fontFamily, lfw.lfFaceName, LANG_NEUTRAL); if (stat != Ok) return stat; - lfw.lfHeight = -em_size_to_pixel(emSize, unit, fontFamily->dpi); + lfw.lfHeight = -units_to_pixels(emSize, unit, fontFamily->dpi); lfw.lfWeight = style & FontStyleBold ? FW_BOLD : FW_REGULAR; lfw.lfItalic = style & FontStyleItalic; lfw.lfUnderline = style & FontStyleUnderline; @@ -483,7 +450,7 @@ GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics, void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf) { /* FIXME: use graphics */ - lf->lfHeight = -em_size_to_pixel(font->emSize, font->unit, font->family->dpi); + lf->lfHeight = -units_to_pixels(font->emSize, font->unit, font->family->dpi); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; @@ -590,47 +557,24 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, GpStatus stat; INT style; UINT16 line_spacing, em_height; - REAL font_height, font_size; + REAL font_size; if (!font || !height) return InvalidParameter; TRACE("%p (%s), %f, %p\n", font, debugstr_w(font->family->FamilyName), dpi, height); - font_size = get_font_size(font); + font_size = units_to_pixels(get_font_size(font), font->unit, dpi); style = get_font_style(font); stat = GdipGetLineSpacing(font->family, style, &line_spacing); if (stat != Ok) return stat; stat = GdipGetEmHeight(font->family, style, &em_height); if (stat != Ok) return stat; - font_height = (REAL)line_spacing * font_size / (REAL)em_height; - - switch (font->unit) - { - case UnitPixel: - case UnitWorld: - *height = font_height; - break; - case UnitPoint: - *height = font_height * dpi * inch_per_point; - break; - case UnitInch: - *height = font_height * dpi; - break; - case UnitDocument: - *height = font_height * (dpi / 300.0); - break; - case UnitMillimeter: - *height = font_height * (dpi / mm_per_inch); - break; - default: - FIXME("Unhandled unit type: %d\n", font->unit); - return NotImplemented; - } + *height = (REAL)line_spacing * font_size / (REAL)em_height; - TRACE("%s,%d(unit %d) => %f\n", - debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, font->unit, *height); + TRACE("%s,%d => %f\n", + debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *height); return Ok; } diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 11ae2d8..d27924b 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -35,6 +35,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); +static const REAL mm_per_inch = 25.4; +static const REAL inch_per_point = 1.0/72.0; + static Status WINAPI NotificationHook(ULONG_PTR *token) { TRACE("%p\n", token); @@ -340,6 +343,29 @@ REAL convert_unit(REAL logpixels, GpUnit unit) } } +/* converts a given unit to its value in pixels */ +REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi) +{ + switch (unit) + { + case UnitPixel: + case UnitWorld: + case UnitDisplay: + return units; + case UnitPoint: + return units * dpi * inch_per_point; + case UnitInch: + return units * dpi; + case UnitDocument: + return units * dpi / 300.0; /* Per MSDN */ + case UnitMillimeter: + return units * dpi / mm_per_inch; + default: + FIXME("Unhandled unit type: %d\n", unit); + return 0; + } +} + /* Calculates Bezier points from cardinal spline points. */ void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 03942c0..c1d19d2 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -49,6 +49,7 @@ extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2, extern REAL gdiplus_atan2(REAL dy, REAL dx) DECLSPEC_HIDDEN; extern GpStatus hresult_to_status(HRESULT res) DECLSPEC_HIDDEN; extern REAL convert_unit(REAL logpixels, GpUnit unit) DECLSPEC_HIDDEN; +extern REAL units_to_pixels(REAL units, GpUnit unit, REAL dpi) DECLSPEC_HIDDEN; extern GpStatus graphics_from_image(GpImage *image, GpGraphics **graphics) DECLSPEC_HIDDEN;
1
0
0
0
Dmitry Timoshkov : gdiplus: Add a test for font and graphics using different base units.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 9da37c769efd7efdb9c019271b5ddde1c09004fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9da37c769efd7efdb9c019271…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Jul 16 14:55:30 2012 +0900 gdiplus: Add a test for font and graphics using different base units. --- dlls/gdiplus/tests/graphics.c | 109 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 106 insertions(+), 3 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 3cb33c7..f19dd9e 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -24,9 +24,9 @@ #include "wine/test.h" #include <math.h> -#define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) -#define expectf_(expected, got, precision) ok(fabs(expected - got) < precision, "Expected %.2f, got %.2f\n", expected, got) -#define expectf(expected, got) expectf_(expected, got, 0.0001) +#define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (INT)(expected), (INT)(got)) +#define expectf_(expected, got, precision) ok(fabs((expected) - (got)) < (precision), "Expected %f, got %f\n", (expected), (got)) +#define expectf(expected, got) expectf_((expected), (got), 0.0001) #define TABLE_LEN (23) static HWND hwnd; @@ -3304,6 +3304,108 @@ static void test_getdc_scaled(void) GdipDisposeImage((GpImage*)bitmap); } +static void test_GdipMeasureString(void) +{ + static const WCHAR fontname[] = { 'T','a','h','o','m','a',0 }; + static const WCHAR string[] = { '1','2','3','4','5','6','7',0 }; + GpStatus status; + GpGraphics *graphics; + GpFontFamily *family; + GpFont *font; + HDC hdc; + GpStringFormat *format; + RectF bounds, rc = { 0.0, 0.0, 0.0, 0.0 }; + REAL rval, dpi; + + hdc = CreateCompatibleDC(0); + ok(hdc != 0, "CreateCompatibleDC failed\n"); + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + status = GdipGetDpiY(graphics, &dpi); + expect(Ok, status); + status = GdipCreateFontFamilyFromName(fontname, NULL, &family); + expect(Ok, status); + status = GdipCreateFont(family, 18.0, FontStyleRegular, UnitPoint, &font); + expect(Ok, status); + status = GdipCreateStringFormat(0, LANG_NEUTRAL, &format); + expect(Ok, status); + + if (dpi == 96.0) + { + status = GdipSetPageUnit(graphics, UnitDisplay); + expect(Ok, status); + + status = GdipGetFontHeightGivenDPI(font, dpi, &rval); + expect(Ok, status); + expectf(28.968750, rval); + + status = GdipGetFontHeight(font, graphics, &rval); + expect(Ok, status); + expectf(28.968750, rval); + status = GdipGetFontSize(font, &rval); + expect(Ok, status); + expectf(18.0, rval); + + status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, NULL, NULL); + expect(Ok, status); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); +todo_wine + expectf_(102.499985, bounds.Width, 11.5); +todo_wine + expectf_(31.968744, bounds.Height, 3.1); + } + else + skip("screen resolution %f dpi, test runs at 96 dpi\n", dpi); + + status = GdipSetPageUnit(graphics, UnitPoint); + expect(Ok, status); + + status = GdipGetFontHeight(font, graphics, &rval); + expect(Ok, status); +todo_wine + expectf(21.726563, rval); + status = GdipGetFontSize(font, &rval); + expect(Ok, status); + expectf(18.0, rval); + + status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, NULL, NULL); + expect(Ok, status); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); +todo_wine + expectf_(76.875000, bounds.Width, 10.0); +todo_wine + expectf_(23.976563, bounds.Height, 2.1); + + status = GdipSetPageUnit(graphics, UnitMillimeter); + expect(Ok, status); + + status = GdipGetFontHeight(font, graphics, &rval); + expect(Ok, status); +todo_wine + expectf(7.664648, rval); + status = GdipGetFontSize(font, &rval); + expect(Ok, status); + expectf(18.0, rval); + + status = GdipMeasureString(graphics, string, -1, font, &rc, format, &bounds, NULL, NULL); + expect(Ok, status); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); +todo_wine + expectf_(27.119789, bounds.Width, 2.7); +todo_wine + expectf_(8.458398, bounds.Height, 0.8); + + GdipDeleteStringFormat(format); + GdipDeleteFont(font); + GdipDeleteFontFamily(family); + GdipDeleteGraphics(graphics); + + DeleteDC(hdc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3330,6 +3432,7 @@ START_TEST(graphics) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_GdipMeasureString(); test_constructor_destructor(); test_save_restore(); test_GdipFillClosedCurve2();
1
0
0
0
Matteo Bruni : d3dcompiler: Parse relational operators, stub out more rules .
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 6c92d78c8c48bfd2ffb2ccdc863597dce1bb75a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c92d78c8c48bfd2ffb2ccdc8…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jul 18 16:25:15 2012 +0200 d3dcompiler: Parse relational operators, stub out more rules. --- dlls/d3dcompiler_43/d3dcompiler_private.h | 12 +++++ dlls/d3dcompiler_43/hlsl.y | 74 +++++++++++++++++++++++++++ dlls/d3dcompiler_43/utils.c | 78 +++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 32d9c9d..32d378a 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -984,6 +984,18 @@ struct hlsl_ir_expr *hlsl_add(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2 struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_expr *hlsl_sub(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_lt(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_gt(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_le(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_ge(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_eq(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_ne(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_deref *new_var_deref(struct hlsl_ir_var *var) DECLSPEC_HIDDEN; void push_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; BOOL pop_scope(struct hlsl_parse_ctx *ctx) DECLSPEC_HIDDEN; diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 799aa12..8dd2e70 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -1012,46 +1012,120 @@ shift_expr: add_expr { $$ = $1; } + | shift_expr OP_LEFTSHIFT add_expr + { + FIXME("Left shift\n"); + } + | shift_expr OP_RIGHTSHIFT add_expr + { + FIXME("Right shift\n"); + } relational_expr: shift_expr { $$ = $1; } + | relational_expr '<' shift_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_lt($1, $3, &loc)->node; + } + | relational_expr '>' shift_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_gt($1, $3, &loc)->node; + } + | relational_expr OP_LE shift_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_le($1, $3, &loc)->node; + } + | relational_expr OP_GE shift_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_ge($1, $3, &loc)->node; + } equality_expr: relational_expr { $$ = $1; } + | equality_expr OP_EQ relational_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_eq($1, $3, &loc)->node; + } + | equality_expr OP_NE relational_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_ne($1, $3, &loc)->node; + } bitand_expr: equality_expr { $$ = $1; } + | bitand_expr '&' equality_expr + { + FIXME("bitwise AND\n"); + } bitxor_expr: bitand_expr { $$ = $1; } + | bitxor_expr '^' bitand_expr + { + FIXME("bitwise XOR\n"); + } bitor_expr: bitxor_expr { $$ = $1; } + | bitor_expr '|' bitxor_expr + { + FIXME("bitwise OR\n"); + } logicand_expr: bitor_expr { $$ = $1; } + | logicand_expr OP_AND bitor_expr + { + FIXME("logic AND\n"); + } logicor_expr: logicand_expr { $$ = $1; } + | logicor_expr OP_OR logicand_expr + { + FIXME("logic OR\n"); + } conditional_expr: logicor_expr { $$ = $1; } + | logicor_expr '?' expr ':' assignment_expr + { + FIXME("ternary operator\n"); + } assignment_expr: conditional_expr { diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index f10d6a6..afb441c 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1246,6 +1246,84 @@ struct hlsl_ir_expr *hlsl_sub(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2 return expr; } +struct hlsl_ir_expr *hlsl_lt(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_LESS, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_gt(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_GREATER, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_le(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_LEQUAL, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_ge(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_GEQUAL, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_eq(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_EQUAL, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_ne(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_NEQUAL, ops, loc); + return expr; +} + struct hlsl_ir_deref *new_var_deref(struct hlsl_ir_var *var) { struct hlsl_ir_deref *deref = d3dcompiler_alloc(sizeof(*deref));
1
0
0
0
Matteo Bruni : d3dcompiler: Parse multiplicative expressions.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 57a7479f777559ffc733bfccc1e3f25b39ac336e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=57a7479f777559ffc733bfccc…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jul 18 16:25:14 2012 +0200 d3dcompiler: Parse multiplicative expressions. --- dlls/d3dcompiler_43/d3dcompiler_private.h | 6 ++++ dlls/d3dcompiler_43/hlsl.y | 21 +++++++++++++++ dlls/d3dcompiler_43/utils.c | 39 +++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/d3dcompiler_private.h b/dlls/d3dcompiler_43/d3dcompiler_private.h index 515bb3b..32d9c9d 100644 --- a/dlls/d3dcompiler_43/d3dcompiler_private.h +++ b/dlls/d3dcompiler_43/d3dcompiler_private.h @@ -974,6 +974,12 @@ BOOL find_function(const char *name) DECLSPEC_HIDDEN; unsigned int components_count_type(struct hlsl_type *type) DECLSPEC_HIDDEN; struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **operands, struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_mul(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_div(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; +struct hlsl_ir_expr *hlsl_mod(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_expr *hlsl_add(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_ir_expr *hlsl_sub(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 836dffd..799aa12 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -967,6 +967,27 @@ mul_expr: unary_expr { $$ = $1; } + | mul_expr '*' unary_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_mul($1, $3, &loc)->node; + } + | mul_expr '/' unary_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_div($1, $3, &loc)->node; + } + | mul_expr '%' unary_expr + { + struct source_location loc; + + set_location(&loc, &@2); + $$ = &hlsl_mod($1, $3, &loc)->node; + } add_expr: mul_expr { diff --git a/dlls/d3dcompiler_43/utils.c b/dlls/d3dcompiler_43/utils.c index 4c24e0a..f10d6a6 100644 --- a/dlls/d3dcompiler_43/utils.c +++ b/dlls/d3dcompiler_43/utils.c @@ -1181,6 +1181,45 @@ struct hlsl_ir_expr *new_expr(enum hlsl_ir_expr_op op, struct hlsl_ir_node **ope return expr; } +struct hlsl_ir_expr *hlsl_mul(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_MUL, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_div(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_DIV, ops, loc); + return expr; +} + +struct hlsl_ir_expr *hlsl_mod(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, + struct source_location *loc) +{ + struct hlsl_ir_expr *expr; + struct hlsl_ir_node *ops[3]; + + ops[0] = op1; + ops[1] = op2; + ops[2] = NULL; + expr = new_expr(HLSL_IR_BINOP_MOD, ops, loc); + return expr; +} + struct hlsl_ir_expr *hlsl_add(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2, struct source_location *loc) {
1
0
0
0
Matteo Bruni : d3dcompiler: Don't allow semantics on local variables.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 7293c1c0fe81191c8e837a8cd3f3bd6b7d5a4bfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7293c1c0fe81191c8e837a8cd…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jul 18 16:25:13 2012 +0200 d3dcompiler: Don't allow semantics on local variables. --- dlls/d3dcompiler_43/hlsl.y | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 5025f0c..836dffd 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -143,6 +143,12 @@ static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local) hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_ERROR, "modifier '%s' invalid for local variables", debug_modifiers(invalid)); } + if (decl->semantic) + { + hlsl_report_message(decl->node.loc.file, decl->node.loc.line, decl->node.loc.col, HLSL_LEVEL_ERROR, + "semantics are not allowed on local variables"); + return FALSE; + } } else { @@ -685,7 +691,6 @@ variables_def: variable_def list_add_tail($$, &$3->entry); } - /* FIXME: Local variables can't have semantics. */ variable_def: any_identifier array semantic { $$ = d3dcompiler_alloc(sizeof(*$$));
1
0
0
0
Matteo Bruni : d3dcompiler: Don' t allow const variables without initializers.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 110045816c028619881475bd3ecc2d833e07e469 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=110045816c028619881475bd3…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jul 18 16:25:12 2012 +0200 d3dcompiler: Don't allow const variables without initializers. --- dlls/d3dcompiler_43/hlsl.y | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 72a209f..5025f0c 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -640,11 +640,6 @@ declaration: var_modifiers type variables_def ';' var->name = v->name; var->modifiers = $1; var->semantic = v->semantic; - if (v->initializer) - { - FIXME("Variable with an initializer.\n"); - free_instr_list(v->initializer); - } if (hlsl_ctx.cur_scope == hlsl_ctx.globals) { @@ -652,11 +647,27 @@ declaration: var_modifiers type variables_def ';' local = FALSE; } + if (var->modifiers & HLSL_MODIFIER_CONST && !v->initializer) + { + hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, + HLSL_LEVEL_ERROR, "const variable without initializer"); + free_declaration(var); + d3dcompiler_free(v); + continue; + } + ret = declare_variable(var, local); - if (ret == FALSE) + if (!ret) free_declaration(var); else TRACE("Declared variable %s.\n", var->name); + + if (v->initializer) + { + FIXME("Variable with an initializer.\n"); + free_instr_list(v->initializer); + } + d3dcompiler_free(v); } d3dcompiler_free($3);
1
0
0
0
Matteo Bruni : d3dcompiler: Check for invalid matrix majority modifiers.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: c9a42ca5fcbad4354987360dddd5f1d6b9b3f0c6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c9a42ca5fcbad4354987360dd…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jul 18 16:25:11 2012 +0200 d3dcompiler: Check for invalid matrix majority modifiers. --- dlls/d3dcompiler_43/hlsl.y | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 882de2e..72a209f 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -109,6 +109,15 @@ static void debug_dump_decl(struct hlsl_type *type, DWORD modifiers, const char TRACE("%s %s;\n", debug_hlsl_type(type), declname); } +static void check_invalid_matrix_modifiers(DWORD modifiers, struct source_location *loc) +{ + if (modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)) + { + hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, + "'row_major' or 'column_major' modifiers are only allowed for matrices"); + } +} + static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local) { BOOL ret; @@ -122,6 +131,9 @@ static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local) ? HLSL_MODIFIER_ROW_MAJOR : HLSL_MODIFIER_COLUMN_MAJOR; } } + else + check_invalid_matrix_modifiers(decl->modifiers, &decl->node.loc); + if (local) { DWORD invalid = decl->modifiers & (HLSL_STORAGE_EXTERN | HLSL_STORAGE_SHARED
1
0
0
0
Jacek Caban : ole32: Forward BSTR functions to oleaut32.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 1eda4ac4baf1b825eb700394fc35d9c41bba7f6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1eda4ac4baf1b825eb700394f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 18 16:55:44 2012 +0200 ole32: Forward BSTR functions to oleaut32. --- dlls/ole32/Makefile.in | 1 + dlls/ole32/ole2.c | 74 +++-------------------------------------------- 2 files changed, 6 insertions(+), 69 deletions(-) diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index ea9c9cb..f24f035 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -1,6 +1,7 @@ MODULE = ole32.dll IMPORTLIB = ole32 IMPORTS = uuid advapi32 user32 gdi32 rpcrt4 +DELAYIMPORTS = oleaut32 EXTRADEFS = -D_OLE32_ -DCOM_NO_WINDOWS_H \ -DENTRY_PREFIX=OLE32_ -DPROXY_CLSID=CLSID_PSFactoryBuffer -DWINE_REGISTER_DLL diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 4680f40..6d37aa6 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -2816,86 +2816,22 @@ static void OLE_FreeClipDataArray(ULONG count, CLIPDATA * pClipDataArray) /*********************************************************************** * PropSysAllocString [OLE32.@] - * NOTES: - * Basically a copy of SysAllocStringLen. + * NOTES + * Forward to oleaut32. */ BSTR WINAPI PropSysAllocString(LPCOLESTR str) { - DWORD bufferSize; - DWORD* newBuffer; - WCHAR* stringBuffer; - int len; - - if (!str) return 0; - - len = lstrlenW(str); - /* - * Find the length of the buffer passed-in, in bytes. - */ - bufferSize = len * sizeof (WCHAR); - - /* - * Allocate a new buffer to hold the string. - * Don't forget to keep an empty spot at the beginning of the - * buffer for the character count and an extra character at the - * end for the NULL. - */ - newBuffer = HeapAlloc(GetProcessHeap(), 0, - bufferSize + sizeof(WCHAR) + sizeof(DWORD)); - - /* - * If the memory allocation failed, return a null pointer. - */ - if (newBuffer==0) - return 0; - - /* - * Copy the length of the string in the placeholder. - */ - *newBuffer = bufferSize; - - /* - * Skip the byte count. - */ - newBuffer++; - - memcpy(newBuffer, str, bufferSize); - - /* - * Make sure that there is a nul character at the end of the - * string. - */ - stringBuffer = (WCHAR*)newBuffer; - stringBuffer[len] = '\0'; - - return stringBuffer; + return SysAllocString(str); } /*********************************************************************** * PropSysFreeString [OLE32.@] * NOTES - * Copy of SysFreeString. + * Forward to oleaut32. */ void WINAPI PropSysFreeString(LPOLESTR str) { - DWORD* bufferPointer; - - /* NULL is a valid parameter */ - if(!str) return; - - /* - * We have to be careful when we free a BSTR pointer, it points to - * the beginning of the string but it skips the byte count contained - * before the string. - */ - bufferPointer = (DWORD*)str; - - bufferPointer--; - - /* - * Free the memory from its "real" origin. - */ - HeapFree(GetProcessHeap(), 0, bufferPointer); + SysFreeString(str); } /******************************************************************************
1
0
0
0
Jacek Caban : mshtml: Wine Gecko 1.7 release.
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 674b9b9c10eb2d09816078914a0baf722713ae5e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=674b9b9c10eb2d09816078914…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Jul 18 12:50:04 2012 +0200 mshtml: Wine Gecko 1.7 release. --- dlls/appwiz.cpl/addons.c | 6 +- dlls/mshtml/nsiface.idl | 126 +++++++++++++++++++++++++++++---------------- 2 files changed, 84 insertions(+), 48 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=674b9b9c10eb2d0981607…
1
0
0
0
Henri Verbeet : d3d10: Add support for parsing stencil reference values to parse_fx10_object().
by Alexandre Julliard
18 Jul '12
18 Jul '12
Module: wine Branch: master Commit: 2d5fdb168303b802ee610395c7758400419fb833 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2d5fdb168303b802ee610395c…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Jul 18 15:52:33 2012 +0200 d3d10: Add support for parsing stencil reference values to parse_fx10_object(). --- dlls/d3d10/d3d10_private.h | 2 + dlls/d3d10/effect.c | 15 +++++++ dlls/d3d10/tests/effect.c | 101 +++++++++++++++++++++++-------------------- 3 files changed, 71 insertions(+), 47 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2d5fdb168303b802ee610…
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
72
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
Results per page:
10
25
50
100
200