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
April
March
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2010
----- 2025 -----
April 2025
March 2025
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
884 discussions
Start a n
N
ew thread
Nikolay Sivov : comctl32/tests: Remove some noise from function names.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 94dfbcaad52e44990efe03d4d9cc7b30d9e463d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=94dfbcaad52e44990efe03d4d…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Aug 4 14:32:51 2010 +0400 comctl32/tests: Remove some noise from function names. Everything in this file is about Monthcal. --- dlls/comctl32/tests/monthcal.c | 56 ++++++++++++++++++++-------------------- 1 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index 267b052..59dd0d5 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -611,7 +611,7 @@ static HWND create_monthcal_control(DWORD style) /* Setter and Getters Tests */ -static void test_monthcal_color(void) +static void test_color(void) { int res, temp; HWND hwnd; @@ -686,7 +686,7 @@ static void test_monthcal_color(void) DestroyWindow(hwnd); } -static void test_monthcal_currdate(void) +static void test_currdate(void) { SYSTEMTIME st_original, st_new, st_test; int res; @@ -816,7 +816,7 @@ static void test_monthcal_currdate(void) DestroyWindow(hwnd); } -static void test_monthcal_firstDay(void) +static void test_firstDay(void) { int res, fday, i, prev; CHAR b[128]; @@ -863,7 +863,7 @@ static void test_monthcal_firstDay(void) DestroyWindow(hwnd); } -static void test_monthcal_unicode(void) +static void test_unicode(void) { int res, temp; HWND hwnd; @@ -906,7 +906,7 @@ static void test_monthcal_unicode(void) DestroyWindow(hwnd); } -static void test_monthcal_hittest(void) +static void test_hittest(void) { typedef struct hittest_test { @@ -1157,7 +1157,7 @@ static void test_monthcal_hittest(void) DestroyWindow(hwnd); } -static void test_monthcal_todaylink(void) +static void test_todaylink(void) { MCHITTESTINFO mchit; SYSTEMTIME st_test, st_new; @@ -1212,7 +1212,7 @@ static void test_monthcal_todaylink(void) DestroyWindow(hwnd); } -static void test_monthcal_today(void) +static void test_today(void) { SYSTEMTIME st_test, st_new; int res; @@ -1267,7 +1267,7 @@ static void test_monthcal_today(void) DestroyWindow(hwnd); } -static void test_monthcal_scroll(void) +static void test_scroll(void) { int res; HWND hwnd; @@ -1305,7 +1305,7 @@ static void test_monthcal_scroll(void) DestroyWindow(hwnd); } -static void test_monthcal_monthrange(void) +static void test_monthrange(void) { int res; SYSTEMTIME st_visible[2], st_daystate[2], st; @@ -1398,7 +1398,7 @@ static void test_monthcal_monthrange(void) DestroyWindow(hwnd); } -static void test_monthcal_maxselday(void) +static void test_maxselday(void) { int res; HWND hwnd; @@ -1464,7 +1464,7 @@ static void test_monthcal_maxselday(void) DestroyWindow(hwnd); } -static void test_monthcal_size(void) +static void test_size(void) { int res; RECT r1, r2; @@ -1500,7 +1500,7 @@ static void test_monthcal_size(void) DestroyWindow(hwnd); } -static void test_monthcal_create(void) +static void test_create(void) { HWND hwnd; @@ -1517,7 +1517,7 @@ static void test_monthcal_create(void) DestroyWindow(hwnd); } -static void test_monthcal_destroy(void) +static void test_destroy(void) { HWND hwnd; @@ -1534,7 +1534,7 @@ static void test_monthcal_destroy(void) ok_sequence(sequences, MONTHCAL_SEQ_INDEX, destroy_monthcal_multi_sel_style_seq, "Destroy monthcal (multi sel style)", FALSE); } -static void test_monthcal_selrange(void) +static void test_selrange(void) { HWND hwnd; SYSTEMTIME st, range[2], range2[2]; @@ -1809,20 +1809,20 @@ START_TEST(monthcal) parent_wnd = create_parent_window(); - test_monthcal_create(); - test_monthcal_destroy(); - test_monthcal_color(); - test_monthcal_currdate(); - test_monthcal_firstDay(); - test_monthcal_unicode(); - test_monthcal_today(); - test_monthcal_scroll(); - test_monthcal_monthrange(); - test_monthcal_hittest(); - test_monthcal_todaylink(); - test_monthcal_size(); - test_monthcal_maxselday(); - test_monthcal_selrange(); + test_create(); + test_destroy(); + test_color(); + test_currdate(); + test_firstDay(); + test_unicode(); + test_today(); + test_scroll(); + test_monthrange(); + test_hittest(); + test_todaylink(); + test_size(); + test_maxselday(); + test_selrange(); test_killfocus(); if (!load_v6_module(&ctx_cookie, &hCtx))
1
0
0
0
Nikolay Sivov : comctl32/monthcal: Add some tests for post-V1 hittest fields.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 8e968fd29037a6ef837b15ec99a311bf9f8617d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8e968fd29037a6ef837b15ec9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Aug 4 14:29:27 2010 +0400 comctl32/monthcal: Add some tests for post-V1 hittest fields. --- dlls/comctl32/monthcal.c | 18 ++--- dlls/comctl32/tests/monthcal.c | 176 ++++++++++++++++++++++++++++++++++----- include/commctrl.h | 2 + 3 files changed, 163 insertions(+), 33 deletions(-) diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index c1c105c..130e5f8 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -1715,23 +1715,21 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht) lpht->uHit = MCHT_CALENDARWEEKNUM; lpht->st.wYear = ht_month.wYear; - if (day < 1) { + if (day < 1) + { lpht->st.wMonth = ht_month.wMonth - 1; - } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { - lpht->st.wMonth = ht_month.wMonth + 1; - } - else - lpht->st.wMonth = ht_month.wMonth; - - if (day < 1) { lpht->st.wDay = MONTHCAL_MonthLength(ht_month.wMonth-1, ht_month.wYear) - day; } - else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) { + else if (day > MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear)) + { + lpht->st.wMonth = ht_month.wMonth + 1; lpht->st.wDay = day - MONTHCAL_MonthLength(ht_month.wMonth, ht_month.wYear); } else + { + lpht->st.wMonth = ht_month.wMonth; lpht->st.wDay = day; + } } else if(PtInRect(&infoPtr->calendars[calIdx].days, lpht->pt)) { diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c index 30f682f..267b052 100644 --- a/dlls/comctl32/tests/monthcal.c +++ b/dlls/comctl32/tests/monthcal.c @@ -28,12 +28,14 @@ #include "commctrl.h" #include "wine/test.h" +#include "v6util.h" #include <assert.h> #include <windows.h> #include "msg.h" #define expect(expected, got) ok(expected == got, "Expected %d, got %d\n", expected, got); #define expect_hex(expected, got) ok(expected == got, "Expected %x, got %x\n", expected, got); +#define expect_d(expected, got) ok(abs((expected) - (got)) <= 2, "Expected %d, got %d\n", expected, got); #define NUM_MSG_SEQUENCES 2 #define PARENT_SEQ_INDEX 0 @@ -292,26 +294,6 @@ static const struct message destroy_monthcal_multi_sel_style_seq[] = { { 0 } }; -/* expected message sequence for parent window*/ -static const struct message destroy_parent_seq[] = { - { 0x0090, sent|optional }, /* Vista */ - { WM_WINDOWPOSCHANGING, sent|wparam, 0}, - { WM_WINDOWPOSCHANGED, sent|wparam, 0}, - { WM_IME_SETCONTEXT, sent|wparam|optional, 0}, - { WM_IME_NOTIFY, sent|wparam|lparam|defwinproc|optional, 1, 0}, - { WM_NCACTIVATE, sent|wparam|optional, 0}, - { WM_ACTIVATE, sent|wparam|optional, 0}, - { WM_NCACTIVATE, sent|wparam|lparam|optional, 0, 0}, - { WM_ACTIVATE, sent|wparam|lparam|optional, 0, 0}, - { WM_ACTIVATEAPP, sent|wparam|optional, 0}, - { WM_KILLFOCUS, sent|wparam|lparam|optional, 0, 0}, - { WM_IME_SETCONTEXT, sent|wparam|optional, 0}, - { WM_IME_NOTIFY, sent|wparam|lparam|defwinproc|optional, 1, 0}, - { WM_DESTROY, sent|wparam|lparam, 0, 0}, - { WM_NCDESTROY, sent|wparam|lparam, 0, 0}, - { 0 } -}; - static void test_monthcal(void) { HWND hwnd; @@ -1680,11 +1662,135 @@ static void test_killfocus(void) DestroyWindow(hwnd); } +static void test_hittest_v6(void) +{ + MCHITTESTINFO mchit; + DWORD ret; + HWND hwnd; + RECT r; + + hwnd = create_monthcal_control(0); + SendMessage(hwnd, MCM_SETCALENDARBORDER, TRUE, 0); + + SendMessage(hwnd, MCM_GETMINREQRECT, 0, (LPARAM)&r); + /* reserving some area around calendar */ + MoveWindow(hwnd, 0, 0, r.right * 3 / 2, r.bottom * 3 / 2, FALSE); + mchit.cbSize = sizeof(MCHITTESTINFO); + mchit.pt.x = mchit.pt.y = 0; + mchit.iOffset = -1; + mchit.iRow = -1; + mchit.iCol = -1; + ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + if (ret == -1) + { + win_skip("Only MCHITTESTINFO_V1 supported\n"); + DestroyWindow(hwnd); + return; + } + todo_wine expect_hex(MCHT_NOWHERE, ret); + expect(-1, mchit.iOffset); + expect(-1, mchit.iRow); + expect(-1, mchit.iCol); + + MoveWindow(hwnd, 0, 0, r.right, r.bottom, FALSE); + mchit.pt.x = r.right / 2; + mchit.pt.y = r.bottom / 2; + mchit.iOffset = -1; + ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + expect_hex(MCHT_CALENDARDATE, ret); + todo_wine expect(0, mchit.iOffset); + + /* over day area */ + mchit.pt.x = r.right / (7*2); + mchit.pt.y = r.bottom / 2; + mchit.iOffset = -1; + mchit.iCol = mchit.iRow = -1; + mchit.uHit = 0; + mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; + ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + expect_hex(MCHT_CALENDARDATE, ret); + expect_hex(MCHT_CALENDARDATE, mchit.uHit); + todo_wine expect(0, mchit.iOffset); + todo_wine expect(2, mchit.iRow); + todo_wine expect(0, mchit.iCol); + /* returned a one day rectangle */ + todo_wine expect_d(r.right / 7, mchit.rc.right - mchit.rc.left); + todo_wine expect_d(r.bottom / 10, mchit.rc.bottom - mchit.rc.top); + + /* title */ + mchit.pt.x = 1; + mchit.pt.y = 1; + mchit.iOffset = -1; + mchit.iCol = mchit.iRow = -1; + mchit.uHit = 0; + mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; + ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + expect_hex(MCHT_TITLE, ret); + expect_hex(MCHT_TITLE, mchit.uHit); + todo_wine expect(0, mchit.iOffset); + expect(-1, mchit.iRow); + expect(-1, mchit.iCol); + todo_wine expect(0, mchit.rc.left); + todo_wine expect(0, mchit.rc.top); + todo_wine expect_d(r.right, mchit.rc.right); + todo_wine ok(mchit.rc.bottom > 0, "got %d\n", mchit.rc.bottom); + + /* between two calendars */ + MoveWindow(hwnd, 0, 0, r.right * 5/2, r.bottom, FALSE); + mchit.pt.x = r.right / (5*4); + mchit.pt.y = r.bottom / 2; + mchit.iOffset = -2; + mchit.iCol = mchit.iRow = -2; + mchit.uHit = 0; + mchit.rc.left = mchit.rc.right = mchit.rc.top = mchit.rc.bottom = -1; + ret = SendMessage(hwnd, MCM_HITTEST, 0, (LPARAM)&mchit); + todo_wine expect_hex(MCHT_NOWHERE, ret); + todo_wine expect_hex(MCHT_NOWHERE, mchit.uHit); + expect(-2, mchit.iOffset); + expect(-2, mchit.iRow); + expect(-2, mchit.iCol); + todo_wine expect(0, mchit.rc.left); + todo_wine expect(0, mchit.rc.top); + todo_wine expect_d(r.right * 5/2, mchit.rc.right); + todo_wine expect_d(r.bottom, mchit.rc.bottom); + + DestroyWindow(hwnd); +} + +static void test_get_set_border(void) +{ + HWND hwnd; + DWORD ret; + + hwnd = create_monthcal_control(0); + + /* a non-default value */ + ret = SendMessage(hwnd, MCM_SETCALENDARBORDER, TRUE, 10); + expect(0, ret); + + ret = SendMessage(hwnd, MCM_GETCALENDARBORDER, 0, 0); + + if (ret != 10) + { + skip("MCM_GET/SETCALENDARBORDER not supported\n"); + DestroyWindow(hwnd); + return; + } + + expect(10, ret); + + DestroyWindow(hwnd); +} + START_TEST(monthcal) { - HMODULE hComctl32; BOOL (WINAPI *pInitCommonControlsEx)(const INITCOMMONCONTROLSEX*); INITCOMMONCONTROLSEX iccex; + HMODULE hComctl32; + HWND hwnd; + + ULONG_PTR ctx_cookie; + HANDLE hCtx; hComctl32 = GetModuleHandleA("comctl32.dll"); pInitCommonControlsEx = (void*)GetProcAddress(hComctl32, "InitCommonControlsEx"); @@ -1719,7 +1825,31 @@ START_TEST(monthcal) test_monthcal_selrange(); test_killfocus(); - flush_sequences(sequences, NUM_MSG_SEQUENCES); + if (!load_v6_module(&ctx_cookie, &hCtx)) + { + DestroyWindow(parent_wnd); + return; + } + + /* this is a XP SP3 failure workaround */ + hwnd = CreateWindowExA(0, MONTHCAL_CLASSA, "foo", + WS_CHILD | WS_BORDER | WS_VISIBLE, + 0, 0, 100, 100, + parent_wnd, NULL, GetModuleHandleA(NULL), NULL); + if (!IsWindow(hwnd)) + { + win_skip("FIXME: failed to create Monthcal window.\n"); + unload_v6_module(ctx_cookie, hCtx); + DestroyWindow(parent_wnd); + return; + } + else + DestroyWindow(hwnd); + + test_hittest_v6(); + test_get_set_border(); + + unload_v6_module(ctx_cookie, hCtx); + DestroyWindow(parent_wnd); - ok_sequence(sequences, PARENT_SEQ_INDEX, destroy_parent_seq, "Destroy parent window", FALSE); } diff --git a/include/commctrl.h b/include/commctrl.h index d3a4de1..fdd6951 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -4675,6 +4675,8 @@ static const WCHAR MONTHCAL_CLASSW[] = { 'S','y','s', #define MCM_GETMONTHDELTA (MCM_FIRST + 19) #define MCM_SETMONTHDELTA (MCM_FIRST + 20) #define MCM_GETMAXTODAYWIDTH (MCM_FIRST + 21) +#define MCM_SETCALENDARBORDER (MCM_FIRST + 30) +#define MCM_GETCALENDARBORDER (MCM_FIRST + 31) #define MCM_GETUNICODEFORMAT CCM_GETUNICODEFORMAT #define MCM_SETUNICODEFORMAT CCM_SETUNICODEFORMAT
1
0
0
0
Henri Verbeet : wined3d: Make some lookup tables const.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 37c8632811e705148110fb07cf55e27cdfe249af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37c8632811e705148110fb07c…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 4 11:10:27 2010 +0200 wined3d: Make some lookup tables const. --- dlls/wined3d/arb_program_shader.c | 10 +++++----- dlls/wined3d/glsl_shader.c | 12 +++++------- dlls/wined3d/shader.c | 4 ++-- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index ab82bb8..ef78227 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -3412,7 +3412,7 @@ static const DWORD *find_loop_control_values(IWineD3DBaseShaderImpl *This, DWORD static void init_ps_input(const IWineD3DPixelShaderImpl *This, const struct arb_ps_compile_args *args, struct shader_arb_ctx_priv *priv) { - const char *texcoords[8] = + static const char * const texcoords[8] = { "fragment.texcoord[0]", "fragment.texcoord[1]", "fragment.texcoord[2]", "fragment.texcoord[3]", "fragment.texcoord[4]", "fragment.texcoord[5]", "fragment.texcoord[6]", "fragment.texcoord[7]" @@ -3894,7 +3894,7 @@ static void init_output_registers(IWineD3DVertexShaderImpl *shader, DWORD sig_nu struct arb_vs_compiled_shader *compiled) { unsigned int i, j; - static const char *texcoords[8] = + static const char * const texcoords[8] = { "result.texcoord[0]", "result.texcoord[1]", "result.texcoord[2]", "result.texcoord[3]", "result.texcoord[4]", "result.texcoord[5]", "result.texcoord[6]", "result.texcoord[7]" @@ -3908,10 +3908,10 @@ static void init_output_registers(IWineD3DVertexShaderImpl *shader, DWORD sig_nu /* Write generic input varyings 0 to 7 to result.texcoord[], varying 8 to result.color.primary * and varying 9 to result.color.secondary */ - const char *decl_idx_to_string[MAX_REG_INPUT] = + static const char * const decl_idx_to_string[MAX_REG_INPUT] = { - texcoords[0], texcoords[1], texcoords[2], texcoords[3], - texcoords[4], texcoords[5], texcoords[6], texcoords[7], + "result.texcoord[0]", "result.texcoord[1]", "result.texcoord[2]", "result.texcoord[3]", + "result.texcoord[4]", "result.texcoord[5]", "result.texcoord[6]", "result.texcoord[7]", "result.color.primary", "result.color.secondary" }; diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 7f772a2..86355fa 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4462,18 +4462,16 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, GLhandleARB vshader_id, pshader_id; const char *blt_pshader; - static const char *blt_vshader[] = - { + static const char *blt_vshader = "#version 120\n" "void main(void)\n" "{\n" " gl_Position = gl_Vertex;\n" " gl_FrontColor = vec4(1.0);\n" " gl_TexCoord[0] = gl_MultiTexCoord0;\n" - "}\n" - }; + "}\n"; - static const char *blt_pshaders_full[tex_type_count] = + static const char * const blt_pshaders_full[tex_type_count] = { /* tex_1d */ NULL, @@ -4503,7 +4501,7 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, "}\n", }; - static const char *blt_pshaders_masked[tex_type_count] = + static const char * const blt_pshaders_masked[tex_type_count] = { /* tex_1d */ NULL, @@ -4547,7 +4545,7 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, } vshader_id = GL_EXTCALL(glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB)); - GL_EXTCALL(glShaderSourceARB(vshader_id, 1, blt_vshader, NULL)); + GL_EXTCALL(glShaderSourceARB(vshader_id, 1, &blt_vshader, NULL)); GL_EXTCALL(glCompileShaderARB(vshader_id)); pshader_id = GL_EXTCALL(glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB)); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index b656601..e14666c 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -33,7 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d); -static const char *shader_opcode_names[] = +static const char * const shader_opcode_names[] = { /* WINED3DSIH_ABS */ "abs", /* WINED3DSIH_ADD */ "add", @@ -125,7 +125,7 @@ static const char *shader_opcode_names[] = /* WINED3DSIH_TEXREG2RGB */ "texreg2rgb", }; -static const char *semantic_names[] = +static const char * const semantic_names[] = { /* WINED3DDECLUSAGE_POSITION */ "SV_POSITION", /* WINED3DDECLUSAGE_BLENDWEIGHT */ "BLENDWEIGHT",
1
0
0
0
Henri Verbeet : wined3d: Only try to acquire a context in surface_cleanup() if there are GL resources to be destroyed.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 2b88b2d3511c4d9c76867c379b09b547f5946a6d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2b88b2d3511c4d9c76867c379…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 4 11:10:26 2010 +0200 wined3d: Only try to acquire a context in surface_cleanup() if there are GL resources to be destroyed. The reason we're in surface_cleanup() might for example be that context creation failed. --- dlls/wined3d/surface.c | 60 ++++++++++++++++++++++------------------------- 1 files changed, 28 insertions(+), 32 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 47282b0..101c8c2 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -36,44 +36,42 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d); static void surface_cleanup(IWineD3DSurfaceImpl *This) { - IWineD3DDeviceImpl *device = This->resource.device; - const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; - struct wined3d_context *context = NULL; - renderbuffer_entry_t *entry, *entry2; - TRACE("(%p) : Cleaning up.\n", This); - /* Need a context to destroy the texture. Use the currently active render - * target, but only if the primary render target exists. Otherwise - * lastActiveRenderTarget is garbage. When destroying the primary render - * target, Uninit3D() will activate a context before doing anything. */ - if (device->render_targets && device->render_targets[0]) + if (This->texture_name || (This->Flags & SFLAG_PBO) || !list_empty(&This->renderbuffers)) { - context = context_acquire(device, NULL); - } + const struct wined3d_gl_info *gl_info; + renderbuffer_entry_t *entry, *entry2; + struct wined3d_context *context; - ENTER_GL(); + context = context_acquire(This->resource.device, NULL); + gl_info = context->gl_info; - if (This->texture_name) - { - /* Release the OpenGL texture. */ - TRACE("Deleting texture %u.\n", This->texture_name); - glDeleteTextures(1, &This->texture_name); - } + ENTER_GL(); - if (This->Flags & SFLAG_PBO) - { - /* Delete the PBO. */ - GL_EXTCALL(glDeleteBuffersARB(1, &This->pbo)); - } + if (This->texture_name) + { + TRACE("Deleting texture %u.\n", This->texture_name); + glDeleteTextures(1, &This->texture_name); + } - LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry) - { - gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id); - HeapFree(GetProcessHeap(), 0, entry); - } + if (This->Flags & SFLAG_PBO) + { + TRACE("Deleting PBO %u.\n", This->pbo); + GL_EXTCALL(glDeleteBuffersARB(1, &This->pbo)); + } - LEAVE_GL(); + LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->renderbuffers, renderbuffer_entry_t, entry) + { + TRACE("Deleting renderbuffer %u.\n", entry->id); + gl_info->fbo_ops.glDeleteRenderbuffers(1, &entry->id); + HeapFree(GetProcessHeap(), 0, entry); + } + + LEAVE_GL(); + + context_release(context); + } if (This->Flags & SFLAG_DIBSECTION) { @@ -92,8 +90,6 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This) HeapFree(GetProcessHeap(), 0, This->palette9); resource_cleanup((IWineD3DResource *)This); - - if (context) context_release(context); } UINT surface_calculate_size(const struct wined3d_format_desc *format_desc, UINT alignment, UINT width, UINT height)
1
0
0
0
Henri Verbeet : wined3d: Cleanup Get/SetDepthStencilSurface().
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 43a86d1e56469418acbfe3c89434b50cbf924a25 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43a86d1e56469418acbfe3c89…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 4 11:10:25 2010 +0200 wined3d: Cleanup Get/SetDepthStencilSurface(). --- dlls/wined3d/device.c | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index f9e65d7..f4bce23 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5688,18 +5688,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetFrontBackBuffers(IWineD3DDevice *ifa return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice* iface, IWineD3DSurface **ppZStencilSurface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - *ppZStencilSurface = (IWineD3DSurface *)This->depth_stencil; - TRACE("(%p) : zStencilSurface returning %p\n", This, *ppZStencilSurface); +static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface **depth_stencil) +{ + IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface; - if(*ppZStencilSurface != NULL) { - /* Note inc ref on returned surface */ - IWineD3DSurface_AddRef(*ppZStencilSurface); - return WINED3D_OK; - } else { - return WINED3DERR_NOTFOUND; - } + TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil); + + *depth_stencil = (IWineD3DSurface *)device->depth_stencil; + TRACE("Returning depth/stencil surface %p.\n", *depth_stencil); + if (!*depth_stencil) return WINED3DERR_NOTFOUND; + IWineD3DSurface_AddRef(*depth_stencil); + + return WINED3D_OK; } static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, @@ -5765,13 +5765,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, return WINED3D_OK; } -static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface *pNewZStencil) { +static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface *depth_stencil) +{ IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DSurfaceImpl *tmp; - TRACE("device %p, depth_stencil %p, old depth_stencil %p.\n", This, pNewZStencil, This->depth_stencil); + TRACE("device %p, depth_stencil %p, old depth_stencil %p.\n", This, depth_stencil, This->depth_stencil); - if (This->depth_stencil == (IWineD3DSurfaceImpl *)pNewZStencil) + if (This->depth_stencil == (IWineD3DSurfaceImpl *)depth_stencil) { TRACE("Trying to do a NOP SetRenderTarget operation.\n"); return WINED3D_OK; @@ -5794,11 +5795,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice * } tmp = This->depth_stencil; - This->depth_stencil = (IWineD3DSurfaceImpl *)pNewZStencil; + This->depth_stencil = (IWineD3DSurfaceImpl *)depth_stencil; if (This->depth_stencil) IWineD3DSurface_AddRef((IWineD3DSurface *)This->depth_stencil); if (tmp) IWineD3DSurface_Release((IWineD3DSurface *)tmp); - if ((!tmp && pNewZStencil) || (!pNewZStencil && tmp)) + if ((!tmp && depth_stencil) || (!depth_stencil && tmp)) { /* Swapping NULL / non NULL depth stencil affects the depth and tests */ IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_ZENABLE));
1
0
0
0
Henri Verbeet : wined3d: Cleanup Get/SetRenderTarget().
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 009cd78fa448ede597ecae18df8878079ae1695e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=009cd78fa448ede597ecae18d…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 4 11:10:24 2010 +0200 wined3d: Cleanup Get/SetRenderTarget(). --- dlls/wined3d/device.c | 107 ++++++++++++++++++++++++++----------------------- 1 files changed, 57 insertions(+), 50 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index dabc451..f9e65d7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5571,21 +5571,25 @@ static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *ifac } /* rendertarget and depth stencil functions */ -static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD RenderTargetIndex, IWineD3DSurface **ppRenderTarget) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; +static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice *iface, + DWORD render_target_idx, IWineD3DSurface **render_target) +{ + IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface; - if (RenderTargetIndex >= This->adapter->gl_info.limits.buffers) + TRACE("iface %p, render_target_idx %u, render_target %p.\n", + iface, render_target_idx, render_target); + + if (render_target_idx >= device->adapter->gl_info.limits.buffers) { - ERR("(%p) : Only %d render targets are supported.\n", - This, This->adapter->gl_info.limits.buffers); + WARN("Only %u render targets are supported.\n", device->adapter->gl_info.limits.buffers); return WINED3DERR_INVALIDCALL; } - *ppRenderTarget = (IWineD3DSurface *)This->render_targets[RenderTargetIndex]; - TRACE("(%p) : RenderTarget %d Index returning %p\n", This, RenderTargetIndex, *ppRenderTarget); - /* Note inc ref on returned surface */ - if(*ppRenderTarget != NULL) - IWineD3DSurface_AddRef(*ppRenderTarget); + *render_target = (IWineD3DSurface *)device->render_targets[render_target_idx]; + if (*render_target) IWineD3DSurface_AddRef(*render_target); + + TRACE("Returning render target %p.\n", *render_target); + return WINED3D_OK; } @@ -5698,63 +5702,66 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice } } -static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget, - BOOL set_viewport) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; +static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, + DWORD render_target_idx, IWineD3DSurface *render_target, BOOL set_viewport) +{ + IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)iface; - TRACE("(%p) : Setting rendertarget %d to %p\n", This, RenderTargetIndex, pRenderTarget); + TRACE("iface %p, render_target_idx %u, render_target %p, set_viewport %#x.\n", + iface, render_target_idx, render_target, set_viewport); - if (RenderTargetIndex >= This->adapter->gl_info.limits.buffers) + if (render_target_idx >= device->adapter->gl_info.limits.buffers) { - WARN("(%p) : Unsupported target %u set, returning WINED3DERR_INVALIDCALL(only %u supported)\n", - This, RenderTargetIndex, This->adapter->gl_info.limits.buffers); + WARN("Only %u render targets are supported.\n", device->adapter->gl_info.limits.buffers); return WINED3DERR_INVALIDCALL; } + if (render_target == (IWineD3DSurface *)device->render_targets[render_target_idx]) + { + TRACE("Trying to do a NOP SetRenderTarget operation.\n"); + return WINED3D_OK; + } + /* Render target 0 can't be set to NULL. */ - if (!pRenderTarget && !RenderTargetIndex) + if (!render_target && !render_target_idx) { WARN("Trying to set render target 0 to NULL.\n"); return WINED3DERR_INVALIDCALL; } - if (pRenderTarget && !(((IWineD3DSurfaceImpl *)pRenderTarget)->resource.usage & WINED3DUSAGE_RENDERTARGET)) { - FIXME("(%p)Trying to set the render target to a surface(%p) that wasn't created with a usage of WINED3DUSAGE_RENDERTARGET\n",This ,pRenderTarget); + if (render_target && !(((IWineD3DSurfaceImpl *)render_target)->resource.usage & WINED3DUSAGE_RENDERTARGET)) + { + FIXME("Surface %p doesn't have render target usage.\n", render_target); return WINED3DERR_INVALIDCALL; } - /* If we are trying to set what we already have, don't bother */ - if (pRenderTarget == (IWineD3DSurface *)This->render_targets[RenderTargetIndex]) + if (render_target) + IWineD3DSurface_AddRef(render_target); + if (device->render_targets[render_target_idx]) + IWineD3DSurface_Release((IWineD3DSurface *)device->render_targets[render_target_idx]); + device->render_targets[render_target_idx] = (IWineD3DSurfaceImpl *)render_target; + + /* Render target 0 is special. */ + if (!render_target_idx && set_viewport) { - TRACE("Trying to do a NOP SetRenderTarget operation\n"); - return WINED3D_OK; - } - if (pRenderTarget) - IWineD3DSurface_AddRef(pRenderTarget); - if (This->render_targets[RenderTargetIndex]) - IWineD3DSurface_Release((IWineD3DSurface *)This->render_targets[RenderTargetIndex]); - This->render_targets[RenderTargetIndex] = (IWineD3DSurfaceImpl *)pRenderTarget; - - /* Render target 0 is special */ - if(RenderTargetIndex == 0 && set_viewport) { - /* Finally, reset the viewport and scissor rect as the MSDN states. - * Tests show that stateblock recording is ignored, the change goes - * directly into the primary stateblock. - */ - This->stateBlock->viewport.Height = This->render_targets[0]->currentDesc.Height; - This->stateBlock->viewport.Width = This->render_targets[0]->currentDesc.Width; - This->stateBlock->viewport.X = 0; - This->stateBlock->viewport.Y = 0; - This->stateBlock->viewport.MaxZ = 1.0f; - This->stateBlock->viewport.MinZ = 0.0f; - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_VIEWPORT); - - This->stateBlock->scissorRect.top = 0; - This->stateBlock->scissorRect.left = 0; - This->stateBlock->scissorRect.right = This->stateBlock->viewport.Width; - This->stateBlock->scissorRect.bottom = This->stateBlock->viewport.Height; - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SCISSORRECT); + /* Set the viewport and scissor rectangles, if requested. Tests show + * that stateblock recording is ignored, the change goes directly + * into the primary stateblock. */ + device->stateBlock->viewport.Height = device->render_targets[0]->currentDesc.Height; + device->stateBlock->viewport.Width = device->render_targets[0]->currentDesc.Width; + device->stateBlock->viewport.X = 0; + device->stateBlock->viewport.Y = 0; + device->stateBlock->viewport.MaxZ = 1.0f; + device->stateBlock->viewport.MinZ = 0.0f; + IWineD3DDeviceImpl_MarkStateDirty(device, STATE_VIEWPORT); + + device->stateBlock->scissorRect.top = 0; + device->stateBlock->scissorRect.left = 0; + device->stateBlock->scissorRect.right = device->stateBlock->viewport.Width; + device->stateBlock->scissorRect.bottom = device->stateBlock->viewport.Height; + IWineD3DDeviceImpl_MarkStateDirty(device, STATE_SCISSORRECT); } + return WINED3D_OK; }
1
0
0
0
Henri Verbeet : wined3d: Replace color_fill_fbo() with device_clear_render_targets().
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 6e30387f81235578e67afc54a8d6695f0413a8f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e30387f81235578e67afc54a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Aug 4 11:10:23 2010 +0200 wined3d: Replace color_fill_fbo() with device_clear_render_targets(). --- dlls/wined3d/device.c | 57 +++++++------------------------------------------ 1 files changed, 8 insertions(+), 49 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 3fcdd99..dabc451 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5485,51 +5485,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT return WINED3DERR_INVALIDCALL; } -static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface, - const WINED3DRECT *rect, const float color[4]) -{ - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; - struct wined3d_context *context; - - if (rect) surface_load_location(surface, SFLAG_INDRAWABLE, NULL); - surface_modify_location(surface, SFLAG_INDRAWABLE, TRUE); - - context = context_acquire(This, surface); - context_apply_clear_state(context, This, 1, &surface, NULL); - - ENTER_GL(); - - if (rect) - { - if (surface_is_offscreen(surface)) - glScissor(rect->x1, rect->y1, rect->x2 - rect->x1, rect->y2 - rect->y1); - else - glScissor(rect->x1, surface->currentDesc.Height - rect->y2, - rect->x2 - rect->x1, rect->y2 - rect->y1); - checkGLcall("glScissor"); - } - else - { - glDisable(GL_SCISSOR_TEST); - } - - glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE)); - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE1)); - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE2)); - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_RENDER(WINED3DRS_COLORWRITEENABLE3)); - - glClearColor(color[0], color[1], color[2], color[3]); - glClear(GL_COLOR_BUFFER_BIT); - checkGLcall("glClear"); - - LEAVE_GL(); - - if (wined3d_settings.strict_draw_ordering) wglFlush(); /* Flush to ensure ordering across contexts. */ - - context_release(context); -} - static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, const WINED3DRECT *pRect, WINED3DCOLOR color) { @@ -5545,9 +5500,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { const float c[4] = {D3DCOLOR_R(color), D3DCOLOR_G(color), D3DCOLOR_B(color), D3DCOLOR_A(color)}; - color_fill_fbo(iface, surface, pRect, c); - return WINED3D_OK; - } else { + + return device_clear_render_targets((IWineD3DDeviceImpl *)iface, 1, &surface, + !!pRect, pRect, WINED3DCLEAR_TARGET, c, 0.0f, 0); + } + else + { /* Just forward this to the DirectDraw blitting engine */ memset(&BltFx, 0, sizeof(BltFx)); BltFx.dwSize = sizeof(BltFx); @@ -5582,7 +5540,8 @@ static void WINAPI IWineD3DDeviceImpl_ClearRendertargetView(IWineD3DDevice *ifac if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { - color_fill_fbo(iface, surface, NULL, color); + device_clear_render_targets((IWineD3DDeviceImpl *)iface, 1, &surface, + 0, NULL, WINED3DCLEAR_TARGET, color, 0.0f, 0); } else {
1
0
0
0
Alexander Nicolaysen Sørnes : mshtml: Send more informative messages to OleInPlaceFrame.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: aa733bedd54be8c7ea7ea076ca208a5afbf831e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aa733bedd54be8c7ea7ea076c…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Fri Jul 30 21:56:05 2010 +0200 mshtml: Send more informative messages to OleInPlaceFrame. --- dlls/mshtml/En.rc | 6 +++++ dlls/mshtml/main.c | 49 ++++++++++++++++++++++++++++++++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/nsevents.c | 6 +--- dlls/mshtml/persist.c | 40 ++++++++++++++++++++------------- dlls/mshtml/resource.h | 4 +++ 6 files changed, 86 insertions(+), 20 deletions(-) diff --git a/dlls/mshtml/En.rc b/dlls/mshtml/En.rc index e44b373..ba55bf7 100644 --- a/dlls/mshtml/En.rc +++ b/dlls/mshtml/En.rc @@ -20,6 +20,12 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + STRINGTABLE + { + IDS_STATUS_DONE "Done" + IDS_STATUS_DOWNLOADINGFROM "Downloading from %s..." +} + STRINGTABLE { IDS_HTMLDISABLED "HTML rendering is currently disabled." diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c index f54c6e3..d61c1f4 100644 --- a/dlls/mshtml/main.c +++ b/dlls/mshtml/main.c @@ -40,6 +40,7 @@ #define INIT_GUID #include "mshtml_private.h" +#include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -48,6 +49,7 @@ DWORD mshtml_tls = TLS_OUT_OF_INDEXES; static HINSTANCE shdoclc = NULL; static HDC display_dc; +static LPWSTR status_strings[NUM_STATUS_STRINGS]; static void thread_detach(void) { @@ -63,6 +65,13 @@ static void thread_detach(void) heap_free(thread_data); } +void free_strings(void) +{ + int i; + for(i = 0; i < NUM_STATUS_STRINGS; i++) + heap_free(status_strings[i]); +} + static void process_detach(void) { close_gecko(); @@ -74,6 +83,46 @@ static void process_detach(void) TlsFree(mshtml_tls); if(display_dc) DeleteObject(display_dc); + + free_strings(); +} + +void set_statustext(HTMLDocumentObj* doc, INT id, LPCWSTR arg) +{ + int index = id - IDS_STATUS_DONE; + LPWSTR p = status_strings[index]; + + if(!doc->frame) + return; + + if(!p) + { + DWORD len = 255; + p = heap_alloc(len * sizeof(WCHAR)); + len = LoadStringW(hInst, id, p, len); + len++; + p = heap_realloc(p, len * sizeof(WCHAR)); + if(InterlockedCompareExchangePointer((void**)&status_strings[index], p, NULL)) + { + heap_free(p); + p = status_strings[index]; + } + } + + if(arg) + { + DWORD len = lstrlenW(p) + lstrlenW(arg) - 1; + LPWSTR buf = heap_alloc(len * sizeof(WCHAR)); + + snprintfW(buf, len - 1, p, arg); + + p = buf; + } + + IOleInPlaceFrame_SetStatusText(doc->frame, p); + + if(arg) + heap_free(p); } HINSTANCE get_shdoclc(void) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 2db2410..ee92806 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1024,5 +1024,6 @@ static inline void windowref_release(windowref_t *ref) HDC get_display_dc(void); HINSTANCE get_shdoclc(void); +void set_statustext(HTMLDocumentObj*,INT,LPCWSTR); extern HINSTANCE hInst; diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index 6da5ded..8dda1e5 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -34,6 +34,7 @@ #include "mshtml_private.h" #include "htmlevent.h" +#include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -239,10 +240,7 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event if(doc_obj->view_sink) IAdviseSink_OnViewChange(doc_obj->view_sink, DVASPECT_CONTENT, -1); - if(doc_obj->frame) { - static const WCHAR wszDone[] = {'D','o','n','e',0}; - IOleInPlaceFrame_SetStatusText(doc_obj->frame, wszDone); - } + set_statustext(doc_obj, IDS_STATUS_DONE, NULL); update_title(doc_obj); } diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 44ccd0f..76e3773 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -37,6 +37,7 @@ #include "mshtml_private.h" #include "htmlevent.h" +#include "resource.h" WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -44,6 +45,7 @@ typedef struct { task_t header; HTMLDocumentObj *doc; BOOL set_download; + LPOLESTR url; } download_proc_task_t; static BOOL use_gecko_script(LPCWSTR url) @@ -134,8 +136,8 @@ static void set_downloading_proc(task_t *_task) TRACE("(%p)\n", doc); - if(doc->frame) - IOleInPlaceFrame_SetStatusText(doc->frame, NULL /* FIXME */); + set_statustext(doc, IDS_STATUS_DOWNLOADINGFROM, task->url); + CoTaskMemFree(task->url); if(!doc->client) return; @@ -243,26 +245,31 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel } hres = create_doc_uri(This->window, url, &nsuri); - CoTaskMemFree(url); - if(FAILED(hres)) - return hres; - if(async_bsc) { - bscallback = async_bsc; - }else { - hres = create_channelbsc(mon, NULL, NULL, 0, &bscallback); - if(FAILED(hres)) - return hres; + if(SUCCEEDED(hres)) + { + if(async_bsc) { + bscallback = async_bsc; + }else { + hres = create_channelbsc(mon, NULL, NULL, 0, &bscallback); + } } - hres = load_nsuri(This->window, nsuri, bscallback, LOAD_INITIAL_DOCUMENT_URI); - nsISupports_Release((nsISupports*)nsuri); /* FIXME */ if(SUCCEEDED(hres)) - set_window_bscallback(This->window, bscallback); - if(bscallback != async_bsc) - IUnknown_Release((IUnknown*)bscallback); + { + hres = load_nsuri(This->window, nsuri, bscallback, LOAD_INITIAL_DOCUMENT_URI); + nsISupports_Release((nsISupports*)nsuri); /* FIXME */ + if(SUCCEEDED(hres)) + set_window_bscallback(This->window, bscallback); + if(bscallback != async_bsc) + IUnknown_Release((IUnknown*)bscallback); + } + if(FAILED(hres)) + { + CoTaskMemFree(url); return hres; + } HTMLDocument_LockContainer(This->doc_obj, TRUE); @@ -275,6 +282,7 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel download_task = heap_alloc(sizeof(download_proc_task_t)); download_task->doc = This->doc_obj; download_task->set_download = set_download; + download_task->url = url; push_task(&download_task->header, set_downloading_proc, This->doc_obj->basedoc.task_magic); return S_OK; diff --git a/dlls/mshtml/resource.h b/dlls/mshtml/resource.h index 1e92637..fd69bfd 100644 --- a/dlls/mshtml/resource.h +++ b/dlls/mshtml/resource.h @@ -25,6 +25,10 @@ #define IDS_DOWNLOADING 7502 #define IDS_INSTALLING 7503 +#define NUM_STATUS_STRINGS 2 +#define IDS_STATUS_DOWNLOADINGFROM 7550 +#define IDS_STATUS_DONE 7551 + #define ID_DWL_DIALOG 7600 #define ID_DWL_PROGRESS 7601 #define ID_DWL_INSTALL 7602
1
0
0
0
Misha Koshelev : d3dx9: Add stub and tests for D3DXCreateMesh.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: bf46b4fdfc7deb51be27bae14cce794ffb4d068e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bf46b4fdfc7deb51be27bae14…
Author: Misha Koshelev <misha680(a)gmail.com> Date: Mon Aug 2 13:26:35 2010 -0500 d3dx9: Add stub and tests for D3DXCreateMesh. --- dlls/d3dx9_36/d3dx9_36.spec | 2 +- dlls/d3dx9_36/mesh.c | 8 +++ dlls/d3dx9_36/tests/mesh.c | 139 +++++++++++++++++++++++++++++++++++++++++++ include/d3dx9mesh.h | 1 + 4 files changed, 149 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec index 622a03c..616b8a4 100644 --- a/dlls/d3dx9_36/d3dx9_36.spec +++ b/dlls/d3dx9_36/d3dx9_36.spec @@ -71,7 +71,7 @@ @ stub D3DXCreateKeyframedAnimationSet @ stdcall D3DXCreateLine(ptr ptr) @ stdcall D3DXCreateMatrixStack(long ptr) -@ stub D3DXCreateMesh +@ stdcall D3DXCreateMesh(long long long ptr ptr ptr) @ stub D3DXCreateMeshFVF @ stub D3DXCreateNPatchMesh @ stub D3DXCreatePMeshFromStream diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c index bfa1c23..df453f7 100644 --- a/dlls/d3dx9_36/mesh.c +++ b/dlls/d3dx9_36/mesh.c @@ -328,6 +328,14 @@ BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST return TRUE; } +HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, CONST LPD3DVERTEXELEMENT9 *declaration, + LPDIRECT3DDEVICE9 device, LPD3DXMESH *mesh) +{ + FIXME("(%d, %d, %d, %p, %p, %p): stub\n", numfaces, numvertices, options, declaration, device, mesh); + + return E_NOTIMPL; +} + HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device, FLOAT width, FLOAT height, FLOAT depth, LPD3DXMESH* mesh, LPD3DXBUFFER* adjacency) { diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index 87003d1..3920041 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -667,6 +667,144 @@ static void D3DXIntersectTriTest(void) ok( got_res == exp_res, "Expected result = %d, got %d\n",exp_res,got_res); } +static void D3DXCreateMeshTest(void) +{ + HRESULT hr; + HWND wnd; + IDirect3D9 *d3d; + IDirect3DDevice9 *device, *test_device; + D3DPRESENT_PARAMETERS d3dpp; + ID3DXMesh *d3dxmesh; + int i, size; + D3DVERTEXELEMENT9 test_decl[MAX_FVF_DECL_SIZE]; + DWORD fvf, options; + struct mesh mesh; + + static const D3DVERTEXELEMENT9 decl[3] = { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 0xC, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0}, + D3DDECL_END(), }; + + hr = D3DXCreateMesh(0, 0, 0, NULL, NULL, NULL); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateMesh(1, 3, D3DXMESH_MANAGED, (LPD3DVERTEXELEMENT9 *)&decl, NULL, &d3dxmesh); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + if (!wnd) + { + skip("Couldn't create application window\n"); + return; + } + d3d = Direct3DCreate9(D3D_SDK_VERSION); + if (!d3d) + { + skip("Couldn't create IDirect3D9 object\n"); + DestroyWindow(wnd); + return; + } + + ZeroMemory(&d3dpp, sizeof(d3dpp)); + d3dpp.Windowed = TRUE; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &device); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#x\n", hr); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); + return; + } + + hr = D3DXCreateMesh(0, 3, D3DXMESH_MANAGED, (LPD3DVERTEXELEMENT9 *)&decl, device, &d3dxmesh); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateMesh(1, 0, D3DXMESH_MANAGED, (LPD3DVERTEXELEMENT9 *)&decl, device, &d3dxmesh); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateMesh(1, 3, 0, (LPD3DVERTEXELEMENT9 *)&decl, device, &d3dxmesh); + todo_wine ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + + if (hr == D3D_OK) + { + d3dxmesh->lpVtbl->Release(d3dxmesh); + } + + hr = D3DXCreateMesh(1, 3, D3DXMESH_MANAGED, 0, device, &d3dxmesh); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateMesh(1, 3, D3DXMESH_MANAGED, (LPD3DVERTEXELEMENT9 *)&decl, device, NULL); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateMesh(1, 3, D3DXMESH_MANAGED, (LPD3DVERTEXELEMENT9 *)&decl, device, &d3dxmesh); + todo_wine ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr); + + if (hr == D3D_OK) + { + /* device */ + hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = d3dxmesh->lpVtbl->GetDevice(d3dxmesh, &test_device); + ok(hr == D3D_OK, "Got result %x, expected %x (D3D_OK)\n", hr, D3D_OK); + ok(test_device == device, "Got result %p, expected %p\n", test_device, device); + + if (hr == D3D_OK) + { + IDirect3DDevice9_Release(device); + } + + /* declaration */ + hr = d3dxmesh->lpVtbl->GetDeclaration(d3dxmesh, test_decl); + ok(hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n", hr); + + if (hr == D3D_OK) + { + size = sizeof(decl) / sizeof(decl[0]); + for (i = 0; i < size - 1; i++) + { + ok(test_decl[i].Stream == decl[i].Stream, "Returned stream %d, expected %d\n", test_decl[i].Stream, decl[i].Stream); + ok(test_decl[i].Type == decl[i].Type, "Returned type %d, expected %d\n", test_decl[i].Type, decl[i].Type); + ok(test_decl[i].Method == decl[i].Method, "Returned method %d, expected %d\n", test_decl[i].Method, decl[i].Method); + ok(test_decl[i].Usage == decl[i].Usage, "Returned usage %d, expected %d\n", test_decl[i].Usage, decl[i].Usage); + ok(test_decl[i].UsageIndex == decl[i].UsageIndex, "Returned usage index %d, expected %d\n", test_decl[i].UsageIndex, decl[i].UsageIndex); + ok(test_decl[i].Offset == decl[i].Offset, "Returned offset %d, expected %d\n", decl[1].Offset, decl[i].Offset); + } + ok(decl[size-1].Stream == 0xFF, "Returned too long vertex declaration\n"); /* end element */ + } + + /* FVF */ + fvf = d3dxmesh->lpVtbl->GetFVF(d3dxmesh); + ok(fvf == (D3DFVF_XYZ | D3DFVF_NORMAL), "Got result %x, expected %x (D3DFVF_XYZ | D3DFVF_NORMAL)\n", fvf, D3DFVF_XYZ | D3DFVF_NORMAL); + + /* options */ + options = d3dxmesh->lpVtbl->GetOptions(d3dxmesh); + ok(options == D3DXMESH_MANAGED, "Got result %x, expected %x (D3DXMESH_MANAGED)\n", options, D3DXMESH_MANAGED); + + /* rest */ + if (!new_mesh(&mesh, 3, 1)) + { + skip("Couldn't create mesh\n"); + } + else + { + memset(mesh.vertices, 0, mesh.number_of_vertices * sizeof(*mesh.vertices)); + memset(mesh.faces, 0, mesh.number_of_faces * sizeof(*mesh.faces)); + + compare_mesh("createmeshfvf", d3dxmesh, &mesh); + + free_mesh(&mesh); + } + + d3dxmesh->lpVtbl->Release(d3dxmesh); + } + + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); +} + struct sincos_table { float *sin; @@ -1031,6 +1169,7 @@ START_TEST(mesh) D3DXDeclaratorFromFVFTest(); D3DXGetFVFVertexSizeTest(); D3DXIntersectTriTest(); + D3DXCreateMeshTest(); D3DXCreateSphereTest(); test_get_decl_vertex_size(); } diff --git a/include/d3dx9mesh.h b/include/d3dx9mesh.h index 20d285c..063a587 100644 --- a/include/d3dx9mesh.h +++ b/include/d3dx9mesh.h @@ -150,6 +150,7 @@ DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) extern "C" { #endif +HRESULT WINAPI D3DXCreateMesh(DWORD, DWORD, DWORD, CONST LPD3DVERTEXELEMENT9 *, LPDIRECT3DDEVICE9, LPD3DXMESH *); HRESULT WINAPI D3DXCreateBuffer(DWORD, LPD3DXBUFFER*); UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx); UINT WINAPI D3DXGetFVFVertexSize(DWORD);
1
0
0
0
Misha Koshelev : d3dx9: Add _D3DXMESH enumeration.
by Alexandre Julliard
04 Aug '10
04 Aug '10
Module: wine Branch: master Commit: 995c653d1121adf7db916020ea172319782682e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=995c653d1121adf7db916020e…
Author: Misha Koshelev <misha680(a)gmail.com> Date: Mon Aug 2 13:26:30 2010 -0500 d3dx9: Add _D3DXMESH enumeration. --- include/d3dx9mesh.h | 26 ++++++++++++++++++++++++++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/include/d3dx9mesh.h b/include/d3dx9mesh.h index 5773d24..20d285c 100644 --- a/include/d3dx9mesh.h +++ b/include/d3dx9mesh.h @@ -30,6 +30,32 @@ enum _MAX_FVF_DECL_SIZE MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 }; +enum _D3DXMESH +{ + D3DXMESH_32BIT = 0x001, + D3DXMESH_DONOTCLIP = 0x002, + D3DXMESH_POINTS = 0x004, + D3DXMESH_RTPATCHES = 0x008, + D3DXMESH_NPATCHES = 0x4000, + D3DXMESH_VB_SYSTEMMEM = 0x010, + D3DXMESH_VB_MANAGED = 0x020, + D3DXMESH_VB_WRITEONLY = 0x040, + D3DXMESH_VB_DYNAMIC = 0x080, + D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, + D3DXMESH_IB_SYSTEMMEM = 0x100, + D3DXMESH_IB_MANAGED = 0x200, + D3DXMESH_IB_WRITEONLY = 0x400, + D3DXMESH_IB_DYNAMIC = 0x800, + D3DXMESH_IB_SOFTWAREPROCESSING = 0x10000, + D3DXMESH_VB_SHARE = 0x1000, + D3DXMESH_USEHWONLY = 0x2000, + D3DXMESH_SYSTEMMEM = 0x110, + D3DXMESH_MANAGED = 0x220, + D3DXMESH_WRITEONLY = 0x440, + D3DXMESH_DYNAMIC = 0x880, + D3DXMESH_SOFTWAREPROCESSING = 0x18000 +}; + typedef struct ID3DXBaseMesh* LPD3DXBASEMESH; typedef struct ID3DXMesh* LPD3DXMESH;
1
0
0
0
← Newer
1
...
71
72
73
74
75
76
77
...
89
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Results per page:
10
25
50
100
200