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
April 2018
----- 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
542 discussions
Start a n
N
ew thread
Louis Lenders : msctf: Return S_OK in TextStoreACPSink_OnLayoutChange.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: bd64a86f0cb5f46b77730b1cb8794cb43a06f52f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bd64a86f0cb5f46b77730b1c…
Author: Louis Lenders <xerox.xerox2000x(a)gmail.com> Date: Wed Apr 4 11:48:01 2018 +0200 msctf: Return S_OK in TextStoreACPSink_OnLayoutChange. Signed-off-by: Louis Lenders <xerox.xerox2000x(a)gmail.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msctf/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msctf/context.c b/dlls/msctf/context.c index d52884d..452895c 100644 --- a/dlls/msctf/context.c +++ b/dlls/msctf/context.c @@ -773,7 +773,7 @@ static HRESULT WINAPI TextStoreACPSink_OnLayoutChange(ITextStoreACPSink *iface, { Context *This = impl_from_ITextStoreACPSink(iface); FIXME("STUB:(%p)\n",This); - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI TextStoreACPSink_OnStatusChange(ITextStoreACPSink *iface,
1
0
0
0
Zhiyi Zhang : comctl32/button: Implement BCM_{GET, SET}TEXTMARGIN message.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 1c6e71d62a197198054f7ab11345f675cbb6190f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1c6e71d62a197198054f7ab1…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Apr 4 10:50:44 2018 +0800 comctl32/button: Implement BCM_{GET,SET}TEXTMARGIN message. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 25 ++++++++++++++++++---- dlls/comctl32/tests/button.c | 49 ++++++++++++++++++++++++++++++++++++++++++++ include/commctrl.h | 4 ++++ 3 files changed, 74 insertions(+), 4 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 1c6fd62..1b187e3 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -29,8 +29,6 @@ * - WM_NCCREATE: Turns any BS_OWNERDRAW button into a BS_PUSHBUTTON button. * - WM_SYSKEYUP * - BCM_GETIDEALSIZE - * - BCM_GETTEXTMARGIN - * - BCM_SETTEXTMARGIN * * Notifications * - BCN_HOTITEMCHANGE @@ -45,8 +43,6 @@ * Structures/Macros/Definitions * - NMBCHOTITEM * - Button_GetIdealSize - * - Button_GetTextMargin - * - Button_SetTextMargin */ #include <stdarg.h> @@ -93,6 +89,7 @@ typedef struct _BUTTON_INFO INT note_length; DWORD image_type; /* IMAGE_BITMAP or IMAGE_ICON */ BUTTON_IMAGELIST imagelist; + RECT text_margin; union { HICON icon; @@ -785,6 +782,26 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L } break; + case BCM_SETTEXTMARGIN: + { + RECT *text_margin = (RECT *)lParam; + + if (!text_margin) return FALSE; + + infoPtr->text_margin = *text_margin; + return TRUE; + } + + case BCM_GETTEXTMARGIN: + { + RECT *text_margin = (RECT *)lParam; + + if (!text_margin) return FALSE; + + *text_margin = infoPtr->text_margin; + return TRUE; + } + case WM_NCHITTEST: if(btn_type == BS_GROUPBOX) return HTTRANSPARENT; /* fall through */ diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index d8489db..b9d2663 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -1355,6 +1355,54 @@ static void test_get_set_imagelist(void) } } +static void test_get_set_textmargin(void) +{ + HWND hwnd; + RECT margin_in; + RECT margin_out; + BOOL ret; + DWORD type; + + margin_in.top = 1; + margin_in.left = 2; + margin_in.right = 3; + margin_in.bottom = 4; + for (type = BS_PUSHBUTTON; type <= BS_DEFCOMMANDLINK; type++) + { + hwnd = create_button(type, NULL); + ok(hwnd != NULL, "Expect hwnd not null\n"); + + /* Get text margin when it is unset */ + ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out); + ok(ret, "Expect ret to be true\n"); + ok(IsRectEmpty(&margin_out), "Expect margin empty\n"); + + /* Successful get and set text margin */ + ret = SendMessageA(hwnd, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin_in); + ok(ret, "Expect ret to be true\n"); + SetRectEmpty(&margin_out); + ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out); + ok(ret, "Expect ret to be true\n"); + ok(EqualRect(&margin_in, &margin_out), "Expect margins to be equal\n"); + + /* BCM_SETTEXTMARGIN null pointer handling */ + ret = SendMessageA(hwnd, BCM_SETTEXTMARGIN, 0, 0); + ok(!ret, "Expect ret to be false\n"); + SetRectEmpty(&margin_out); + ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, (LPARAM)&margin_out); + ok(ret, "Expect ret to be true\n"); + ok(EqualRect(&margin_in, &margin_out), "Expect margins to be equal\n"); + + /* BCM_GETTEXTMARGIN null pointer handling */ + ret = SendMessageA(hwnd, BCM_SETTEXTMARGIN, 0, (LPARAM)&margin_in); + ok(ret, "Expect ret to be true\n"); + ret = SendMessageA(hwnd, BCM_GETTEXTMARGIN, 0, 0); + ok(!ret, "Expect ret to be true\n"); + + DestroyWindow(hwnd); + } +} + START_TEST(button) { ULONG_PTR ctx_cookie; @@ -1374,6 +1422,7 @@ START_TEST(button) test_button_data(); test_bm_get_set_image(); test_get_set_imagelist(); + test_get_set_textmargin(); unload_v6_module(ctx_cookie, hCtx); } diff --git a/include/commctrl.h b/include/commctrl.h index a0e0eca..b9e3ae6 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -1104,6 +1104,10 @@ typedef struct tagNMBCHOTITEM (BOOL)SNDMSG(button, BCM_GETIMAGELIST, 0, (LPARAM)(image_list)) #define Button_SetImageList(button, image_list) \ (BOOL)SNDMSG(button, BCM_SETIMAGELIST, 0, (LPARAM)(image_list)) +#define Button_GetTextMargin(button, margin) \ + (BOOL)SNDMSG(button, BCM_GETTEXTMARGIN, 0, (LPARAM)(margin)) +#define Button_SetTextMargin(button, margin) \ + (BOOL)SNDMSG(button, BCM_SETTEXTMARGIN, 0, (LPARAM)(margin)) /* Toolbar */
1
0
0
0
Zhiyi Zhang : comctl32/button: Implement BCM_{GET, SET}IMAGELIST message.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 0d4940b732f40ad7325b8ab61baee001b5d5e69e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0d4940b732f40ad7325b8ab6…
Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Wed Apr 4 10:50:18 2018 +0800 comctl32/button: Implement BCM_{GET,SET}IMAGELIST message. Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/button.c | 42 +++++++++++++++------- dlls/comctl32/tests/button.c | 86 ++++++++++++++++++++++++++++++++++++++++++++ include/commctrl.h | 4 +++ 3 files changed, 119 insertions(+), 13 deletions(-) diff --git a/dlls/comctl32/button.c b/dlls/comctl32/button.c index 46a6ff4..1c6fd62 100644 --- a/dlls/comctl32/button.c +++ b/dlls/comctl32/button.c @@ -29,9 +29,7 @@ * - WM_NCCREATE: Turns any BS_OWNERDRAW button into a BS_PUSHBUTTON button. * - WM_SYSKEYUP * - BCM_GETIDEALSIZE - * - BCM_GETIMAGELIST * - BCM_GETTEXTMARGIN - * - BCM_SETIMAGELIST * - BCM_SETTEXTMARGIN * * Notifications @@ -45,12 +43,9 @@ * - NM_CUSTOMDRAW * * Structures/Macros/Definitions - * - BUTTON_IMAGELIST * - NMBCHOTITEM * - Button_GetIdealSize - * - Button_GetImageList * - Button_GetTextMargin - * - Button_SetImageList * - Button_SetTextMargin */ @@ -89,14 +84,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(button); typedef struct _BUTTON_INFO { - HWND hwnd; - HWND parent; - LONG style; - LONG state; - HFONT font; - WCHAR *note; - INT note_length; - DWORD image_type; /* IMAGE_BITMAP or IMAGE_ICON */ + HWND hwnd; + HWND parent; + LONG style; + LONG state; + HFONT font; + WCHAR *note; + INT note_length; + DWORD image_type; /* IMAGE_BITMAP or IMAGE_ICON */ + BUTTON_IMAGELIST imagelist; union { HICON icon; @@ -728,6 +724,26 @@ static LRESULT CALLBACK BUTTON_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, L case BM_GETIMAGE: return (LRESULT)infoPtr->u.image; + case BCM_SETIMAGELIST: + { + BUTTON_IMAGELIST *imagelist = (BUTTON_IMAGELIST *)lParam; + + if (!imagelist) return FALSE; + + infoPtr->imagelist = *imagelist; + return TRUE; + } + + case BCM_GETIMAGELIST: + { + BUTTON_IMAGELIST *imagelist = (BUTTON_IMAGELIST *)lParam; + + if (!imagelist) return FALSE; + + *imagelist = infoPtr->imagelist; + return TRUE; + } + case BM_GETCHECK: return infoPtr->state & 3; diff --git a/dlls/comctl32/tests/button.c b/dlls/comctl32/tests/button.c index 3e705f1..d8489db 100644 --- a/dlls/comctl32/tests/button.c +++ b/dlls/comctl32/tests/button.c @@ -33,6 +33,8 @@ static BOOL (WINAPI *pSetWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR, DWORD_PTR); static BOOL (WINAPI *pRemoveWindowSubclass)(HWND, SUBCLASSPROC, UINT_PTR); static LRESULT (WINAPI *pDefSubclassProc)(HWND, UINT, WPARAM, LPARAM); +static HIMAGELIST(WINAPI *pImageList_Create)(int, int, UINT, int, int); +static int(WINAPI *pImageList_Add)(HIMAGELIST, HBITMAP, HBITMAP); /****************** button message test *************************/ #define ID_BUTTON 0x000e @@ -77,6 +79,11 @@ static void init_functions(void) MAKEFUNC_ORD(RemoveWindowSubclass, 412); MAKEFUNC_ORD(DefSubclassProc, 413); #undef MAKEFUNC_ORD + +#define X(f) p##f = (void *)GetProcAddress(hmod, #f); + X(ImageList_Create); + X(ImageList_Add); +#undef X } /* try to make sure pending X events have been processed before continuing */ @@ -1270,6 +1277,84 @@ static void test_button_data(void) DestroyWindow(parent); } +static void test_get_set_imagelist(void) +{ + HWND hwnd; + HIMAGELIST himl; + BUTTON_IMAGELIST biml = {0}; + HDC hdc; + HBITMAP hbmp; + INT width = 16; + INT height = 16; + INT index; + DWORD type; + BOOL ret; + + hdc = GetDC(0); + hbmp = CreateCompatibleBitmap(hdc, width, height); + ok(hbmp != NULL, "Expect hbmp not null\n"); + + himl = pImageList_Create(width, height, ILC_COLOR, 1, 0); + ok(himl != NULL, "Expect himl not null\n"); + index = pImageList_Add(himl, hbmp, NULL); + ok(index == 0, "Expect index == 0\n"); + DeleteObject(hbmp); + ReleaseDC(0, hdc); + + for (type = BS_PUSHBUTTON; type <= BS_DEFCOMMANDLINK; type++) + { + hwnd = create_button(type, NULL); + ok(hwnd != NULL, "Expect hwnd not null\n"); + + /* Get imagelist when imagelist is unset yet */ + ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_GETIMAGELIST return true\n"); + ok(biml.himl == 0 && IsRectEmpty(&biml.margin) && biml.uAlign == 0, + "Expect BUTTON_IMAGELIST is empty\n"); + + /* Set imagelist with himl null */ + biml.himl = 0; + biml.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; + ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml); + ok(ret || broken(!ret), /* xp or 2003 */ + "Expect BCM_SETIMAGELIST return true\n"); + + /* Set imagelist with uAlign invalid */ + biml.himl = himl; + biml.uAlign = -1; + ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_SETIMAGELIST return true\n"); + + /* Successful get and set imagelist */ + biml.himl = himl; + biml.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; + ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_SETIMAGELIST return true\n"); + ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_GETIMAGELIST return true\n"); + ok(biml.himl == himl, "Expect himl to be same\n"); + ok(biml.uAlign == BUTTON_IMAGELIST_ALIGN_CENTER, "Expect uAlign to be %x\n", + BUTTON_IMAGELIST_ALIGN_CENTER); + + /* BCM_SETIMAGELIST null pointer handling */ + ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, 0); + ok(!ret, "Expect BCM_SETIMAGELIST return false\n"); + ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_GETIMAGELIST return true\n"); + ok(biml.himl == himl, "Expect himl to be same\n"); + + /* BCM_GETIMAGELIST null pointer handling */ + biml.himl = himl; + biml.uAlign = BUTTON_IMAGELIST_ALIGN_CENTER; + ret = SendMessageA(hwnd, BCM_SETIMAGELIST, 0, (LPARAM)&biml); + ok(ret, "Expect BCM_SETIMAGELIST return true\n"); + ret = SendMessageA(hwnd, BCM_GETIMAGELIST, 0, 0); + ok(!ret, "Expect BCM_GETIMAGELIST return false\n"); + + DestroyWindow(hwnd); + } +} + START_TEST(button) { ULONG_PTR ctx_cookie; @@ -1288,6 +1373,7 @@ START_TEST(button) test_note(); test_button_data(); test_bm_get_set_image(); + test_get_set_imagelist(); unload_v6_module(ctx_cookie, hCtx); } diff --git a/include/commctrl.h b/include/commctrl.h index 3898f3b..a0e0eca 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -1100,6 +1100,10 @@ typedef struct tagNMBCHOTITEM (BOOL)SNDMSG(button, BCM_GETNOTE, (WPARAM)(size), (LPARAM)(buffer)) #define Button_GetNoteLength(button) \ (LRESULT)SNDMSG(button, BCM_GETNOTELENGTH, 0, 0) +#define Button_GetImageList(button, image_list) \ + (BOOL)SNDMSG(button, BCM_GETIMAGELIST, 0, (LPARAM)(image_list)) +#define Button_SetImageList(button, image_list) \ + (BOOL)SNDMSG(button, BCM_SETIMAGELIST, 0, (LPARAM)(image_list)) /* Toolbar */
1
0
0
0
Alexandre Julliard : winex11: Allow embedded windows to use an alpha channel with their surface.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 3c8ff605a61d5e59e767ab234ce102d0246ad895 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3c8ff605a61d5e59e767ab23…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 18:24:41 2018 +0200 winex11: Allow embedded windows to use an alpha channel with their surface. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index fff3f5c..5fecd9a 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2632,7 +2632,7 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO if (!surface || !EqualRect( &surface->rect, &rect )) { data->surface = create_surface( data->whole_window, &data->vis, &rect, - color_key, !data->embedded ); + color_key, data->use_alpha ); if (surface) window_surface_release( surface ); surface = data->surface; }
1
0
0
0
Alexandre Julliard : gdi32: Build the region object directly instead of making a copy in CreatePolyPolygonRgn.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 99b64f74320ba11b282a33aad2edc28551501875 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=99b64f74320ba11b282a33aa…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 15:12:55 2018 +0200 gdi32: Build the region object directly instead of making a copy in CreatePolyPolygonRgn. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/region.c | 169 +++++++++++++++++++++++----------------------------- 1 file changed, 74 insertions(+), 95 deletions(-) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index 8e0f32d..d369750 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -2537,18 +2537,26 @@ static void REGION_computeWAET( struct list *AET, struct list *WETE ) } /*********************************************************************** - * REGION_InsertionSort - * - * Just a simple insertion sort to sort the Active Edge Table. + * next_scanline * + * Update the Active Edge Table for the next scan line and sort it again. */ -static BOOL REGION_InsertionSort( struct list *AET ) +static inline BOOL next_scanline( struct list *AET, int y ) { struct edge_table_entry *active, *next, *insert; BOOL changed = FALSE; LIST_FOR_EACH_ENTRY_SAFE( active, next, AET, struct edge_table_entry, entry ) { + if (active->ymax == y) /* leaving this edge */ + { + list_remove( &active->entry ); + changed = TRUE; + } + else bres_incr_polygon( &active->bres ); + } + LIST_FOR_EACH_ENTRY_SAFE( active, next, AET, struct edge_table_entry, entry ) + { LIST_FOR_EACH_ENTRY( insert, AET, struct edge_table_entry, entry ) { if (insert == active) break; @@ -2581,66 +2589,13 @@ static void REGION_FreeStorage(ScanLineListBlock *pSLLBlock) /*********************************************************************** - * REGION_PtsToRegion - * - * Create an array of rectangles from a list of points. - */ -static WINEREGION *REGION_PtsToRegion( const POINT *pts, unsigned int size ) -{ - int cur_band = 0, prev_band = 0; - RECT *extents; - WINEREGION *reg; - - if (!(reg = alloc_region( size / 2 ))) return NULL; - - extents = ®->extents; - extents->left = LARGE_COORDINATE, extents->right = SMALL_COORDINATE; - - /* the loop uses 2 points per iteration */ - for (; size > 0; pts += 2, size -= 2) - { - if (pts[0].x == pts[1].x) - continue; - - if (reg->numRects && pts[0].y != reg->rects[cur_band].top) - { - prev_band = REGION_Coalesce( reg, prev_band, cur_band ); - cur_band = reg->numRects; - } - - add_rect( reg, pts[0].x, pts[0].y, pts[1].x, pts[1].y + 1 ); - if (pts[0].x < extents->left) - extents->left = pts[0].x; - if (pts[1].x > extents->right) - extents->right = pts[1].x; - } - - if (reg->numRects) { - REGION_Coalesce( reg, prev_band, cur_band ); - extents->top = reg->rects[0].top; - extents->bottom = reg->rects[reg->numRects-1].bottom; - } else { - extents->left = 0; - extents->top = 0; - extents->right = 0; - extents->bottom = 0; - } - REGION_compact( reg ); - - return reg; -} - -/* Number of points in the first point buffer. Must be an even number. */ -#define NUMPTSTOBUFFER 200 - -/*********************************************************************** * CreatePolyPolygonRgn (GDI32.@) */ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, INT nbpolygons, INT mode) { HRGN hrgn = 0; - WINEREGION *obj; + WINEREGION *obj = NULL; INT y; /* current scanline */ struct list WETE, *pWETE; /* Winding Edge Table */ ScanLineList *pSLL; /* current scanLineList */ @@ -2648,11 +2603,10 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, struct list AET; /* header for AET */ EdgeTableEntry *pETEs; /* EdgeTableEntries pool */ ScanLineListBlock SLLBlock; /* header for scanlinelist */ - BOOL fixWAET = FALSE; - POINT buffer[NUMPTSTOBUFFER], *points = buffer; - struct edge_table_entry *active, *next; - unsigned int nb_points, pos = 0; - INT poly, total; + struct edge_table_entry *active; + unsigned int nb_points; + int cur_band = 0, prev_band = 0; + INT i, poly, total, first = 1; TRACE("%p, count %d, polygons %d, mode %d\n", Pts, *Count, nbpolygons, mode); @@ -2677,11 +2631,9 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, return 0; if (!(nb_points = REGION_CreateEdgeTable(Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock))) goto done; - if (nb_points > NUMPTSTOBUFFER) - { - if (nb_points > INT_MAX / sizeof(*points)) goto done; - if (!(points = HeapAlloc( GetProcessHeap(), 0, nb_points * sizeof(*points) ))) goto done; - } + if (!(obj = alloc_region( nb_points / 2 ))) + goto done; + list_init( &AET ); pSLL = ET.scanlines.next; if (mode != WINDING) { @@ -2698,18 +2650,28 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, pSLL = pSLL->next; } - LIST_FOR_EACH_ENTRY_SAFE( active, next, &AET, struct edge_table_entry, entry ) + LIST_FOR_EACH_ENTRY( active, &AET, struct edge_table_entry, entry ) { - points[pos].x = active->bres.minor_axis; - points[pos].y = y; - pos++; - - if (active->ymax == y) /* leaving this edge */ - list_remove( &active->entry ); - else - bres_incr_polygon( &active->bres ); + if (first) + { + obj->rects[obj->numRects].left = active->bres.minor_axis; + obj->rects[obj->numRects].top = y; + } + else if (obj->rects[obj->numRects].left != active->bres.minor_axis) + { + obj->rects[obj->numRects].right = active->bres.minor_axis; + obj->rects[obj->numRects].bottom = y + 1; + obj->numRects++; + } + first = !first; + } + next_scanline( &AET, y ); + + if (obj->numRects) + { + prev_band = REGION_Coalesce( obj, prev_band, cur_band ); + cur_band = obj->numRects; } - REGION_InsertionSort(&AET); } } else { @@ -2731,47 +2693,64 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, /* * for each active edge */ - LIST_FOR_EACH_ENTRY_SAFE( active, next, &AET, struct edge_table_entry, entry ) + LIST_FOR_EACH_ENTRY( active, &AET, struct edge_table_entry, entry ) { /* * add to the buffer only those edges that * are in the Winding active edge table. */ if (pWETE == &active->winding_entry) { - points[pos].x = active->bres.minor_axis; - points[pos].y = y; - pos++; + if (first) + { + obj->rects[obj->numRects].left = active->bres.minor_axis; + obj->rects[obj->numRects].top = y; + } + else if (obj->rects[obj->numRects].left != active->bres.minor_axis) + { + obj->rects[obj->numRects].right = active->bres.minor_axis; + obj->rects[obj->numRects].bottom = y + 1; + obj->numRects++; + } + first = !first; pWETE = list_next( &WETE, pWETE ); } - if (active->ymax == y) /* leaving this edge */ - { - list_remove( &active->entry ); - fixWAET = TRUE; - } - else - bres_incr_polygon( &active->bres ); } /* * recompute the winding active edge table if * we just resorted or have exited an edge. */ - if (REGION_InsertionSort(&AET) || fixWAET) { - REGION_computeWAET( &AET, &WETE ); - fixWAET = FALSE; + if (next_scanline( &AET, y )) REGION_computeWAET( &AET, &WETE ); + + if (obj->numRects) + { + prev_band = REGION_Coalesce( obj, prev_band, cur_band ); + cur_band = obj->numRects; } } } - assert( pos == nb_points ); + assert( obj->numRects <= nb_points / 2 ); + + if (obj->numRects) + { + obj->extents.left = INT_MAX; + obj->extents.right = INT_MIN; + obj->extents.top = obj->rects[0].top; + obj->extents.bottom = obj->rects[obj->numRects-1].bottom; + for (i = 0; i < obj->numRects; i++) + { + obj->extents.left = min( obj->extents.left, obj->rects[i].left ); + obj->extents.right = max( obj->extents.right, obj->rects[i].right ); + } + } + REGION_compact( obj ); - if (!(obj = REGION_PtsToRegion( points, pos ))) goto done; if (!(hrgn = alloc_gdi_handle( obj, OBJ_REGION, ®ion_funcs ))) free_region( obj ); done: REGION_FreeStorage(SLLBlock.next); - if (points != buffer) HeapFree( GetProcessHeap(), 0, points ); HeapFree( GetProcessHeap(), 0, pETEs ); return hrgn; }
1
0
0
0
Alexandre Julliard : gdi32: Add a helper function to retrieve the DIB rectangle.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 737a113c10b9db17b729df001a90b2deb98d21c5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=737a113c10b9db17b729df00…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 15:20:57 2018 +0200 gdi32: Add a helper function to retrieve the DIB rectangle. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/dibdrv/dc.c | 22 +++++++++++----------- dlls/gdi32/dibdrv/dibdrv.h | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/dlls/gdi32/dibdrv/dc.c b/dlls/gdi32/dibdrv/dc.c index 78f4b7a..1aa67f3 100644 --- a/dlls/gdi32/dibdrv/dc.c +++ b/dlls/gdi32/dibdrv/dc.c @@ -240,16 +240,20 @@ DWORD convert_bitmapinfo( const BITMAPINFO *src_info, void *src_bits, struct bit return ERROR_SUCCESS; } +int get_dib_rect( const dib_info *dib, RECT *rc ) +{ + rc->left = max( 0, -dib->rect.left ); + rc->top = max( 0, -dib->rect.top ); + rc->right = min( dib->rect.right, dib->width ) - dib->rect.left; + rc->bottom = min( dib->rect.bottom, dib->height ) - dib->rect.top; + return !is_rect_empty( rc ); +} + int clip_rect_to_dib( const dib_info *dib, RECT *rc ) { RECT rect; - rect.left = max( 0, -dib->rect.left ); - rect.top = max( 0, -dib->rect.top ); - rect.right = min( dib->rect.right, dib->width ) - dib->rect.left; - rect.bottom = min( dib->rect.bottom, dib->height ) - dib->rect.top; - if (is_rect_empty( &rect )) return 0; - return intersect_rect( rc, &rect, rc ); + return get_dib_rect( dib, &rect ) && intersect_rect( rc, &rect, rc ); } int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct clipped_rects *clip_rects ) @@ -260,11 +264,7 @@ int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct cl init_clipped_rects( clip_rects ); - rect.left = max( 0, -dib->rect.left ); - rect.top = max( 0, -dib->rect.top ); - rect.right = min( dib->rect.right, dib->width ) - dib->rect.left; - rect.bottom = min( dib->rect.bottom, dib->height ) - dib->rect.top; - if (is_rect_empty( &rect )) return 0; + if (!get_dib_rect( dib, &rect )) return 0; if (rc && !intersect_rect( &rect, &rect, rc )) return 0; if (!clip) diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h index ce34c0d..f79f5b0 100644 --- a/dlls/gdi32/dibdrv/dibdrv.h +++ b/dlls/gdi32/dibdrv/dibdrv.h @@ -251,6 +251,7 @@ extern void free_pattern_brush(dib_brush *brush) DECLSPEC_HIDDEN; extern void copy_dib_color_info(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; extern BOOL convert_dib(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN; extern DWORD get_pixel_color( DC *dc, const dib_info *dib, COLORREF color, BOOL mono_fixup ) DECLSPEC_HIDDEN; +extern int get_dib_rect( const dib_info *dib, RECT *rc ) DECLSPEC_HIDDEN; extern int clip_rect_to_dib( const dib_info *dib, RECT *rc ) DECLSPEC_HIDDEN; extern int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct clipped_rects *clip_rects ) DECLSPEC_HIDDEN; extern void add_clipped_bounds( dibdrv_physdev *dev, const RECT *rect, HRGN clip ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : gdi32: Clip the computed region to the DIB rectangle in PolyPolygon().
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 0188dc7da8e34e755cb09504a48428152b73dfa6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0188dc7da8e34e755cb09504…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 15:21:14 2018 +0200 gdi32: Clip the computed region to the DIB rectangle in PolyPolygon(). Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/dibdrv/graphics.c | 12 ++-- dlls/gdi32/gdi_private.h | 2 + dlls/gdi32/region.c | 129 ++++++++++++++++++++++++------------------- 3 files changed, 82 insertions(+), 61 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0188dc7da8e34e755cb0…
1
0
0
0
Alexandre Julliard : user32/tests: Use the function pointer for GetWindowDpiAwarenessContext.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 3cad302cc05bee871a1261c7f20d054663b525f8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3cad302cc05bee871a1261c7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 11:41:31 2018 +0200 user32/tests: Use the function pointer for GetWindowDpiAwarenessContext. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/tests/sysparams.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 876f84f..5c27248 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -3083,7 +3083,7 @@ static void test_window_dpi(void) hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); ok( hwnd != 0, "failed to create window\n" ); - context = GetWindowDpiAwarenessContext( hwnd ); + context = pGetWindowDpiAwarenessContext( hwnd ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == DPI_AWARENESS_UNAWARE, "wrong awareness %u\n", awareness ); DestroyWindow( hwnd ); @@ -3092,7 +3092,7 @@ static void test_window_dpi(void) hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); ok( hwnd != 0, "failed to create window\n" ); - context = GetWindowDpiAwarenessContext( hwnd ); + context = pGetWindowDpiAwarenessContext( hwnd ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong awareness %u\n", awareness ); DestroyWindow( hwnd ); @@ -3101,24 +3101,24 @@ static void test_window_dpi(void) hwnd = CreateWindowA( "SysParamsTestClass", "Test System Parameters Application", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL ); ok( hwnd != 0, "failed to create window\n" ); - context = GetWindowDpiAwarenessContext( hwnd ); + context = pGetWindowDpiAwarenessContext( hwnd ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); DestroyWindow( hwnd ); SetLastError( 0xdeadbeef ); - context = GetWindowDpiAwarenessContext( (HWND)0xdeadbeef ); + context = pGetWindowDpiAwarenessContext( (HWND)0xdeadbeef ); ok( !context, "got %p\n", context ); ok( GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - context = GetWindowDpiAwarenessContext( GetDesktopWindow() ); + context = pGetWindowDpiAwarenessContext( GetDesktopWindow() ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness ); pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_UNAWARE ); SetLastError( 0xdeadbeef ); - context = GetWindowDpiAwarenessContext( GetDesktopWindow() ); + context = pGetWindowDpiAwarenessContext( GetDesktopWindow() ); awareness = pGetAwarenessFromDpiAwarenessContext( context ); ok( awareness == DPI_AWARENESS_PER_MONITOR_AWARE, "wrong awareness %u\n", awareness );
1
0
0
0
Alexandre Julliard : gdi32: Pre-allocate the points array in CreatePolyPolygonRgn.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: wine Branch: master Commit: 97f996744eafc4ad640ca3b9d97016625443c8cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=97f996744eafc4ad640ca3b9…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Apr 4 12:38:29 2018 +0200 gdi32: Pre-allocate the points array in CreatePolyPolygonRgn. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/region.c | 127 ++++++++++++++++++---------------------------------- 1 file changed, 44 insertions(+), 83 deletions(-) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index e9bed18..8e0f32d 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -94,6 +94,7 @@ SOFTWARE. * the y-x-banding that's so nice to have... */ +#include <assert.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> @@ -172,48 +173,6 @@ static inline BOOL is_in_rect( const RECT *rect, int x, int y ) return (rect->right > x && rect->left <= x && rect->bottom > y && rect->top <= y); } -/* - * used to allocate buffers for points and link - * the buffers together - */ - -struct point_block -{ - int count, size; - struct point_block *next; - POINT pts[1]; /* Variable sized array - must be last. */ -}; - -static struct point_block *add_point( struct point_block *block, int x, int y ) -{ - if (block->count == block->size) - { - struct point_block *new; - int size = block->size * 2; - new = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct point_block, pts[size] ) ); - if (!new) return NULL; - block->next = new; - new->count = 0; - new->size = size; - new->next = NULL; - block = new; - } - block->pts[block->count].x = x; - block->pts[block->count].y = y; - block->count++; - return block; -} - -static void free_point_blocks( struct point_block *block ) -{ - while (block) - { - struct point_block *tmp = block->next; - HeapFree( GetProcessHeap(), 0, block ); - block = tmp; - } -} - /* * This file contains a few macros to help track @@ -452,6 +411,7 @@ static BOOL init_region( WINEREGION *pReg, INT n ) if (n > RGN_DEFAULT_RECTS) { + if (n > INT_MAX / sizeof(RECT)) return FALSE; if (!(pReg->rects = HeapAlloc( GetProcessHeap(), 0, n * sizeof( RECT ) ))) return FALSE; } @@ -2426,15 +2386,15 @@ static void REGION_InsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, * which an edge is initially entered. * */ -static void REGION_CreateEdgeTable(const INT *Count, INT nbpolygons, - const POINT *pts, EdgeTable *ET, - EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) +static unsigned int REGION_CreateEdgeTable(const INT *Count, INT nbpolygons, + const POINT *pts, EdgeTable *ET, + EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock) { const POINT *top, *bottom; const POINT *PrevPt, *CurrPt, *EndPt; INT poly, count; int iSLLBlock = 0; - int dy; + unsigned int dy, total = 0; /* * initialize the Edge Table. @@ -2490,6 +2450,8 @@ static void REGION_CreateEdgeTable(const INT *Count, INT nbpolygons, */ dy = bottom->y - top->y; bres_init_polygon(dy, top->x, bottom->x, &pETEs->bres); + if (total + dy < total) return 0; /* overflow */ + total += dy; REGION_InsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock); @@ -2504,6 +2466,7 @@ static void REGION_CreateEdgeTable(const INT *Count, INT nbpolygons, PrevPt = CurrPt; } } + return total; } /*********************************************************************** @@ -2622,40 +2585,34 @@ static void REGION_FreeStorage(ScanLineListBlock *pSLLBlock) * * Create an array of rectangles from a list of points. */ -static WINEREGION *REGION_PtsToRegion( struct point_block *FirstPtBlock ) +static WINEREGION *REGION_PtsToRegion( const POINT *pts, unsigned int size ) { - POINT *pts; - struct point_block *pb; - int i, size, cur_band = 0, prev_band = 0; + int cur_band = 0, prev_band = 0; RECT *extents; WINEREGION *reg; - for (pb = FirstPtBlock, size = 0; pb; pb = pb->next) size += pb->count; - if (!(reg = alloc_region( size ))) return NULL; + if (!(reg = alloc_region( size / 2 ))) return NULL; extents = ®->extents; extents->left = LARGE_COORDINATE, extents->right = SMALL_COORDINATE; - for (pb = FirstPtBlock; pb; pb = pb->next) + /* the loop uses 2 points per iteration */ + for (; size > 0; pts += 2, size -= 2) { - /* the loop uses 2 points per iteration */ - i = pb->count / 2; - for (pts = pb->pts; i--; pts += 2) { - if (pts->x == pts[1].x) - continue; - - if (reg->numRects && pts[0].y != reg->rects[cur_band].top) - { - prev_band = REGION_Coalesce( reg, prev_band, cur_band ); - cur_band = reg->numRects; - } + if (pts[0].x == pts[1].x) + continue; - add_rect( reg, pts[0].x, pts[0].y, pts[1].x, pts[1].y + 1 ); - if (pts[0].x < extents->left) - extents->left = pts[0].x; - if (pts[1].x > extents->right) - extents->right = pts[1].x; + if (reg->numRects && pts[0].y != reg->rects[cur_band].top) + { + prev_band = REGION_Coalesce( reg, prev_band, cur_band ); + cur_band = reg->numRects; } + + add_rect( reg, pts[0].x, pts[0].y, pts[1].x, pts[1].y + 1 ); + if (pts[0].x < extents->left) + extents->left = pts[0].x; + if (pts[1].x > extents->right) + extents->right = pts[1].x; } if (reg->numRects) { @@ -2692,9 +2649,9 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, EdgeTableEntry *pETEs; /* EdgeTableEntries pool */ ScanLineListBlock SLLBlock; /* header for scanlinelist */ BOOL fixWAET = FALSE; - char first_blk_buf[FIELD_OFFSET( struct point_block, pts[NUMPTSTOBUFFER] )]; - struct point_block *first_block = (struct point_block *)first_blk_buf, *block; + POINT buffer[NUMPTSTOBUFFER], *points = buffer; struct edge_table_entry *active, *next; + unsigned int nb_points, pos = 0; INT poly, total; TRACE("%p, count %d, polygons %d, mode %d\n", Pts, *Count, nbpolygons, mode); @@ -2719,14 +2676,14 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, if (! (pETEs = HeapAlloc( GetProcessHeap(), 0, sizeof(EdgeTableEntry) * total ))) return 0; - REGION_CreateEdgeTable(Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock); + if (!(nb_points = REGION_CreateEdgeTable(Count, nbpolygons, Pts, &ET, pETEs, &SLLBlock))) goto done; + if (nb_points > NUMPTSTOBUFFER) + { + if (nb_points > INT_MAX / sizeof(*points)) goto done; + if (!(points = HeapAlloc( GetProcessHeap(), 0, nb_points * sizeof(*points) ))) goto done; + } list_init( &AET ); pSLL = ET.scanlines.next; - block = first_block; - first_block->count = 0; - first_block->size = NUMPTSTOBUFFER; - first_block->next = NULL; - if (mode != WINDING) { /* * for each scanline @@ -2743,8 +2700,9 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, LIST_FOR_EACH_ENTRY_SAFE( active, next, &AET, struct edge_table_entry, entry ) { - block = add_point( block, active->bres.minor_axis, y ); - if (!block) goto done; + points[pos].x = active->bres.minor_axis; + points[pos].y = y; + pos++; if (active->ymax == y) /* leaving this edge */ list_remove( &active->entry ); @@ -2780,8 +2738,9 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, * are in the Winding active edge table. */ if (pWETE == &active->winding_entry) { - block = add_point( block, active->bres.minor_axis, y ); - if (!block) goto done; + points[pos].x = active->bres.minor_axis; + points[pos].y = y; + pos++; pWETE = list_next( &WETE, pWETE ); } if (active->ymax == y) /* leaving this edge */ @@ -2804,13 +2763,15 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, } } - if (!(obj = REGION_PtsToRegion( first_block ))) goto done; + assert( pos == nb_points ); + + if (!(obj = REGION_PtsToRegion( points, pos ))) goto done; if (!(hrgn = alloc_gdi_handle( obj, OBJ_REGION, ®ion_funcs ))) free_region( obj ); done: REGION_FreeStorage(SLLBlock.next); - free_point_blocks( first_block->next ); + if (points != buffer) HeapFree( GetProcessHeap(), 0, points ); HeapFree( GetProcessHeap(), 0, pETEs ); return hrgn; }
1
0
0
0
Michael Stefaniuc : Update the mailing list traffic estimations.
by Alexandre Julliard
04 Apr '18
04 Apr '18
Module: website Branch: master Commit: 2f0f0f4a8aa5a195134ec2eedb8326083fa16ac8 URL:
https://source.winehq.org/git/website.git/?a=commit;h=2f0f0f4a8aa5a195134ec…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Wed Apr 4 00:45:55 2018 +0200 Update the mailing list traffic estimations. Also deprecate wine-patches in the English version of that page. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- templates/en/forums.template | 8 ++++---- templates/fr/forums.template | 6 +++--- templates/ko/forums.template | 6 +++--- templates/pl/forums.template | 6 +++--- templates/pt/forums.template | 6 +++--- templates/tr/forums.template | 6 +++--- templates/zh-cn/forums.template | 6 +++--- 7 files changed, 22 insertions(+), 22 deletions(-) Diff:
https://source.winehq.org/git/website.git/?a=commitdiff;h=2f0f0f4a8aa5a1951…
1
0
0
0
← Newer
1
...
44
45
46
47
48
49
50
...
55
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
Results per page:
10
25
50
100
200