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
July
June
May
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
November 2011
----- 2025 -----
July 2025
June 2025
May 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
852 discussions
Start a n
N
ew thread
Aric Stewart : usp10: Properly set LayoutRTL.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 7868be6e707404229ca7eedea743d280d146995b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7868be6e707404229ca7eedea…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Nov 14 13:18:02 2011 -0700 usp10: Properly set LayoutRTL. --- dlls/usp10/tests/usp10.c | 10 +++++----- dlls/usp10/usp10.c | 19 ++++++++++++++++--- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index a6e75a1..0718451 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -148,13 +148,13 @@ static void test_ScriptItemize( void ) static const WCHAR test1c[] = {' ', ' ', ' ', '1', '2', ' ',0}; static const itemTest t1c1[2] = {{{0,0,0,0,0},0,0,0,0,0},{{0,0,0,0,0},6,0,0,0,-1}}; - static const itemTest t1c2[4] = {{{0,0,0,0,0},0,1,1,1,0},{{0,0,1,0,0},3,0,1,2,0},{{0,0,0,0,0},5,1,1,1,0},{{0,0,0,0,0},6,0,0,0,-1}}; + static const itemTest t1c2[4] = {{{0,0,0,0,0},0,1,1,1,0},{{0,0,0,0,0},3,0,1,2,0},{{0,0,0,0,0},5,1,1,1,0},{{0,0,0,0,0},6,0,0,0,-1}}; /* Arabic, English*/ static const WCHAR test2[] = {'1','2','3','-','5','2',0x064a,0x064f,0x0633,0x0627,0x0648,0x0650,0x064a,'7','1','.',0}; static const itemTest t21[7] = {{{0,0,0,0,0},0,0,0,0,0},{{0,0,0,0,0},3,0,0,0,0},{{0,0,0,0,0},4,0,0,0,0},{{0,0,0,0,0},6,1,1,1,arab_tag},{{0,0,0,0,0},13,0,0,0,0},{{0,0,0,0,0},15,0,0,0,0},{{0,0,0,0,0},16,0,0,0,-1}}; - static const itemTest t22[5] = {{{0,0,0,0,0},0,0,0,2,0},{{0,0,0,0,0},6,1,1,1,arab_tag},{{0,0,1,0,0},13,0,1,2,0},{{0,0,0,0,0},15,0,0,0,0},{{0,0,0,0,0},16,0,0,0,-1}}; - static const itemTest t23[5] = {{{0,0,1,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,arab_tag},{{0,0,1,0,0},13,0,1,2,0},{{0,0,0,0,0},15,1,1,1,0},{{0,0,0,0,0},16,0,0,0,-1}}; + static const itemTest t22[5] = {{{0,0,0,0,0},0,0,0,2,0},{{0,0,0,0,0},6,1,1,1,arab_tag},{{0,0,0,0,0},13,0,1,2,0},{{0,0,0,0,0},15,0,0,0,0},{{0,0,0,0,0},16,0,0,0,-1}}; + static const itemTest t23[5] = {{{0,0,0,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,arab_tag},{{0,0,0,0,0},13,0,1,2,0},{{0,0,0,0,0},15,1,1,1,0},{{0,0,0,0,0},16,0,0,0,-1}}; static const WCHAR test2b[] = {'A','B','C','-','D','E','F',' ',0x0621,0x0623,0x0624,0}; static const itemTest t2b1[5] = {{{0,0,0,0,0},0,0,0,0,latn_tag},{{0,0,0,0,0},3,0,0,0,0},{{0,0,0,0,0},4,0,0,0,latn_tag},{{0,0,0,0,0},8,1,1,1,arab_tag},{{0,0,0,0,0},11,0,0,0,-1}}; @@ -188,8 +188,8 @@ static void test_ScriptItemize( void ) static const WCHAR test4[] = {'1','2','3','-','5','2',' ','i','s',' ','7','1','.',0}; static const itemTest t41[6] = {{{0,0,0,0,0},0,0,0,0,0},{{0,0,0,0,0},3,0,0,0,0},{{0,0,0,0,0},4,0,0,0,0},{{0,0,0,0,0},7,0,0,0,latn_tag},{{0,0,0,0,0},10,0,0,0,0},{{0,0,0,0,0},12,0,0,0,-1}}; - static const itemTest t42[5] = {{{0,0,1,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,0},{{0,0,0,0,0},7,0,0,2,latn_tag},{{0,0,0,0,0},10,0,0,2,0},{{0,0,0,0,0},12,0,0,0,-1}}; - static const itemTest t43[4] = {{{0,0,1,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,0},{{0,0,0,0,0},7,0,0,2,latn_tag},{{0,0,0,0,0},12,0,0,0,-1}}; + static const itemTest t42[5] = {{{0,0,0,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,0},{{0,0,0,0,0},7,0,0,2,latn_tag},{{0,0,0,0,0},10,0,0,2,0},{{0,0,0,0,0},12,0,0,0,-1}}; + static const itemTest t43[4] = {{{0,0,0,0,0},0,0,1,2,0},{{0,0,0,0,0},6,1,1,1,0},{{0,0,0,0,0},7,0,0,2,latn_tag},{{0,0,0,0,0},12,0,0,0,-1}}; /* Arabic */ static const WCHAR test5[] = diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 94c49fe..589711d 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -814,6 +814,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int WORD baselevel = 0; BOOL new_run; WORD last_indic = -1; + WORD layoutRTL = 0; TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); @@ -948,12 +949,14 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int if (levels) { + layoutRTL = (psState->uBidiLevel || odd(levels[cnt]))?1:0; pItems[index].a.fRTL = odd(levels[cnt]); - pItems[index].a.fLayoutRTL = odd(levels[cnt]); + pItems[index].a.fLayoutRTL = layoutRTL; pItems[index].a.s.uBidiLevel = levels[cnt]; } else if (!pItems[index].a.s.uBidiLevel) { + layoutRTL = (odd(baselevel))?1:0; pItems[index].a.s.uBidiLevel = baselevel; pItems[index].a.fLayoutRTL = odd(baselevel); pItems[index].a.fRTL = odd(baselevel); @@ -1005,6 +1008,12 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int new_run = TRUE; } + if (!new_run && strength && str == BIDI_STRONG) + { + layoutRTL = odd(levels[cnt])?1:0; + pItems[index].a.fLayoutRTL = layoutRTL; + } + if (new_run) { TRACE("New_Level = %i, New_Strength = %i, New_Script=%d, eScript=%d\n", levels?levels[cnt]:-1, strength?strength[cnt]:str, New_Script, pItems[index].a.eScript); @@ -1023,14 +1032,18 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int pScriptTags[index] = scriptInformation[New_Script].scriptTag; if (levels) { + if (levels[cnt] == 0) + layoutRTL = 0; + else + layoutRTL = (layoutRTL || odd(levels[cnt]))?1:0; pItems[index].a.fRTL = odd(levels[cnt]); - pItems[index].a.fLayoutRTL = odd(levels[cnt]); + pItems[index].a.fLayoutRTL = layoutRTL; pItems[index].a.s.uBidiLevel = levels[cnt]; } else if (!pItems[index].a.s.uBidiLevel) { pItems[index].a.s.uBidiLevel = baselevel; - pItems[index].a.fLayoutRTL = odd(baselevel); + pItems[index].a.fLayoutRTL = layoutRTL; pItems[index].a.fRTL = odd(baselevel); }
1
0
0
0
Aric Stewart : usp10: Devanagari danda and double danda are used for all Indic scripts.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: e5d33f08c7282935c2c5315b1fa8eb154eedbf0b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5d33f08c7282935c2c5315b1…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Tue Nov 15 11:02:31 2011 -0700 usp10: Devanagari danda and double danda are used for all Indic scripts. --- dlls/usp10/usp10.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 50e8471..94c49fe 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -772,6 +772,11 @@ HRESULT WINAPI ScriptApplyDigitSubstitution(const SCRIPT_DIGITSUBSTITUTE *sds, } } +static inline BOOL is_indic(WORD script) +{ + return (script >= Script_Devanagari && script <= Script_Malayalam_Numeric); +} + /*********************************************************************** * ScriptItemizeOpenType (USP10.@) * @@ -808,6 +813,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int WORD *scripts = NULL; WORD baselevel = 0; BOOL new_run; + WORD last_indic = -1; TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); @@ -820,7 +826,15 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int return E_OUTOFMEMORY; for (i = 0; i < cInChars; i++) + { scripts[i] = get_char_script(pwcInChars[i]); + /* Devanagari danda (U+0964) and double danda (U+0965) are used for + all Indic scripts */ + if ((pwcInChars[i] == 0x964 || pwcInChars[i] ==0x965) && last_indic > 0) + scripts[i] = last_indic; + else if (is_indic(scripts[i])) + last_indic = scripts[i]; + } if (psState && psControl) {
1
0
0
0
Aric Stewart : usp10: Pay attention to script changes for bidi run itemization.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 6c3398d9574e449628bfdaf250661104935db7a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6c3398d9574e449628bfdaf25…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Nov 14 13:17:37 2011 -0700 usp10: Pay attention to script changes for bidi run itemization. --- dlls/usp10/usp10.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 0ffab66..50e8471 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -859,7 +859,10 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int for (i = 0; i < cInChars; i++) { if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && inNumber && strchrW(math_punc,pwcInChars[i])) + { + scripts[i] = Script_Numeric; levels[i] = 2; + } else if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && scripts[i] == Script_Numeric) { levels[i] = 2; @@ -982,7 +985,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int new_run = TRUE; } /* changes in script */ - else if ((!levels) && (((pwcInChars[cnt] != Numeric_space) && (New_Script != -1) && (New_Script != pItems[index].a.eScript)) || (New_Script == Script_Control))) + else if (((pwcInChars[cnt] != Numeric_space) && (New_Script != -1) && (New_Script != pItems[index].a.eScript)) || (New_Script == Script_Control)) { TRACE("Script break(%i/%i)\n",pItems[index].a.eScript,New_Script); new_run = TRUE;
1
0
0
0
Aric Stewart : usp10: Merge neutral scripts.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 145102c7fdd5968afa3a16135ed8478a2e642714 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=145102c7fdd5968afa3a16135…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Nov 14 13:17:25 2011 -0700 usp10: Merge neutral scripts. --- dlls/usp10/usp10.c | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index f297125..0ffab66 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -870,8 +870,41 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int } if (psControl->fMergeNeutralItems) { - HeapFree(GetProcessHeap(),0,strength); - strength = NULL; + /* Merge the neutrals */ + for (i = 0; i < cInChars; i++) + { + if (strength[i] == BIDI_NEUTRAL || strength[i] == BIDI_WEAK) + { + int j; + for (j = i; j > 0; j--) + { + if (levels[i] != levels[j]) + break; + if ((strength[j] == BIDI_STRONG) || (strength[i] == BIDI_NEUTRAL && strength[j] == BIDI_WEAK)) + { + scripts[i] = scripts[j]; + strength[i] = strength[j]; + break; + } + } + } + /* Try going the other way */ + if (strength[i] == BIDI_NEUTRAL || strength[i] == BIDI_WEAK) + { + int j; + for (j = i; j < cInChars; j++) + { + if (levels[i] != levels[j]) + break; + if ((strength[j] == BIDI_STRONG) || (strength[i] == BIDI_NEUTRAL && strength[j] == BIDI_WEAK)) + { + scripts[i] = scripts[j]; + strength[i] = strength[j]; + break; + } + } + } + } } } }
1
0
0
0
Aric Stewart : usp10: Move scripts to an array initialized once to minimize get_char_script calls .
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 3767cebc8846529d1dbf8b16d6959f128dd2450a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3767cebc8846529d1dbf8b16d…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Nov 14 13:17:11 2011 -0700 usp10: Move scripts to an array initialized once to minimize get_char_script calls. --- dlls/usp10/usp10.c | 29 +++++++++++++++++++++-------- 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 0496a56..f297125 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -802,8 +802,10 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int int cnt = 0, index = 0, str = 0; int New_Script = -1; + int i; WORD *levels = NULL; WORD *strength = NULL; + WORD *scripts = NULL; WORD baselevel = 0; BOOL new_run; @@ -813,12 +815,21 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int if (!pwcInChars || !cInChars || !pItems || cMaxItems < 2) return E_INVALIDARG; + scripts = heap_alloc(cInChars * sizeof(WORD)); + if (!scripts) + return E_OUTOFMEMORY; + + for (i = 0; i < cInChars; i++) + scripts[i] = get_char_script(pwcInChars[i]); + if (psState && psControl) { - int i; levels = heap_alloc_zero(cInChars * sizeof(WORD)); if (!levels) + { + heap_free(scripts); return E_OUTOFMEMORY; + } BIDI_DetermineLevels(pwcInChars, cInChars, psState, psControl, levels); baselevel = levels[0]; @@ -838,6 +849,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int strength = heap_alloc_zero(cInChars * sizeof(WORD)); if (!strength) { + heap_free(scripts); heap_free(levels); return E_OUTOFMEMORY; } @@ -848,7 +860,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int { if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && inNumber && strchrW(math_punc,pwcInChars[i])) levels[i] = 2; - else if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && get_char_script(pwcInChars[i]) == Script_Numeric) + else if ((levels[i] == 0 || (odd(psState->uBidiLevel) && levels[i] == psState->uBidiLevel+1)) && scripts[i] == Script_Numeric) { levels[i] = 2; inNumber = TRUE; @@ -870,12 +882,12 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int if (cnt == cInChars) /* All Spaces */ { cnt = 0; - New_Script = get_char_script(pwcInChars[cnt]); + New_Script = scripts[cnt]; } pItems[index].iCharPos = 0; - pItems[index].a = scriptInformation[get_char_script(pwcInChars[cnt])].a; - pScriptTags[index] = scriptInformation[get_char_script(pwcInChars[cnt])].scriptTag; + pItems[index].a = scriptInformation[scripts[cnt]].a; + pScriptTags[index] = scriptInformation[scripts[cnt]].scriptTag; if (strength && strength[cnt] == BIDI_STRONG) str = strength[cnt]; @@ -904,16 +916,16 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int for (cnt=1; cnt < cInChars; cnt++) { if(pwcInChars[cnt] != Numeric_space && pwcInChars[cnt] != ZWJ && pwcInChars[cnt] != ZWNJ) - New_Script = get_char_script(pwcInChars[cnt]); + New_Script = scripts[cnt]; else if (levels) { int j = 1; while (cnt + j < cInChars - 1 && (pwcInChars[cnt+j] == Numeric_space || pwcInChars[cnt+j] == ZWJ || pwcInChars[cnt+j] == ZWNJ) && levels[cnt] == levels[cnt+j]) j++; if (cnt + j < cInChars && levels[cnt] == levels[cnt+j]) - New_Script = get_char_script(pwcInChars[cnt+j]); + New_Script = scripts[cnt+j]; else - New_Script = get_char_script(pwcInChars[cnt]); + New_Script = scripts[cnt]; } new_run = FALSE; @@ -992,6 +1004,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int pItems[index].iCharPos = cnt; /* the last item contains the ptr to the lastchar */ heap_free(levels); heap_free(strength); + heap_free(scripts); return S_OK; }
1
0
0
0
Aric Stewart : usp10: Break with a better understanding on the handling of bidi strengths.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 9c9513f94a632241ed7be0e9bd724696ed677d3c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c9513f94a632241ed7be0e9b…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Nov 14 13:16:59 2011 -0700 usp10: Break with a better understanding on the handling of bidi strengths. --- dlls/usp10/bidi.c | 10 ++++++-- dlls/usp10/usp10.c | 44 +++++++++++++++++++++++++++++++++++------- dlls/usp10/usp10_internal.h | 3 ++ 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/dlls/usp10/bidi.c b/dlls/usp10/bidi.c index 9c3942c..a2edfa6 100644 --- a/dlls/usp10/bidi.c +++ b/dlls/usp10/bidi.c @@ -901,7 +901,7 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, case AL: case RLE: case RLO: - lpStrength[i] = 1; + lpStrength[i] = BIDI_STRONG; break; case PDF: case EN: @@ -910,10 +910,14 @@ BOOL BIDI_GetStrengths(LPCWSTR lpString, INT uCount, const SCRIPT_CONTROL *c, case AN: case CS: case BN: - lpStrength[i] = 2; + lpStrength[i] = BIDI_WEAK; break; + case B: + case S: + case WS: + case ON: default: /* Neutrals and NSM */ - lpStrength[i] = 0; + lpStrength[i] = BIDI_NEUTRAL; } } return TRUE; diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 4ac7b8f..0496a56 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -805,6 +805,7 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int WORD *levels = NULL; WORD *strength = NULL; WORD baselevel = 0; + BOOL new_run; TRACE("%s,%d,%d,%p,%p,%p,%p\n", debugstr_wn(pwcInChars, cInChars), cInChars, cMaxItems, psControl, psState, pItems, pcItems); @@ -876,10 +877,13 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int pItems[index].a = scriptInformation[get_char_script(pwcInChars[cnt])].a; pScriptTags[index] = scriptInformation[get_char_script(pwcInChars[cnt])].scriptTag; - if (strength) + if (strength && strength[cnt] == BIDI_STRONG) str = strength[cnt]; + else if (strength) + str = strength[0]; cnt = 0; + if (levels) { pItems[index].a.fRTL = odd(levels[cnt]); @@ -899,9 +903,6 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int for (cnt=1; cnt < cInChars; cnt++) { - if (levels && (levels[cnt] == pItems[index].a.s.uBidiLevel && (!strength || (strength[cnt] == 0 || strength[cnt] == str)))) - continue; - if(pwcInChars[cnt] != Numeric_space && pwcInChars[cnt] != ZWJ && pwcInChars[cnt] != ZWNJ) New_Script = get_char_script(pwcInChars[cnt]); else if (levels) @@ -915,17 +916,44 @@ HRESULT WINAPI ScriptItemizeOpenType(const WCHAR *pwcInChars, int cInChars, int New_Script = get_char_script(pwcInChars[cnt]); } - if ((levels && (levels[cnt] != pItems[index].a.s.uBidiLevel || (strength && (strength[cnt] != str)))) || (New_Script != -1 && New_Script != pItems[index].a.eScript) || New_Script == Script_Control) + new_run = FALSE; + /* merge space strengths*/ + if (strength && strength[cnt] == BIDI_STRONG && str != BIDI_STRONG && New_Script == pItems[index].a.eScript) + str = BIDI_STRONG; + + if (strength && strength[cnt] == BIDI_NEUTRAL && str == BIDI_STRONG && pwcInChars[cnt] != Numeric_space && New_Script == pItems[index].a.eScript) + str = BIDI_NEUTRAL; + + /* changes in level */ + if (levels && (levels[cnt] != pItems[index].a.s.uBidiLevel)) { - TRACE("New_Level = %i, New_Strength = %i, New_Script=%d, eScript=%d\n", levels?levels[cnt]:-1, strength?strength[cnt]:str, New_Script, pItems[index].a.eScript); + TRACE("Level break(%i/%i)\n",pItems[index].a.s.uBidiLevel,levels[cnt]); + new_run = TRUE; + } + /* changes in strength */ + else if (strength && pwcInChars[cnt] != Numeric_space && str != strength[cnt]) + { + TRACE("Strength break (%i/%i)\n",str,strength[cnt]); + new_run = TRUE; + } + /* changes in script */ + else if ((!levels) && (((pwcInChars[cnt] != Numeric_space) && (New_Script != -1) && (New_Script != pItems[index].a.eScript)) || (New_Script == Script_Control))) + { + TRACE("Script break(%i/%i)\n",pItems[index].a.eScript,New_Script); + new_run = TRUE; + } - if (strength && strength[cnt] != 0) - str = strength[cnt]; + if (new_run) + { + TRACE("New_Level = %i, New_Strength = %i, New_Script=%d, eScript=%d\n", levels?levels[cnt]:-1, strength?strength[cnt]:str, New_Script, pItems[index].a.eScript); index++; if (index+1 > cMaxItems) return E_OUTOFMEMORY; + if (strength) + str = strength[cnt]; + pItems[index].iCharPos = cnt; memset(&pItems[index].a, 0, sizeof(SCRIPT_ANALYSIS)); diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 7a88ac7..9f13b40 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -122,6 +122,9 @@ typedef int (*lexical_function)(WCHAR c); typedef void (*reorder_function)(LPWSTR pwChar, IndicSyllable *syllable, lexical_function lex); #define odd(x) ((x) & 1) +#define BIDI_STRONG 1 +#define BIDI_WEAK 2 +#define BIDI_NEUTRAL 0 BOOL BIDI_DetermineLevels( LPCWSTR lpString, INT uCount, const SCRIPT_STATE *s, const SCRIPT_CONTROL *c, WORD *lpOutLevels ) DECLSPEC_HIDDEN;
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DSHADER_PARAM_DSTMOD_TYPE typedef.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: e43a185c173eb2705f077052d326a88cc5eef5fe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e43a185c173eb2705f077052d…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Nov 14 21:11:43 2011 +0100 wined3d: Get rid of the WINED3DSHADER_PARAM_DSTMOD_TYPE typedef. --- dlls/wined3d/wined3d_private.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 460c911..b8f3e84 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -348,13 +348,13 @@ enum wined3d_shader_src_modifier #define WINED3DSP_WRITEMASK_3 0x8 /* .w a */ #define WINED3DSP_WRITEMASK_ALL 0xf /* all */ -typedef enum _WINED3DSHADER_PARAM_DSTMOD_TYPE +enum wined3d_shader_dst_modifier { WINED3DSPDM_NONE = 0, WINED3DSPDM_SATURATE = 1, WINED3DSPDM_PARTIALPRECISION = 2, WINED3DSPDM_MSAMPCENTROID = 4, -} WINED3DSHADER_PARAM_DSTMOD_TYPE; +}; /* Undocumented opcode control to identify projective texture lookups in ps 2.0 and later */ #define WINED3DSI_TEXLD_PROJECT 1
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DSHADER_PARAM_SRCMOD_TYPE typedef.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 563edce2fa6d116c94598fb99de4dfdad6720acf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=563edce2fa6d116c94598fb99…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Nov 14 21:11:42 2011 +0100 wined3d: Get rid of the WINED3DSHADER_PARAM_SRCMOD_TYPE typedef. --- dlls/wined3d/arb_program_shader.c | 5 +++-- dlls/wined3d/glsl_shader.c | 11 +++++++---- dlls/wined3d/shader.c | 2 +- dlls/wined3d/wined3d_private.h | 6 +++--- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 19e565e..17c5ba4 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1951,8 +1951,9 @@ static void pshader_hw_tex(const struct wined3d_shader_instruction *ins) } else if (shader_version < WINED3D_SHADER_VERSION(2,0)) { - DWORD src_mod = ins->src[0].modifiers; - if (src_mod == WINED3DSPSM_DZ) { + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; + if (src_mod == WINED3DSPSM_DZ) + { /* TXP cannot handle DZ natively, so move the z coordinate to .w. reg_coord is a read-only * varying register, so we need a temp reg */ diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index ff17fcf..1746cb4 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1234,7 +1234,8 @@ static const char * const shift_glsl_tab[] = { }; /* Generate a GLSL parameter that does the input modifier computation and return the input register/mask to use */ -static void shader_glsl_gen_modifier(DWORD src_modifier, const char *in_reg, const char *in_regswizzle, char *out_str) +static void shader_glsl_gen_modifier(enum wined3d_shader_src_modifier src_modifier, + const char *in_reg, const char *in_regswizzle, char *out_str) { out_str[0] = 0; @@ -3054,7 +3055,7 @@ static void shader_glsl_tex(const struct wined3d_shader_instruction *ins) } else if (shader_version < WINED3D_SHADER_VERSION(2,0)) { - DWORD src_mod = ins->src[0].modifiers; + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; if (src_mod == WINED3DSPSM_DZ) { sample_flags |= WINED3D_GLSL_SAMPLE_PROJECTED; @@ -3187,9 +3188,11 @@ static void shader_glsl_texcoord(const struct wined3d_shader_instruction *ins) shader_glsl_get_write_mask(&ins->dst[0], dst_mask); shader_addline(buffer, "clamp(gl_TexCoord[%u], 0.0, 1.0)%s);\n", ins->dst[0].reg.idx, dst_mask); - } else { + } + else + { + enum wined3d_shader_src_modifier src_mod = ins->src[0].modifiers; DWORD reg = ins->src[0].reg.idx; - DWORD src_mod = ins->src[0].modifiers; char dst_swizzle[6]; shader_glsl_get_swizzle(&ins->src[0], FALSE, write_mask, dst_swizzle); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 24b577a..447de8f 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1099,7 +1099,7 @@ void shader_dump_dst_param(const struct wined3d_shader_dst_param *param, void shader_dump_src_param(const struct wined3d_shader_src_param *param, const struct wined3d_shader_version *shader_version) { - DWORD src_modifier = param->modifiers; + enum wined3d_shader_src_modifier src_modifier = param->modifiers; DWORD swizzle = param->swizzle; if (src_modifier == WINED3DSPSM_NEG diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index a331f4e..460c911 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -324,7 +324,7 @@ enum wined3d_immconst_type #define WINED3DSP_NOSWIZZLE (0 | (1 << 2) | (2 << 4) | (3 << 6)) -typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE +enum wined3d_shader_src_modifier { WINED3DSPSM_NONE = 0, WINED3DSPSM_NEG = 1, @@ -340,7 +340,7 @@ typedef enum _WINED3DSHADER_PARAM_SRCMOD_TYPE WINED3DSPSM_ABS = 11, WINED3DSPSM_ABSNEG = 12, WINED3DSPSM_NOT = 13, -} WINED3DSHADER_PARAM_SRCMOD_TYPE; +}; #define WINED3DSP_WRITEMASK_0 0x1 /* .x r */ #define WINED3DSP_WRITEMASK_1 0x2 /* .y g */ @@ -617,7 +617,7 @@ struct wined3d_shader_src_param { struct wined3d_shader_register reg; DWORD swizzle; - DWORD modifiers; + enum wined3d_shader_src_modifier modifiers; }; struct wined3d_shader_instruction
1
0
0
0
Henri Verbeet : d3d10: Implement D3D10StateBlockMaskDifference().
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: a11a171366d8626c1a0042f9c545b24689c63e75 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a11a171366d8626c1a0042f9c…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Nov 14 21:11:41 2011 +0100 d3d10: Implement D3D10StateBlockMaskDifference(). --- dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/stateblock.c | 23 +++++++++++++++++++++++ dlls/d3d10/tests/device.c | 27 +++++++++++++++++++++++++++ include/d3d10effect.h | 3 +++ 4 files changed, 54 insertions(+), 1 deletions(-) diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index 16d2d5f..baa0c10 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -19,7 +19,7 @@ @ stub D3D10PreprocessShader @ stdcall D3D10ReflectShader(ptr long ptr) @ stub D3D10RegisterLayers -@ stub D3D10StateBlockMaskDifference +@ stdcall D3D10StateBlockMaskDifference(ptr ptr ptr) @ stub D3D10StateBlockMaskDisableAll @ stub D3D10StateBlockMaskDisableCapture @ stub D3D10StateBlockMaskEnableAll diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c index a254704..f121a5c 100644 --- a/dlls/d3d10/stateblock.c +++ b/dlls/d3d10/stateblock.c @@ -143,3 +143,26 @@ HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device, return S_OK; } + +HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x, + D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result) +{ + UINT count = sizeof(*result) / sizeof(DWORD); + UINT i; + + TRACE("mask_x %p, mask_y %p, result %p.\n", mask_x, mask_y, result); + + if (!mask_x || !mask_y || !result) + return E_INVALIDARG; + + for (i = 0; i < count; ++i) + { + ((DWORD *)result)[i] = ((DWORD *)mask_x)[i] ^ ((DWORD *)mask_y)[i]; + } + for (i = count * sizeof(DWORD); i < sizeof(*result); ++i) + { + ((BYTE *)result)[i] = ((BYTE *)mask_x)[i] ^ ((BYTE *)mask_y)[i]; + } + + return S_OK; +} diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index 8399cdb..1fc3a3b 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -64,6 +64,32 @@ static void test_device_interfaces(ID3D10Device *device) ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); } +static void test_stateblock_mask(void) +{ + D3D10_STATE_BLOCK_MASK mask_x, mask_y, result; + HRESULT hr; + + memset(&mask_x, 0, sizeof(mask_x)); + memset(&mask_y, 0, sizeof(mask_y)); + memset(&result, 0, sizeof(result)); + + mask_x.VS = 0x33; + mask_y.VS = 0x55; + mask_x.Predication = 0x99; + mask_y.Predication = 0xaa; + + hr = D3D10StateBlockMaskDifference(&mask_x, &mask_y, &result); + ok(SUCCEEDED(hr), "D3D10StateBlockMaskDifference failed, hr %#x.\n", hr); + ok(result.VS == 0x66, "Got unexpected result.VS %#x.\n", result.VS); + ok(result.Predication == 0x33, "Got unexpected result.Predication %#x.\n", result.Predication); + hr = D3D10StateBlockMaskDifference(NULL, &mask_y, &result); + ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); + hr = D3D10StateBlockMaskDifference(&mask_x, NULL, &result); + ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); + hr = D3D10StateBlockMaskDifference(&mask_x, &mask_y, NULL); + ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); +} + START_TEST(device) { ID3D10Device *device; @@ -77,6 +103,7 @@ START_TEST(device) } test_device_interfaces(device); + test_stateblock_mask(); refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left\n", refcount); diff --git a/include/d3d10effect.h b/include/d3d10effect.h index 8c5cc63..d36c3da 100644 --- a/include/d3d10effect.h +++ b/include/d3d10effect.h @@ -804,6 +804,9 @@ HRESULT WINAPI D3D10CreateEffectFromMemory(void *data, SIZE_T data_size, UINT fl HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device, D3D10_STATE_BLOCK_MASK *mask, ID3D10StateBlock **stateblock); +HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x, + D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result); + #ifdef __cplusplus } #endif
1
0
0
0
Henri Verbeet : d3d10: Add a stub ID3D10StateBlock implementation.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 84f90f6ea8359231fa8d835981a8f19028e2e9c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84f90f6ea8359231fa8d83598…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Nov 14 20:45:25 2011 +0100 d3d10: Add a stub ID3D10StateBlock implementation. --- dlls/d3d10/Makefile.in | 1 + dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/stateblock.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 1 deletions(-) diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index feca50e..6e3f311 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -6,6 +6,7 @@ C_SRCS = \ d3d10_main.c \ effect.c \ shader.c \ + stateblock.c \ utils.c RC_SRCS = version.rc diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index 94e2424..16d2d5f 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -5,7 +5,7 @@ @ stdcall D3D10CreateDeviceAndSwapChain(ptr long ptr long long ptr ptr ptr) @ stdcall D3D10CreateEffectFromMemory(ptr long long ptr ptr ptr) @ stub D3D10CreateEffectPoolFromMemory -@ stub D3D10CreateStateBlock +@ stdcall D3D10CreateStateBlock(ptr ptr ptr) @ stub D3D10DisassembleEffect @ stub D3D10DisassembleShader @ stdcall D3D10GetGeometryShaderProfile(ptr) diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c new file mode 100644 index 0000000..a254704 --- /dev/null +++ b/dlls/d3d10/stateblock.c @@ -0,0 +1,145 @@ +/* + * Copyright 2011 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "d3d10_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d10); + +struct d3d10_stateblock +{ + ID3D10StateBlock ID3D10StateBlock_iface; + LONG refcount; +}; + +static inline struct d3d10_stateblock *impl_from_ID3D10StateBlock(ID3D10StateBlock *iface) +{ + return CONTAINING_RECORD(iface, struct d3d10_stateblock, ID3D10StateBlock_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d10_stateblock_QueryInterface(ID3D10StateBlock *iface, REFIID iid, void **object) +{ + struct d3d10_stateblock *stateblock; + + TRACE("iface %p, iid %s, object %p.\n", iface, debugstr_guid(iid), object); + + stateblock = impl_from_ID3D10StateBlock(iface); + + if (IsEqualGUID(iid, &IID_ID3D10StateBlock) + || IsEqualGUID(iid, &IID_IUnknown)) + { + IUnknown_AddRef(&stateblock->ID3D10StateBlock_iface); + *object = &stateblock->ID3D10StateBlock_iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *object = NULL; + + return E_NOINTERFACE; +} + +static ULONG STDMETHODCALLTYPE d3d10_stateblock_AddRef(ID3D10StateBlock *iface) +{ + struct d3d10_stateblock *stateblock = impl_from_ID3D10StateBlock(iface); + ULONG refcount = InterlockedIncrement(&stateblock->refcount); + + TRACE("%p increasing refcount to %u.\n", stateblock, refcount); + + return refcount; +} + +static ULONG STDMETHODCALLTYPE d3d10_stateblock_Release(ID3D10StateBlock *iface) +{ + struct d3d10_stateblock *stateblock = impl_from_ID3D10StateBlock(iface); + ULONG refcount = InterlockedDecrement(&stateblock->refcount); + + TRACE("%p decreasing refcount to %u.\n", stateblock, refcount); + + if (!refcount) + HeapFree(GetProcessHeap(), 0, stateblock); + + return refcount; +} + +static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Capture(ID3D10StateBlock *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_stateblock_Apply(ID3D10StateBlock *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_stateblock_ReleaseAllDeviceObjects(ID3D10StateBlock *iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +static HRESULT STDMETHODCALLTYPE d3d10_stateblock_GetDevice(ID3D10StateBlock *iface, ID3D10Device **device) +{ + FIXME("iface %p, device %p stub!\n", iface, device); + + return E_NOTIMPL; +} + +static const struct ID3D10StateBlockVtbl d3d10_stateblock_vtbl = +{ + /* IUnknown methods */ + d3d10_stateblock_QueryInterface, + d3d10_stateblock_AddRef, + d3d10_stateblock_Release, + /* ID3D10StateBlock methods */ + d3d10_stateblock_Capture, + d3d10_stateblock_Apply, + d3d10_stateblock_ReleaseAllDeviceObjects, + d3d10_stateblock_GetDevice, +}; + +HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device, + D3D10_STATE_BLOCK_MASK *mask, ID3D10StateBlock **stateblock) +{ + struct d3d10_stateblock *object; + + FIXME("device %p, mask %p, stateblock %p stub!\n", device, mask, stateblock); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + ERR("Failed to allocate D3D10 stateblock object memory.\n"); + return E_OUTOFMEMORY; + } + + object->ID3D10StateBlock_iface.lpVtbl = &d3d10_stateblock_vtbl; + object->refcount = 1; + + TRACE("Created stateblock %p.\n", object); + *stateblock = &object->ID3D10StateBlock_iface; + + return S_OK; +}
1
0
0
0
← Newer
1
...
47
48
49
50
51
52
53
...
86
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
Results per page:
10
25
50
100
200