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 2013
----- 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
645 discussions
Start a n
N
ew thread
Alexandre Julliard : gdi32: Add a check for overflow in DIB dimensions.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 69abf20fcdbd34cdc80af6a2edc0ea2d59b604b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=69abf20fcdbd34cdc80af6a2e…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 11 17:30:46 2013 +0200 gdi32: Add a check for overflow in DIB dimensions. --- dlls/gdi32/dib.c | 5 +++++ dlls/gdi32/tests/bitmap.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 0 deletions(-) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index ad2a4dc..adf29ea 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -128,6 +128,11 @@ static BOOL is_valid_dib_format( const BITMAPINFOHEADER *info, BOOL allow_compre if (!info->biPlanes) return FALSE; + /* check for size overflow */ + if (!info->biBitCount) return FALSE; + if (UINT_MAX / info->biBitCount < info->biWidth) return FALSE; + if (UINT_MAX / get_dib_stride( info->biWidth, info->biBitCount ) < abs( info->biHeight )) return FALSE; + switch (info->biBitCount) { case 1: diff --git a/dlls/gdi32/tests/bitmap.c b/dlls/gdi32/tests/bitmap.c index f72574a..6b52356 100644 --- a/dlls/gdi32/tests/bitmap.c +++ b/dlls/gdi32/tests/bitmap.c @@ -1207,6 +1207,49 @@ static void test_dib_formats(void) ret = GetDIBits(hdc, hbmp, 0, 0, NULL, bi, DIB_PAL_COLORS+2); ok( !ret, "GetDIBits succeeded with DIB_PAL_COLORS+2\n" ); + bi->bmiHeader.biWidth = 0x4000; + bi->bmiHeader.biHeight = 0x4000; + bi->bmiHeader.biBitCount = 1; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib != NULL, "CreateDIBSection failed with large size\n" ); + DeleteObject( hdib ); + + bi->bmiHeader.biWidth = 0x8001; + bi->bmiHeader.biHeight = 0x8001; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 1; + bi->bmiHeader.biHeight = 0x40000001; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 2; + bi->bmiHeader.biHeight = 0x40000001; + bi->bmiHeader.biBitCount = 16; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 0x40000001; + bi->bmiHeader.biHeight = 1; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 0x40000001; + bi->bmiHeader.biHeight = 4; + bi->bmiHeader.biBitCount = 8; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + DeleteDC( memdc ); DeleteObject( hbmp ); ReleaseDC( 0, hdc );
1
0
0
0
Alexandre Julliard : gdi32: Add more helpers for converting font sizes to logical coordinates.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 08e82d4686f58c9a270c53c5dd35cb74d3bec311 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=08e82d4686f58c9a270c53c5d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 11 18:31:01 2013 +0200 gdi32: Add more helpers for converting font sizes to logical coordinates. --- dlls/gdi32/font.c | 119 ++++++++++++++++++++++++---------------------------- 1 files changed, 55 insertions(+), 64 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 9e516be..68b2713 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -69,6 +69,18 @@ static inline INT INTERNAL_YDSTOWS(DC *dc, INT height) return GDI_ROUND(floatHeight); } +/* scale width and height but don't mirror them */ + +static inline INT width_to_LP( DC *dc, INT width ) +{ + return GDI_ROUND( (double)width * fabs( dc->xformVport2World.eM11 )); +} + +static inline INT height_to_LP( DC *dc, INT height ) +{ + return GDI_ROUND( (double)height * fabs( dc->xformVport2World.eM22 )); +} + static inline INT INTERNAL_XWSTODS(DC *dc, INT width) { POINT pt[2]; @@ -1372,26 +1384,17 @@ BOOL WINAPI GetTextMetricsW( HDC hdc, TEXTMETRICW *metrics ) metrics->tmDigitizedAspectX = GetDeviceCaps(hdc, LOGPIXELSX); metrics->tmDigitizedAspectY = GetDeviceCaps(hdc, LOGPIXELSY); - -#define WDPTOLP(x) ((x<0)? \ - (-abs(INTERNAL_XDSTOWS(dc, (x)))): \ - (abs(INTERNAL_XDSTOWS(dc, (x))))) -#define HDPTOLP(y) ((y<0)? \ - (-abs(INTERNAL_YDSTOWS(dc, (y)))): \ - (abs(INTERNAL_YDSTOWS(dc, (y))))) - - metrics->tmHeight = HDPTOLP(metrics->tmHeight); - metrics->tmAscent = HDPTOLP(metrics->tmAscent); - metrics->tmDescent = HDPTOLP(metrics->tmDescent); - metrics->tmInternalLeading = HDPTOLP(metrics->tmInternalLeading); - metrics->tmExternalLeading = HDPTOLP(metrics->tmExternalLeading); - metrics->tmAveCharWidth = WDPTOLP(metrics->tmAveCharWidth); - metrics->tmMaxCharWidth = WDPTOLP(metrics->tmMaxCharWidth); - metrics->tmOverhang = WDPTOLP(metrics->tmOverhang); + metrics->tmHeight = height_to_LP( dc, metrics->tmHeight ); + metrics->tmAscent = height_to_LP( dc, metrics->tmAscent ); + metrics->tmDescent = height_to_LP( dc, metrics->tmDescent ); + metrics->tmInternalLeading = height_to_LP( dc, metrics->tmInternalLeading ); + metrics->tmExternalLeading = height_to_LP( dc, metrics->tmExternalLeading ); + metrics->tmAveCharWidth = width_to_LP( dc, metrics->tmAveCharWidth ); + metrics->tmMaxCharWidth = width_to_LP( dc, metrics->tmMaxCharWidth ); + metrics->tmOverhang = width_to_LP( dc, metrics->tmOverhang ); ret = TRUE; -#undef WDPTOLP -#undef HDPTOLP - TRACE("text metrics:\n" + + TRACE("text metrics:\n" " Weight = %03i\t FirstChar = %i\t AveCharWidth = %i\n" " Italic = % 3i\t LastChar = %i\t\t MaxCharWidth = %i\n" " UnderLined = %01i\t DefaultChar = %i\t Overhang = %i\n" @@ -1622,46 +1625,38 @@ UINT WINAPI GetOutlineTextMetricsW( { output->otmTextMetrics.tmDigitizedAspectX = GetDeviceCaps(hdc, LOGPIXELSX); output->otmTextMetrics.tmDigitizedAspectY = GetDeviceCaps(hdc, LOGPIXELSY); - -#define WDPTOLP(x) ((x<0)? \ - (-abs(INTERNAL_XDSTOWS(dc, (x)))): \ - (abs(INTERNAL_XDSTOWS(dc, (x))))) -#define HDPTOLP(y) ((y<0)? \ - (-abs(INTERNAL_YDSTOWS(dc, (y)))): \ - (abs(INTERNAL_YDSTOWS(dc, (y))))) - - output->otmTextMetrics.tmHeight = HDPTOLP(output->otmTextMetrics.tmHeight); - output->otmTextMetrics.tmAscent = HDPTOLP(output->otmTextMetrics.tmAscent); - output->otmTextMetrics.tmDescent = HDPTOLP(output->otmTextMetrics.tmDescent); - output->otmTextMetrics.tmInternalLeading = HDPTOLP(output->otmTextMetrics.tmInternalLeading); - output->otmTextMetrics.tmExternalLeading = HDPTOLP(output->otmTextMetrics.tmExternalLeading); - output->otmTextMetrics.tmAveCharWidth = WDPTOLP(output->otmTextMetrics.tmAveCharWidth); - output->otmTextMetrics.tmMaxCharWidth = WDPTOLP(output->otmTextMetrics.tmMaxCharWidth); - output->otmTextMetrics.tmOverhang = WDPTOLP(output->otmTextMetrics.tmOverhang); - output->otmAscent = HDPTOLP(output->otmAscent); - output->otmDescent = HDPTOLP(output->otmDescent); - output->otmLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmLineGap)); - output->otmsCapEmHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsCapEmHeight)); - output->otmsXHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsXHeight)); - output->otmrcFontBox.top = HDPTOLP(output->otmrcFontBox.top); - output->otmrcFontBox.bottom = HDPTOLP(output->otmrcFontBox.bottom); - output->otmrcFontBox.left = WDPTOLP(output->otmrcFontBox.left); - output->otmrcFontBox.right = WDPTOLP(output->otmrcFontBox.right); - output->otmMacAscent = HDPTOLP(output->otmMacAscent); - output->otmMacDescent = HDPTOLP(output->otmMacDescent); - output->otmMacLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmMacLineGap)); - output->otmptSubscriptSize.x = WDPTOLP(output->otmptSubscriptSize.x); - output->otmptSubscriptSize.y = HDPTOLP(output->otmptSubscriptSize.y); - output->otmptSubscriptOffset.x = WDPTOLP(output->otmptSubscriptOffset.x); - output->otmptSubscriptOffset.y = HDPTOLP(output->otmptSubscriptOffset.y); - output->otmptSuperscriptSize.x = WDPTOLP(output->otmptSuperscriptSize.x); - output->otmptSuperscriptSize.y = HDPTOLP(output->otmptSuperscriptSize.y); - output->otmptSuperscriptOffset.x = WDPTOLP(output->otmptSuperscriptOffset.x); - output->otmptSuperscriptOffset.y = HDPTOLP(output->otmptSuperscriptOffset.y); - output->otmsStrikeoutSize = abs(INTERNAL_YDSTOWS(dc,output->otmsStrikeoutSize)); - output->otmsStrikeoutPosition = HDPTOLP(output->otmsStrikeoutPosition); - output->otmsUnderscoreSize = HDPTOLP(output->otmsUnderscoreSize); - output->otmsUnderscorePosition = HDPTOLP(output->otmsUnderscorePosition); + output->otmTextMetrics.tmHeight = height_to_LP( dc, output->otmTextMetrics.tmHeight ); + output->otmTextMetrics.tmAscent = height_to_LP( dc, output->otmTextMetrics.tmAscent ); + output->otmTextMetrics.tmDescent = height_to_LP( dc, output->otmTextMetrics.tmDescent ); + output->otmTextMetrics.tmInternalLeading = height_to_LP( dc, output->otmTextMetrics.tmInternalLeading ); + output->otmTextMetrics.tmExternalLeading = height_to_LP( dc, output->otmTextMetrics.tmExternalLeading ); + output->otmTextMetrics.tmAveCharWidth = width_to_LP( dc, output->otmTextMetrics.tmAveCharWidth ); + output->otmTextMetrics.tmMaxCharWidth = width_to_LP( dc, output->otmTextMetrics.tmMaxCharWidth ); + output->otmTextMetrics.tmOverhang = width_to_LP( dc, output->otmTextMetrics.tmOverhang ); + output->otmAscent = height_to_LP( dc, output->otmAscent); + output->otmDescent = height_to_LP( dc, output->otmDescent); + output->otmLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmLineGap)); + output->otmsCapEmHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsCapEmHeight)); + output->otmsXHeight = abs(INTERNAL_YDSTOWS(dc,output->otmsXHeight)); + output->otmrcFontBox.top = height_to_LP( dc, output->otmrcFontBox.top); + output->otmrcFontBox.bottom = height_to_LP( dc, output->otmrcFontBox.bottom); + output->otmrcFontBox.left = width_to_LP( dc, output->otmrcFontBox.left); + output->otmrcFontBox.right = width_to_LP( dc, output->otmrcFontBox.right); + output->otmMacAscent = height_to_LP( dc, output->otmMacAscent); + output->otmMacDescent = height_to_LP( dc, output->otmMacDescent); + output->otmMacLineGap = abs(INTERNAL_YDSTOWS(dc,output->otmMacLineGap)); + output->otmptSubscriptSize.x = width_to_LP( dc, output->otmptSubscriptSize.x); + output->otmptSubscriptSize.y = height_to_LP( dc, output->otmptSubscriptSize.y); + output->otmptSubscriptOffset.x = width_to_LP( dc, output->otmptSubscriptOffset.x); + output->otmptSubscriptOffset.y = height_to_LP( dc, output->otmptSubscriptOffset.y); + output->otmptSuperscriptSize.x = width_to_LP( dc, output->otmptSuperscriptSize.x); + output->otmptSuperscriptSize.y = height_to_LP( dc, output->otmptSuperscriptSize.y); + output->otmptSuperscriptOffset.x = width_to_LP( dc, output->otmptSuperscriptOffset.x); + output->otmptSuperscriptOffset.y = height_to_LP( dc, output->otmptSuperscriptOffset.y); + output->otmsStrikeoutSize = abs(INTERNAL_YDSTOWS(dc,output->otmsStrikeoutSize)); + output->otmsStrikeoutPosition = height_to_LP( dc, output->otmsStrikeoutPosition); + output->otmsUnderscoreSize = height_to_LP( dc, output->otmsUnderscoreSize); + output->otmsUnderscorePosition = height_to_LP( dc, output->otmsUnderscorePosition); #undef WDPTOLP #undef HDPTOLP if(output != lpOTM) @@ -1748,13 +1743,9 @@ BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar, if (ret) { -#define WDPTOLP(x) ((x<0)? \ - (-abs(INTERNAL_XDSTOWS(dc, (x)))): \ - (abs(INTERNAL_XDSTOWS(dc, (x))))) /* convert device units to logical */ for( i = firstChar; i <= lastChar; i++, buffer++ ) - *buffer = WDPTOLP(*buffer); -#undef WDPTOLP + *buffer = width_to_LP( dc, *buffer ); } release_dc_ptr( dc ); return ret;
1
0
0
0
Aric Stewart : gdi32: GetCharWidth32A/ W return positive widths for all layouts and various DC transforms.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 4a300d2423d18abe915ad070b9611e72749dec4d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a300d2423d18abe915ad070b…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Wed Sep 11 07:46:53 2013 -0500 gdi32: GetCharWidth32A/W return positive widths for all layouts and various DC transforms. --- dlls/gdi32/font.c | 6 ++- dlls/gdi32/tests/font.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+), 1 deletions(-) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index cc66000..9e516be 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -1748,9 +1748,13 @@ BOOL WINAPI GetCharWidth32W( HDC hdc, UINT firstChar, UINT lastChar, if (ret) { +#define WDPTOLP(x) ((x<0)? \ + (-abs(INTERNAL_XDSTOWS(dc, (x)))): \ + (abs(INTERNAL_XDSTOWS(dc, (x))))) /* convert device units to logical */ for( i = firstChar; i <= lastChar; i++, buffer++ ) - *buffer = INTERNAL_XDSTOWS(dc, *buffer); + *buffer = WDPTOLP(*buffer); +#undef WDPTOLP } release_dc_ptr( dc ); return ret; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 84e47ed..11299f3 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -42,6 +42,8 @@ static BOOL (WINAPI *pGetCharABCWidthsI)(HDC hdc, UINT first, UINT count, LPWOR static BOOL (WINAPI *pGetCharABCWidthsA)(HDC hdc, UINT first, UINT last, LPABC abc); static BOOL (WINAPI *pGetCharABCWidthsW)(HDC hdc, UINT first, UINT last, LPABC abc); static BOOL (WINAPI *pGetCharABCWidthsFloatW)(HDC hdc, UINT first, UINT last, LPABCFLOAT abc); +static BOOL (WINAPI *pGetCharWidth32A)(HDC hdc, UINT first, UINT last, LPINT buffer); +static BOOL (WINAPI *pGetCharWidth32W)(HDC hdc, UINT first, UINT last, LPINT buffer); static DWORD (WINAPI *pGetFontUnicodeRanges)(HDC hdc, LPGLYPHSET lpgs); static DWORD (WINAPI *pGetGlyphIndicesA)(HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi, DWORD flags); static DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags); @@ -83,6 +85,8 @@ static void init(void) pGetCharABCWidthsA = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsA"); pGetCharABCWidthsW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsW"); pGetCharABCWidthsFloatW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsFloatW"); + pGetCharWidth32A = (void *)GetProcAddress(hgdi32, "GetCharWidth32A"); + pGetCharWidth32W = (void *)GetProcAddress(hgdi32, "GetCharWidth32W"); pGetFontUnicodeRanges = (void *)GetProcAddress(hgdi32, "GetFontUnicodeRanges"); pGetGlyphIndicesA = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesA"); pGetGlyphIndicesW = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesW"); @@ -5348,6 +5352,109 @@ static void test_vertical_order(void) DeleteDC( hdc ); } +static void test_GetCharWidth32(void) +{ + BOOL ret; + HDC hdc; + LOGFONTA lf; + HFONT hfont; + INT bufferA; + INT bufferW; + HWND hwnd; + + if (!pGetCharWidth32A || !pGetCharWidth32W) + { + win_skip("GetCharWidth32A/W not available on this platform\n"); + return; + } + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "System"); + lf.lfHeight = 20; + + hfont = CreateFontIndirectA(&lf); + hdc = GetDC(0); + hfont = SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ret = pGetCharWidth32A(hdc, 'a', 'a', &bufferA); + ok(ret, "GetCharWidth32A should have succeeded\n"); + ok (bufferA == bufferW, "Widths should be the same\n"); + ok (bufferA > 0," Width should be greater than zero\n"); + + hfont = SelectObject(hdc, hfont); + DeleteObject(hfont); + ReleaseDC(NULL, hdc); + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Tahoma"); + lf.lfHeight = 20; + + hfont = CreateFontIndirectA(&lf); + hwnd = CreateWindowEx(0, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode( hdc, MM_ANISOTROPIC ); + SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, -1,-1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, 1,1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + + hwnd = CreateWindowEx(WS_EX_LAYOUTRTL, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode( hdc, MM_ANISOTROPIC ); + SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, -1,-1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, 1,1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + DeleteObject(hfont); +} START_TEST(font) { @@ -5407,6 +5514,7 @@ START_TEST(font) test_east_asian_font_selection(); test_max_height(); test_vertical_order(); + test_GetCharWidth32(); /* These tests should be last test until RemoveFontResource * is properly implemented.
1
0
0
0
Stefan Dösinger : wined3d: Pass position_transformed and gl_info to find_ps_compile_args.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: b4d8b52fa76b04d4af74b699345d75603690bc4f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b4d8b52fa76b04d4af74b6993…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Sep 11 11:31:18 2013 +0200 wined3d: Pass position_transformed and gl_info to find_ps_compile_args. --- dlls/wined3d/arb_program_shader.c | 3 ++- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 10 ++++------ dlls/wined3d/wined3d_private.h | 5 +++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 6ebd7fd..2972e19 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4521,12 +4521,13 @@ static void find_arb_ps_compile_args(const struct wined3d_state *state, const struct wined3d_context *context, const struct wined3d_shader *shader, struct arb_ps_compile_args *args) { + const struct wined3d_device *device = shader->device; const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_d3d_info *d3d_info = context->d3d_info; int i; WORD int_skip; - find_ps_compile_args(state, shader, &args->super); + find_ps_compile_args(state, shader, device->stream_info.position_transformed, &args->super, gl_info); /* This forces all local boolean constants to 1 to make them stateblock independent */ args->bools = shader->reg_maps.local_bool_consts; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 0bd1180..2413095 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5837,7 +5837,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const { struct ps_compile_args ps_compile_args; pshader = state->pixel_shader; - find_ps_compile_args(state, pshader, &ps_compile_args); + find_ps_compile_args(state, pshader, device->stream_info.position_transformed, &ps_compile_args, gl_info); ps_id = find_glsl_pshader(context, &priv->shader_buffer, pshader, &ps_compile_args, &np2fixup_info); ps_list = &pshader->linked_programs; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 3eee934..fee9c77 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2025,11 +2025,9 @@ static HRESULT geometryshader_init(struct wined3d_shader *shader, struct wined3d return WINED3D_OK; } -void find_ps_compile_args(const struct wined3d_state *state, - const struct wined3d_shader *shader, struct ps_compile_args *args) +void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, + BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_gl_info *gl_info) { - struct wined3d_device *device = shader->device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_texture *texture; UINT i; @@ -2158,7 +2156,7 @@ void find_ps_compile_args(const struct wined3d_state *state, } if (shader->reg_maps.shader_version.major >= 3) { - if (device->stream_info.position_transformed) + if (position_transformed) args->vp_mode = pretransformed; else if (use_vs(state)) args->vp_mode = vertexshader; @@ -2174,7 +2172,7 @@ void find_ps_compile_args(const struct wined3d_state *state, switch (state->render_states[WINED3D_RS_FOGTABLEMODE]) { case WINED3D_FOG_NONE: - if (device->stream_info.position_transformed || use_vs(state)) + if (position_transformed || use_vs(state)) { args->fog = WINED3D_FFP_PS_FOG_LINEAR; break; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9cabceb..3548094 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2774,8 +2774,9 @@ struct wined3d_shader }; void pixelshader_update_samplers(struct wined3d_shader *shader, WORD tex_types) DECLSPEC_HIDDEN; -void find_ps_compile_args(const struct wined3d_state *state, - const struct wined3d_shader *shader, struct ps_compile_args *args) DECLSPEC_HIDDEN; +void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, + BOOL position_transformed, struct ps_compile_args *args, + const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, WORD swizzle_map, struct vs_compile_args *args) DECLSPEC_HIDDEN;
1
0
0
0
Stefan Dösinger : wined3d: Pass the swizzle map to find_vs_compile_args.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: dfeee9077cd0965d1f7a804b4bb156c11fe7aaf2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfeee9077cd0965d1f7a804b4…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Wed Sep 11 11:31:17 2013 +0200 wined3d: Pass the swizzle map to find_vs_compile_args. --- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/glsl_shader.c | 2 +- dlls/wined3d/shader.c | 6 +++--- dlls/wined3d/wined3d_private.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 05f7557..6ebd7fd 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4584,7 +4584,7 @@ static void find_arb_vs_compile_args(const struct wined3d_state *state, int i; WORD int_skip; - find_vs_compile_args(state, shader, &args->super); + find_vs_compile_args(state, shader, device->stream_info.swizzle_map, &args->super); args->clip.boolclip_compare = 0; if (use_ps(state)) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 37661d3..0bd1180 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -5807,7 +5807,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const struct vs_compile_args vs_compile_args; vshader = state->vertex_shader; - find_vs_compile_args(state, vshader, &vs_compile_args); + find_vs_compile_args(state, vshader, device->stream_info.swizzle_map, &vs_compile_args); vs_id = find_glsl_vshader(context, &priv->shader_buffer, vshader, &vs_compile_args); vs_list = &vshader->linked_programs; diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 2948aa9..3eee934 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1817,14 +1817,14 @@ HRESULT CDECL wined3d_shader_set_local_constants_float(struct wined3d_shader *sh return WINED3D_OK; } -void find_vs_compile_args(const struct wined3d_state *state, - const struct wined3d_shader *shader, struct vs_compile_args *args) +void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, + WORD swizzle_map, struct vs_compile_args *args) { args->fog_src = state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE ? VS_FOG_COORD : VS_FOG_Z; args->clip_enabled = state->render_states[WINED3D_RS_CLIPPING] && state->render_states[WINED3D_RS_CLIPPLANEENABLE]; - args->swizzle_map = shader->device->stream_info.swizzle_map; + args->swizzle_map = swizzle_map; } static BOOL match_usage(BYTE usage1, BYTE usage_idx1, BYTE usage2, BYTE usage_idx2) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6753ad3..9cabceb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2777,8 +2777,8 @@ void pixelshader_update_samplers(struct wined3d_shader *shader, WORD tex_types) void find_ps_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, struct ps_compile_args *args) DECLSPEC_HIDDEN; -void find_vs_compile_args(const struct wined3d_state *state, - const struct wined3d_shader *shader, struct vs_compile_args *args) DECLSPEC_HIDDEN; +void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader, + WORD swizzle_map, struct vs_compile_args *args) DECLSPEC_HIDDEN; void shader_buffer_clear(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN; BOOL shader_buffer_init(struct wined3d_shader_buffer *buffer) DECLSPEC_HIDDEN;
1
0
0
0
Hans Leidekker : rpcrt4: Don' t try to decode the authorization value in the first leg.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 057c98323e6d3ba5623d5a484b6fd0adcd8645b3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=057c98323e6d3ba5623d5a484…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 11 13:49:40 2013 +0200 rpcrt4: Don't try to decode the authorization value in the first leg. --- dlls/rpcrt4/rpc_transport.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index d89e5ad..e8bdd49 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2653,7 +2653,7 @@ static RPC_STATUS do_authorization(HINTERNET request, SEC_WCHAR *servername, in_desc.pBuffers = ∈ p = auth_value + scheme_len; - if (*p == ' ') + if (!first && *p == ' ') { int len = strlenW(++p); in.cbBuffer = decode_base64(p, len, NULL);
1
0
0
0
Hans Leidekker : rpcrt4: Don' t remove the authorization header if the scheme is Basic.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 6f2c4bac58dc6fa2d5217b4753a658cd69ac1ec8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6f2c4bac58dc6fa2d5217b475…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Sep 11 13:49:05 2013 +0200 rpcrt4: Don't remove the authorization header if the scheme is Basic. --- dlls/rpcrt4/rpc_transport.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index c68f141..d89e5ad 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -2803,7 +2803,9 @@ static RPC_STATUS authorize_request(RpcConnection_http *httpc, HINTERNET request drain_content(request); } - HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE); + if (info->scheme != RPC_C_HTTP_AUTHN_SCHEME_BASIC) + HttpAddRequestHeadersW(request, authW, -1, HTTP_ADDREQ_FLAG_REPLACE); + destroy_authinfo(info); return status; }
1
0
0
0
Jacek Caban : dxgiformat.h: Added missing formats.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 81d90ba06d3fda8e84deef88ace4ff4a524c75c3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=81d90ba06d3fda8e84deef88a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 11 12:10:05 2013 +0200 dxgiformat.h: Added missing formats. --- include/dxgiformat.h | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/include/dxgiformat.h b/include/dxgiformat.h index 5c7ad62..6bb9d00 100644 --- a/include/dxgiformat.h +++ b/include/dxgiformat.h @@ -111,6 +111,33 @@ typedef enum DXGI_FORMAT { DXGI_FORMAT_B5G5R5A1_UNORM = 86, DXGI_FORMAT_B8G8R8A8_UNORM = 87, DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_AYUV = 100, + DXGI_FORMAT_Y410 = 101, + DXGI_FORMAT_Y416 = 102, + DXGI_FORMAT_NV12 = 103, + DXGI_FORMAT_P010 = 104, + DXGI_FORMAT_P016 = 105, + DXGI_FORMAT_420_OPAQUE = 106, + DXGI_FORMAT_YUY2 = 107, + DXGI_FORMAT_Y210 = 108, + DXGI_FORMAT_Y216 = 109, + DXGI_FORMAT_NV11 = 110, + DXGI_FORMAT_AI44 = 111, + DXGI_FORMAT_IA44 = 112, + DXGI_FORMAT_P8 = 113, + DXGI_FORMAT_A8P8 = 114, + DXGI_FORMAT_B4G4R4A4_UNORM = 115, DXGI_FORMAT_FORCE_UINT = 0xffffffff } DXGI_FORMAT;
1
0
0
0
Jacek Caban : d3d10_1.idl: Added D3D10_1_SHADER_*_VERSION constants.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 044d7e82bf915d36c2921b29f129aae303355af4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=044d7e82bf915d36c2921b29f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 11 12:09:54 2013 +0200 d3d10_1.idl: Added D3D10_1_SHADER_*_VERSION constants. --- include/d3d10_1.idl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/include/d3d10_1.idl b/include/d3d10_1.idl index 11c52b4..3b6e624 100644 --- a/include/d3d10_1.idl +++ b/include/d3d10_1.idl @@ -22,6 +22,8 @@ import "ocidl.idl"; import "d3d10.idl"; cpp_quote("#include <d3d10_1shader.h>") +const UINT D3D10_1_SHADER_MAJOR_VERSION = 4; +const UINT D3D10_1_SHADER_MINOR_VERSION = 1; typedef enum D3D10_FEATURE_LEVEL1 {
1
0
0
0
Jacek Caban : d3d11.idl: Added some missing declarations.
by Alexandre Julliard
11 Sep '13
11 Sep '13
Module: wine Branch: master Commit: 4de32753a2b5d2b145fc57a34e0b4d195c6a4f16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4de32753a2b5d2b145fc57a34…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Sep 11 14:44:43 2013 +0200 d3d11.idl: Added some missing declarations. --- include/d3d11.idl | 132 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 132 insertions(+), 0 deletions(-) diff --git a/include/d3d11.idl b/include/d3d11.idl index 105f707..3e2c5ed 100644 --- a/include/d3d11.idl +++ b/include/d3d11.idl @@ -49,9 +49,22 @@ const UINT D3D11_DEFAULT_VIEWPORT_TOPLEFTX = 0; const UINT D3D11_DEFAULT_VIEWPORT_TOPLEFTY = 0; const UINT D3D11_DEFAULT_VIEWPORT_WIDTH = 0; +cpp_quote("#define D3D11_FLOAT32_MAX (3.402823466e+38f)") + const unsigned int D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT = 8; const UINT D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION = 16384; +const UINT D3D11_MAX_MAXANISOTROPY = 16; +const UINT D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT = 32; +const UINT D3D11_VIEWPORT_BOUNDS_MAX = 32767; +const INT D3D11_VIEWPORT_BOUNDS_MIN = -32768; +const UINT D3D11_SHADER_MAJOR_VERSION = 5; +const UINT D3D11_SHADER_MAX_INSTANCES = 65535; +const UINT D3D11_SHADER_MAX_INTERFACES = 253; +const UINT D3D11_SHADER_MAX_INTERFACE_CALL_SITES = 4096; +const UINT D3D11_SHADER_MAX_TYPES = 65535; +const UINT D3D11_SHADER_MINOR_VERSION = 0; +const UINT D3D11_VS_OUTPUT_REGISTER_COUNT = 32; cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") cpp_quote("struct CD3D11_DEFAULT {};") @@ -235,6 +248,47 @@ typedef enum D3D11_FILL_MODE D3D11_FILL_SOLID } D3D11_FILL_MODE; +typedef enum D3D11_FILTER_TYPE +{ + D3D11_FILTER_TYPE_POINT = 0, + D3D11_FILTER_TYPE_LINEAR = 1 +} D3D11_FILTER_TYPE; + +const UINT D3D11_MIN_FILTER_SHIFT = 4; +const UINT D3D11_MAG_FILTER_SHIFT = 2; +const UINT D3D11_MIP_FILTER_SHIFT = 0; +const UINT D3D11_FILTER_TYPE_MASK = 0x00000003; +const UINT D3D11_COMPARISON_FILTERING_BIT = 0x00000080; +const UINT D3D11_ANISOTROPIC_FILTERING_BIT = 0x00000040; + +cpp_quote("#define D3D11_ENCODE_BASIC_FILTER(min, mag, mip, bComparison) \\") +cpp_quote(" ((D3D11_FILTER)(((bComparison) ? D3D11_COMPARISON_FILTERING_BIT : 0 ) | \\") +cpp_quote(" (((min)&D3D11_FILTER_TYPE_MASK) << D3D11_MIN_FILTER_SHIFT) | \\") +cpp_quote(" (((mag)&D3D11_FILTER_TYPE_MASK) << D3D11_MAG_FILTER_SHIFT) | \\") +cpp_quote(" (((mip)&D3D11_FILTER_TYPE_MASK) << D3D11_MIP_FILTER_SHIFT)))") + +cpp_quote("#define D3D11_ENCODE_ANISOTROPIC_FILTER(bComparison) \\") +cpp_quote(" ((D3D11_FILTER)(D3D11_ANISOTROPIC_FILTERING_BIT | \\" ) +cpp_quote(" D3D11_ENCODE_BASIC_FILTER(D3D11_FILTER_TYPE_LINEAR,D3D11_FILTER_TYPE_LINEAR, \\" ) +cpp_quote(" D3D11_FILTER_TYPE_LINEAR,bComparison)))" ) + +cpp_quote("#define D3D11_DECODE_MIN_FILTER(d3d11Filter) \\") +cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MIN_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") + +cpp_quote("#define D3D11_DECODE_MAG_FILTER(d3d11Filter) \\") +cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MAG_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") + +cpp_quote("#define D3D11_DECODE_MIP_FILTER(d3d11Filter) \\") +cpp_quote(" ((D3D11_FILTER_TYPE)(((d3d11Filter) >> D3D11_MIP_FILTER_SHIFT) & D3D11_FILTER_TYPE_MASK))") + +cpp_quote("#define D3D11_DECODE_IS_COMPARISON_FILTER(d3d11Filter) ((d3d11Filter) & D3D11_COMPARISON_FILTERING_BIT)") + +cpp_quote("#define D3D11_DECODE_IS_ANISOTROPIC_FILTER(d3d11Filter) \\") +cpp_quote(" (((d3d11Filter) & D3D11_ANISOTROPIC_FILTERING_BIT ) \\" ) +cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIN_FILTER(d3d11Filter)) \\" ) +cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MAG_FILTER(d3d11Filter)) \\" ) +cpp_quote(" && (D3D11_FILTER_TYPE_LINEAR == D3D11_DECODE_MIP_FILTER(d3d11Filter)))") + typedef enum D3D11_FILTER { D3D11_FILTER_MIN_MAG_MIP_POINT = 0x00, @@ -316,6 +370,29 @@ typedef enum D3D11_QUERY D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM3, } D3D11_QUERY; +typedef enum D3D11_ASYNC_GETDATA_FLAG +{ + D3D11_ASYNC_GETDATA_DONOTFLUSH = 0x0001, +} D3D11_ASYNC_GETDATA_FLAG; + +typedef enum D3D11_RESOURCE_MISC_FLAG +{ + D3D11_RESOURCE_MISC_GENERATE_MIPS = 0x00000001L, + D3D11_RESOURCE_MISC_SHARED = 0x00000002L, + D3D11_RESOURCE_MISC_TEXTURECUBE = 0x00000004L, + D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS = 0x00000010L, + D3D11_RESOURCE_MISC_BUFFER_ALLOW_RAW_VIEWS = 0x00000020L, + D3D11_RESOURCE_MISC_BUFFER_STRUCTURED = 0x00000040L, + D3D11_RESOURCE_MISC_RESOURCE_CLAMP = 0x00000080L, + D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX = 0x00000100L, + D3D11_RESOURCE_MISC_GDI_COMPATIBLE = 0x00000200L, + D3D11_RESOURCE_MISC_SHARED_NTHANDLE = 0x00000800L, + D3D11_RESOURCE_MISC_RESTRICTED_CONTENT = 0x00001000L, + D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE = 0x00002000L, + D3D11_RESOURCE_MISC_RESTRICT_SHARED_RESOURCE_DRIVER = 0x00004000L, + D3D11_RESOURCE_MISC_GUARDED = 0x00008000L +} D3D11_RESOURCE_MISC_FLAG; + typedef struct D3D11_QUERY_DESC { D3D11_QUERY Query; @@ -415,6 +492,14 @@ typedef enum D3D11_STENCIL_OP D3D11_STENCIL_OP_DECR } D3D11_STENCIL_OP; +cpp_quote("#if !defined(D3D11_NO_HELPERS) && defined(__cplusplus)") +cpp_quote("}") +cpp_quote("inline UINT D3D11CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT MipLevels) {") +cpp_quote(" return MipSlice + ArraySlice * MipLevels;") +cpp_quote("}") +cpp_quote("extern \"C\"{") +cpp_quote("#endif") + typedef struct D3D11_SUBRESOURCE_DATA { const void *pSysMem; @@ -673,6 +758,43 @@ typedef enum D3D11_COLOR_WRITE_ENABLE (D3D11_COLOR_WRITE_ENABLE_RED|D3D11_COLOR_WRITE_ENABLE_GREEN|D3D11_COLOR_WRITE_ENABLE_BLUE|D3D11_COLOR_WRITE_ENABLE_ALPHA) } D3D11_COLOR_WRITE_ENABLE; +typedef enum D3D11_FORMAT_SUPPORT +{ + D3D11_FORMAT_SUPPORT_BUFFER = 0x00000001, + D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER = 0x00000002, + D3D11_FORMAT_SUPPORT_IA_INDEX_BUFFER = 0x00000004, + D3D11_FORMAT_SUPPORT_SO_BUFFER = 0x00000008, + D3D11_FORMAT_SUPPORT_TEXTURE1D = 0x00000010, + D3D11_FORMAT_SUPPORT_TEXTURE2D = 0x00000020, + D3D11_FORMAT_SUPPORT_TEXTURE3D = 0x00000040, + D3D11_FORMAT_SUPPORT_TEXTURECUBE = 0x00000080, + D3D11_FORMAT_SUPPORT_SHADER_LOAD = 0x00000100, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE = 0x00000200, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON = 0x00000400, + D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_MONO_TEXT = 0x00000800, + D3D11_FORMAT_SUPPORT_MIP = 0x00001000, + D3D11_FORMAT_SUPPORT_MIP_AUTOGEN = 0x00002000, + D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x00004000, + D3D11_FORMAT_SUPPORT_BLENDABLE = 0x00008000, + D3D11_FORMAT_SUPPORT_DEPTH_STENCIL = 0x00010000, + D3D11_FORMAT_SUPPORT_CPU_LOCKABLE = 0x00020000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RESOLVE = 0x00040000, + D3D11_FORMAT_SUPPORT_DISPLAY = 0x00080000, + D3D11_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x00100000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x00200000, + D3D11_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x00400000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER = 0x00800000, + D3D11_FORMAT_SUPPORT_BACK_BUFFER_CAST = 0x01000000, + D3D11_FORMAT_SUPPORT_TYPED_UNORDERED_ACCESS_VIEW = 0x02000000, + D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON = 0x04000000 +} D3D11_FORMAT_SUPPORT; + +typedef enum D3D11_CLEAR_FLAG +{ + D3D11_CLEAR_DEPTH = 0x0001L, + D3D11_CLEAR_STENCIL = 0x0002L +} D3D11_CLEAR_FLAG; + typedef struct D3D11_RENDER_TARGET_BLEND_DESC { BOOL BlendEnable; @@ -1867,3 +1989,13 @@ cpp_quote("#include <d3d10misc.h>") cpp_quote("#include <d3d10shader.h>") cpp_quote("#include <d3d10effect.h>") cpp_quote("#include <d3d10_1shader.h>") + +cpp_quote("typedef HRESULT (WINAPI* PFN_D3D11_CREATE_DEVICE)(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,") +cpp_quote(" const D3D_FEATURE_LEVEL*,UINT,UINT,ID3D11Device**,D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);") + +cpp_quote("HRESULT WINAPI D3D11CreateDevice(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,const D3D_FEATURE_LEVEL*," ) +cpp_quote(" UINT,UINT,ID3D11Device**,D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);") + +cpp_quote("typedef HRESULT (WINAPI *PFN_D3D11_CREATE_DEVICE_AND_SWAP_CHAIN)(IDXGIAdapter*,D3D_DRIVER_TYPE,HMODULE,UINT,") +cpp_quote(" const D3D_FEATURE_LEVEL*,UINT,UINT,const DXGI_SWAP_CHAIN_DESC*,IDXGISwapChain**,ID3D11Device**,") +cpp_quote(" D3D_FEATURE_LEVEL*,ID3D11DeviceContext**);")
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
65
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
Results per page:
10
25
50
100
200