winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2012
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
712 discussions
Start a n
N
ew thread
Aric Stewart : usp10: Change OpenType_GSUB_GetFontLangaugeTags to OpenType_GetFontLanguageTags and load languages from GPOS table as well .
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 2123f049d30cad9d79867999eb49f46211e0e23c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2123f049d30cad9d79867999e…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:42 2012 -0500 usp10: Change OpenType_GSUB_GetFontLangaugeTags to OpenType_GetFontLanguageTags and load languages from GPOS table as well. --- dlls/usp10/opentype.c | 92 ++++++++++++++++++++++++++++++++++++------- dlls/usp10/shape.c | 4 +- dlls/usp10/usp10_internal.h | 5 +- 3 files changed, 82 insertions(+), 19 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index 1aa77c02..369cfcc 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -992,7 +992,7 @@ static void GSUB_initialize_language_cache(LoadedScript *script) { int i; - if (!script->language_count && script->gsub_table) + if (script->gsub_table) { DWORD offset; const OT_Script* table = script->gsub_table; @@ -1001,12 +1001,12 @@ static void GSUB_initialize_language_cache(LoadedScript *script) if (offset) { script->default_language.tag = MS_MAKE_TAG('d','f','l','t'); - script->default_language.table = (const BYTE*)table + offset; + script->default_language.gsub_table = (const BYTE*)table + offset; } if (script->language_count) { - TRACE("Deflang %p, LangCount %i\n",script->default_language.table, script->language_count); + TRACE("Deflang %p, LangCount %i\n",script->default_language.gsub_table, script->language_count); script->languages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LoadedLanguage) * script->language_count); @@ -1014,13 +1014,79 @@ static void GSUB_initialize_language_cache(LoadedScript *script) { int offset = GET_BE_WORD(table->LangSysRecord[i].LangSys); script->languages[i].tag = MS_MAKE_TAG(table->LangSysRecord[i].LangSysTag[0], table->LangSysRecord[i].LangSysTag[1], table->LangSysRecord[i].LangSysTag[2], table->LangSysRecord[i].LangSysTag[3]); - script->languages[i].table = ((const BYTE*)table + offset); + script->languages[i].gsub_table = ((const BYTE*)table + offset); } } } } -HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags, LPCVOID* language_table) +static void GPOS_expand_language_cache(LoadedScript *script) +{ + int count; + const OT_Script* table = script->gpos_table; + DWORD offset; + + if (!table) + return; + + offset = GET_BE_WORD(table->DefaultLangSys); + if (offset) + script->default_language.gpos_table = (const BYTE*)table + offset; + + count = GET_BE_WORD(table->LangSysCount); + + TRACE("Deflang %p, LangCount %i\n",script->default_language.gpos_table, count); + if (!script->language_count) + { + int i; + script->language_count = count; + + script->languages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LoadedLanguage) * script->language_count); + + for (i = 0; i < script->language_count; i++) + { + int offset = GET_BE_WORD(table->LangSysRecord[i].LangSys); + script->languages[i].tag = MS_MAKE_TAG(table->LangSysRecord[i].LangSysTag[0], table->LangSysRecord[i].LangSysTag[1], table->LangSysRecord[i].LangSysTag[2], table->LangSysRecord[i].LangSysTag[3]); + script->languages[i].gpos_table = ((const BYTE*)table + offset); + } + } + else if (count) + { + int i,j; + for (i = 0; i < count; i++) + { + int offset = GET_BE_WORD(table->LangSysRecord[i].LangSys); + OPENTYPE_TAG tag = MS_MAKE_TAG(table->LangSysRecord[i].LangSysTag[0], table->LangSysRecord[i].LangSysTag[1], table->LangSysRecord[i].LangSysTag[2], table->LangSysRecord[i].LangSysTag[3]); + + for (j = 0; j < script->language_count; j++) + { + if (script->languages[j].tag == tag) + { + script->languages[j].gpos_table = ((const BYTE*)table + offset); + break; + } + } + if (j == script->language_count) + { + script->language_count++; + script->languages = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,script->languages, sizeof(LoadedLanguage) * script->language_count); + script->languages[j].tag = tag; + script->languages[j].gpos_table = ((const BYTE*)table + offset); + } + } + } +} + +static void _initialize_language_cache(LoadedScript *script) +{ + if (!script->language_count) + { + GSUB_initialize_language_cache(script); + GPOS_expand_language_cache(script); + } +} + +HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) { int i; HRESULT rc = S_OK; @@ -1040,7 +1106,7 @@ HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_ if (!script) return E_INVALIDARG; - GSUB_initialize_language_cache(script); + _initialize_language_cache(script); if (!searchingFor && cMaxTags < script->language_count) rc = E_OUTOFMEMORY; @@ -1060,15 +1126,13 @@ HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_ { pLanguageTags[0] = script->languages[i].tag; *pcTags = 1; - if (language_table) - *language_table = script->languages[i].table; rc = S_OK; break; } } } - if (script->default_language.table) + if (script->default_language.gsub_table) { if (i < cMaxTags) pLanguageTags[i] = script->default_language.tag; @@ -1076,8 +1140,6 @@ HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_ if (searchingFor && FAILED(rc)) { pLanguageTags[0] = script->default_language.tag; - if (language_table) - *language_table = script->default_language.table; } i++; *pcTags = (*pcTags) + 1; @@ -1091,9 +1153,9 @@ static void GSUB_initialize_feature_cache(LPCVOID table, LoadedLanguage *languag { int i; - if (!language->feature_count) + if (!language->feature_count && language->gsub_table) { - const OT_LangSys *lang= language->table; + const OT_LangSys *lang = language->gsub_table; const GSUB_Header *header = (const GSUB_Header *)table; const OT_FeatureList *feature_list; @@ -1151,9 +1213,9 @@ HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_t return E_INVALIDARG; } - GSUB_initialize_language_cache(script); + _initialize_language_cache(script); - if (script->default_language.table && script->default_language.tag == language_tag) + if (script->default_language.gsub_table && script->default_language.tag == language_tag) language = &script->default_language; else { diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index b7d2822..1655992 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -3264,11 +3264,11 @@ HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, if (psa && psc->userLang != 0) searching = psc->userLang; - hr = OpenType_GSUB_GetFontLanguageTags(psc, tagScript, searching, cMaxTags, pLangSysTags, pcTags, NULL); + hr = OpenType_GetFontLanguageTags(psc, tagScript, searching, cMaxTags, pLangSysTags, pcTags); if (FAILED(hr)) { fellback = TRUE; - hr = OpenType_GSUB_GetFontLanguageTags(psc, MS_MAKE_TAG('l','a','t','n'), searching, cMaxTags, pLangSysTags, pcTags, NULL); + hr = OpenType_GetFontLanguageTags(psc, MS_MAKE_TAG('l','a','t','n'), searching, cMaxTags, pLangSysTags, pcTags); } if (FAILED(hr) || fellback) diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 3cb48d8..4077833 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -137,7 +137,8 @@ typedef struct { typedef struct { OPENTYPE_TAG tag; - LPCVOID table; + LPCVOID gsub_table; + LPCVOID gpos_table; INT feature_count; LoadedFeature *features; } LoadedLanguage; @@ -236,5 +237,5 @@ DWORD OpenType_CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWOR void OpenType_GDEF_UpdateGlyphProps(HDC hdc, ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD* pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN; INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) DECLSPEC_HIDDEN; HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN; -HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags, LPCVOID* language_table) DECLSPEC_HIDDEN; +HRESULT OpenType_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags) DECLSPEC_HIDDEN; HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;
1
0
0
0
Aric Stewart : usp10: Change OpenType_GSUB_GetFontScriptTags to OpenType_GetFontScriptTags and load scripts from GPOS table as well .
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: e031293521a9673542983f53e66e13d2efcf52f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e031293521a9673542983f53e…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:39 2012 -0500 usp10: Change OpenType_GSUB_GetFontScriptTags to OpenType_GetFontScriptTags and load scripts from GPOS table as well. --- dlls/usp10/opentype.c | 90 ++++++++++++++++++++++++++++++++++++++----- dlls/usp10/shape.c | 4 +- dlls/usp10/usp10_internal.h | 5 +- 3 files changed, 85 insertions(+), 14 deletions(-) diff --git a/dlls/usp10/opentype.c b/dlls/usp10/opentype.c index bf237eb..1aa77c02 100644 --- a/dlls/usp10/opentype.c +++ b/dlls/usp10/opentype.c @@ -277,6 +277,15 @@ typedef struct{ WORD Alternate[1]; } GSUB_AlternateSet; +/* These are all structures needed for the GPOS table */ + +typedef struct { + DWORD version; + WORD ScriptList; + WORD FeatureList; + WORD LookupList; +} GPOS_Header; + /********** * CMAP **********/ @@ -864,7 +873,7 @@ static void GSUB_initialize_script_cache(ScriptCache *psc) { int i; - if (!psc->script_count) + if (psc->GSUB_Table) { const OT_ScriptList *script; const GSUB_Header* header = (const GSUB_Header*)psc->GSUB_Table; @@ -878,18 +887,81 @@ static void GSUB_initialize_script_cache(ScriptCache *psc) { int offset = GET_BE_WORD(script->ScriptRecord[i].Script); psc->scripts[i].tag = MS_MAKE_TAG(script->ScriptRecord[i].ScriptTag[0], script->ScriptRecord[i].ScriptTag[1], script->ScriptRecord[i].ScriptTag[2], script->ScriptRecord[i].ScriptTag[3]); - psc->scripts[i].table = ((const BYTE*)script + offset); + psc->scripts[i].gsub_table = ((const BYTE*)script + offset); } } } } -HRESULT OpenType_GSUB_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags, LPCVOID* script_table) +static void GPOS_expand_script_cache(ScriptCache *psc) +{ + int i, count; + const OT_ScriptList *script; + const GPOS_Header* header = (const GPOS_Header*)psc->GPOS_Table; + + if (!header) + return; + + script = (const OT_ScriptList*)((const BYTE*)header + GET_BE_WORD(header->ScriptList)); + count = GET_BE_WORD(script->ScriptCount); + + if (!psc->script_count) + { + psc->script_count = count; + TRACE("initializing %i scripts in this font\n",psc->script_count); + if (psc->script_count) + { + psc->scripts = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(LoadedScript) * psc->script_count); + for (i = 0; i < psc->script_count; i++) + { + int offset = GET_BE_WORD(script->ScriptRecord[i].Script); + psc->scripts[i].tag = MS_MAKE_TAG(script->ScriptRecord[i].ScriptTag[0], script->ScriptRecord[i].ScriptTag[1], script->ScriptRecord[i].ScriptTag[2], script->ScriptRecord[i].ScriptTag[3]); + psc->scripts[i].gpos_table = ((const BYTE*)script + offset); + } + } + } + else + { + for (i = 0; i < count; i++) + { + int j; + int offset = GET_BE_WORD(script->ScriptRecord[i].Script); + OPENTYPE_TAG tag = MS_MAKE_TAG(script->ScriptRecord[i].ScriptTag[0], script->ScriptRecord[i].ScriptTag[1], script->ScriptRecord[i].ScriptTag[2], script->ScriptRecord[i].ScriptTag[3]); + for (j = 0; j < psc->script_count; j++) + { + if (psc->scripts[j].tag == tag) + { + psc->scripts[j].gpos_table = ((const BYTE*)script + offset); + break; + } + } + if (j == psc->script_count) + { + psc->script_count++; + psc->scripts = HeapReAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,psc->scripts, sizeof(LoadedScript) * psc->script_count); + psc->scripts[j].tag = tag; + psc->scripts[j].gpos_table = ((const BYTE*)script + offset); + } + } + } +} + +static void _initialize_script_cache(ScriptCache *psc) +{ + if (!psc->script_count) + { + GSUB_initialize_script_cache(psc); + GPOS_expand_script_cache(psc); + } +} + +HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) { int i; HRESULT rc = S_OK; - GSUB_initialize_script_cache(psc); + _initialize_script_cache(psc); + *pcTags = psc->script_count; if (!searchingFor && cMaxTags < *pcTags) @@ -908,8 +980,6 @@ HRESULT OpenType_GSUB_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searching { pScriptTags[0] = psc->scripts[i].tag; *pcTags = 1; - if (script_table) - *script_table = psc->scripts[i].table; rc = S_OK; break; } @@ -922,10 +992,10 @@ static void GSUB_initialize_language_cache(LoadedScript *script) { int i; - if (!script->language_count) + if (!script->language_count && script->gsub_table) { DWORD offset; - const OT_Script* table = script->table; + const OT_Script* table = script->gsub_table; script->language_count = GET_BE_WORD(table->LangSysCount); offset = GET_BE_WORD(table->DefaultLangSys); if (offset) @@ -956,7 +1026,7 @@ HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_ HRESULT rc = S_OK; LoadedScript *script = NULL; - GSUB_initialize_script_cache(psc); + _initialize_script_cache(psc); for (i = 0; i < psc->script_count; i++) { @@ -1061,7 +1131,7 @@ HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_t LoadedScript *script = NULL; LoadedLanguage *language = NULL; - GSUB_initialize_script_cache(psc); + _initialize_script_cache(psc); for (i = 0; i < psc->script_count; i++) { diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index e288878..b7d2822 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -807,7 +807,7 @@ static inline BOOL get_GSUB_Indic2(SCRIPT_ANALYSIS *psa, ScriptCache *psc) HRESULT hr; int count = 0; - hr = OpenType_GSUB_GetFontScriptTags(psc, ShapingData[psa->eScript].newOtTag, 1, &tag, &count, NULL); + hr = OpenType_GetFontScriptTags(psc, ShapingData[psa->eScript].newOtTag, 1, &tag, &count); return(SUCCEEDED(hr)); } @@ -3244,7 +3244,7 @@ HRESULT SHAPE_GetFontScriptTags( HDC hdc, ScriptCache *psc, if (psa && scriptInformation[psa->eScript].scriptTag) searching = scriptInformation[psa->eScript].scriptTag; - hr = OpenType_GSUB_GetFontScriptTags(psc, searching, cMaxTags, pScriptTags, pcTags, NULL); + hr = OpenType_GetFontScriptTags(psc, searching, cMaxTags, pScriptTags, pcTags); if (FAILED(hr)) *pcTags = 0; return hr; diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 9644159..3cb48d8 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -144,7 +144,8 @@ typedef struct { typedef struct { OPENTYPE_TAG tag; - LPCVOID table; + LPCVOID gsub_table; + LPCVOID gpos_table; LoadedLanguage default_language; INT language_count; LoadedLanguage *languages; @@ -234,6 +235,6 @@ void BREAK_line(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT DWORD OpenType_CMAP_GetGlyphIndex(HDC hdc, ScriptCache *psc, DWORD utf32c, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN; void OpenType_GDEF_UpdateGlyphProps(HDC hdc, ScriptCache *psc, const WORD *pwGlyphs, const WORD cGlyphs, WORD* pwLogClust, const WORD cChars, SCRIPT_GLYPHPROP *pGlyphProp) DECLSPEC_HIDDEN; INT OpenType_apply_GSUB_lookup(LPCVOID table, INT lookup_index, WORD *glyphs, INT glyph_index, INT write_dir, INT *glyph_count) DECLSPEC_HIDDEN; -HRESULT OpenType_GSUB_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags, LPCVOID* script_table) DECLSPEC_HIDDEN; +HRESULT OpenType_GetFontScriptTags(ScriptCache *psc, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pScriptTags, int *pcTags) DECLSPEC_HIDDEN; HRESULT OpenType_GSUB_GetFontLanguageTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pLanguageTags, int *pcTags, LPCVOID* language_table) DECLSPEC_HIDDEN; HRESULT OpenType_GSUB_GetFontFeatureTags(ScriptCache *psc, OPENTYPE_TAG script_tag, OPENTYPE_TAG language_tag, BOOL filtered, OPENTYPE_TAG searchingFor, int cMaxTags, OPENTYPE_TAG *pFeatureTags, int *pcTags, LoadedFeature** feature) DECLSPEC_HIDDEN;
1
0
0
0
Aric Stewart : usp10: Load the GPOS table.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 9d408bbbf0d66073040ae14220c490d67b570034 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9d408bbbf0d66073040ae1422…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:35 2012 -0500 usp10: Load the GPOS table. --- dlls/usp10/shape.c | 51 ++++++++++++++++++++++++++---------------- dlls/usp10/usp10.c | 1 + dlls/usp10/usp10_internal.h | 1 + 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index b574a85..e288878 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -603,6 +603,27 @@ static VOID *load_gsub_table(HDC hdc) return GSUB_Table; } +static VOID *load_gpos_table(HDC hdc) +{ + VOID* GPOS_Table = NULL; + int length = GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, NULL, 0); + if (length != GDI_ERROR) + { + GPOS_Table = HeapAlloc(GetProcessHeap(),0,length); + GetFontData(hdc, MS_MAKE_TAG('G', 'P', 'O', 'S'), 0, GPOS_Table, length); + TRACE("Loaded GPOS table of %i bytes\n",length); + } + return GPOS_Table; +} + +static VOID load_ot_tables(HDC hdc, ScriptCache *psc) +{ + if (!psc->GSUB_Table) + psc->GSUB_Table = load_gsub_table(hdc); + if (!psc->GPOS_Table) + psc->GPOS_Table = load_gpos_table(hdc); +} + INT SHAPE_does_GSUB_feature_apply_to_chars(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, const WCHAR *chars, INT write_dir, INT count, const char* feature) { WORD *glyphs; @@ -957,8 +978,7 @@ static void ContextualShape_Arabic(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p dirL = 1; } - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); context_type = HeapAlloc(GetProcessHeap(),0,cChars); context_shape = HeapAlloc(GetProcessHeap(),0,sizeof(INT) * cChars); @@ -1179,8 +1199,7 @@ static void ContextualShape_Syriac(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *p dirL = 1; } - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (!psc->GSUB_Table) return; @@ -1314,8 +1333,7 @@ static void ContextualShape_Phags_pa(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS dirL = 1; } - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (!psc->GSUB_Table) return; @@ -2650,8 +2668,7 @@ static void ContextualShape_Mongolian(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS else dirL = 1; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (!psc->GSUB_Table) return; @@ -3153,8 +3170,7 @@ void SHAPE_CharGlyphProp(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, const void SHAPE_ContextualShaping(HDC hdc, ScriptCache *psc, SCRIPT_ANALYSIS *psa, WCHAR* pwcChars, INT cChars, WORD* pwOutGlyphs, INT* pcGlyphs, INT cMaxGlyphs, WORD *pwLogClust) { - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (ShapingData[psa->eScript].contextProc) ShapingData[psa->eScript].contextProc(hdc, psc, psa, pwcChars, cChars, pwOutGlyphs, pcGlyphs, cMaxGlyphs, pwLogClust); @@ -3168,8 +3184,7 @@ static void SHAPE_ApplyOpenTypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYS if (!rpRangeProperties) return; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (!psc->GSUB_Table) return; @@ -3202,8 +3217,7 @@ HRESULT SHAPE_CheckFontForRequiredFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANA if (!ShapingData[psa->eScript].requiredFeatures) return S_OK; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); /* we need to have at least one of the required features */ i = 0; @@ -3225,8 +3239,7 @@ HRESULT SHAPE_GetFontScriptTags( HDC hdc, ScriptCache *psc, HRESULT hr; OPENTYPE_TAG searching = 0x00000000; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (psa && scriptInformation[psa->eScript].scriptTag) searching = scriptInformation[psa->eScript].scriptTag; @@ -3246,8 +3259,7 @@ HRESULT SHAPE_GetFontLanguageTags( HDC hdc, ScriptCache *psc, OPENTYPE_TAG searching = 0x00000000; BOOL fellback = FALSE; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (psa && psc->userLang != 0) searching = psc->userLang; @@ -3274,8 +3286,7 @@ HRESULT SHAPE_GetFontFeatureTags( HDC hdc, ScriptCache *psc, HRESULT hr; BOOL filter = FALSE; - if (!psc->GSUB_Table) - psc->GSUB_Table = load_gsub_table(hdc); + load_ot_tables(hdc, psc); if (psa && scriptInformation[psa->eScript].scriptTag) { diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 8942a42..0e97405 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -984,6 +984,7 @@ HRESULT WINAPI ScriptFreeCache(SCRIPT_CACHE *psc) heap_free(((ScriptCache *)*psc)->GSUB_Table); heap_free(((ScriptCache *)*psc)->GDEF_Table); heap_free(((ScriptCache *)*psc)->CMAP_Table); + heap_free(((ScriptCache *)*psc)->GPOS_Table); for (i = 0; i < ((ScriptCache *)*psc)->script_count; i++) { int j; diff --git a/dlls/usp10/usp10_internal.h b/dlls/usp10/usp10_internal.h index 013e383..9644159 100644 --- a/dlls/usp10/usp10_internal.h +++ b/dlls/usp10/usp10_internal.h @@ -164,6 +164,7 @@ typedef struct { LPVOID GDEF_Table; LPVOID CMAP_Table; LPVOID CMAP_format12_Table; + LPVOID GPOS_Table; INT script_count; LoadedScript *scripts;
1
0
0
0
Aric Stewart : ups10: Rename common opentype tables used in both GSUB and GPOS to OT_.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 61895680720cf149d3669786a0c8a645d3eb3c92 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=61895680720cf149d3669786a…
Author: Aric Stewart <aric(a)codeweavers.com> Date: Mon Jul 16 07:23:27 2012 -0500 ups10: Rename common opentype tables used in both GSUB and GPOS to OT_. --- dlls/usp10/opentype.c | 76 ++++++++++++++++++++++++------------------------ 1 files changed, 38 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=61895680720cf149d3669…
1
0
0
0
Józef Kucia : d3dx9: Implement volume texture filtering in D3DXFilterTexture.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: ffe36a3894356f6e23107eb7f0fd1c87d0d71f14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ffe36a3894356f6e23107eb7f…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri Jul 13 17:21:55 2012 +0200 d3dx9: Implement volume texture filtering in D3DXFilterTexture. --- dlls/d3dx9_36/tests/texture.c | 27 ++++++++++++++++++++++ dlls/d3dx9_36/texture.c | 49 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 71 insertions(+), 5 deletions(-) diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c index 44bf235..95e1dc5 100644 --- a/dlls/d3dx9_36/tests/texture.c +++ b/dlls/d3dx9_36/tests/texture.c @@ -751,6 +751,7 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) { IDirect3DTexture9 *tex; IDirect3DCubeTexture9 *cubetex; + IDirect3DVolumeTexture9 *voltex; HRESULT hr; hr = IDirect3DDevice9_CreateTexture(device, 256, 256, 5, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex, NULL); @@ -835,6 +836,32 @@ static void test_D3DXFilterTexture(IDirect3DDevice9 *device) else skip("Failed to create texture\n"); + /* Volume texture test */ + hr = IDirect3DDevice9_CreateVolumeTexture(device, 256, 256, 4, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &voltex, NULL); + if (SUCCEEDED(hr)) + { + DWORD level_count = IDirect3DVolumeTexture9_GetLevelCount(voltex); + + hr = D3DXFilterTexture((IDirect3DBaseTexture9*) voltex, NULL, 0, D3DX_FILTER_NONE); + ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = D3DXFilterTexture((IDirect3DBaseTexture9*) voltex, NULL, 0, D3DX_DEFAULT); + ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = D3DXFilterTexture((IDirect3DBaseTexture9*) voltex, NULL, 0, D3DX_FILTER_BOX); + ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = D3DXFilterTexture((IDirect3DBaseTexture9*) voltex, NULL, level_count - 1, D3DX_DEFAULT); + ok(hr == D3D_OK, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3D_OK); + + hr = D3DXFilterTexture((IDirect3DBaseTexture9*) voltex, NULL, level_count, D3DX_DEFAULT); + ok(hr == D3DERR_INVALIDCALL, "D3DXFilterTexture returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); + + IDirect3DVolumeTexture9_Release(voltex); + } + else + skip("Failed to create volume texture\n"); + /* Test textures with D3DUSAGE_AUTOGENMIPMAP usage */ if (!is_autogenmipmap_supported(device, D3DRTYPE_TEXTURE)) { diff --git a/dlls/d3dx9_36/texture.c b/dlls/d3dx9_36/texture.c index 91f97c2..ec9bad9 100644 --- a/dlls/d3dx9_36/texture.c +++ b/dlls/d3dx9_36/texture.c @@ -61,8 +61,8 @@ static HRESULT get_surface(D3DRESOURCETYPE type, LPDIRECT3DBASETEXTURE9 tex, } } -HRESULT WINAPI D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 texture, - CONST PALETTEENTRY *palette, +HRESULT WINAPI D3DXFilterTexture(IDirect3DBaseTexture9 *texture, + const PALETTEENTRY *palette, UINT srclevel, DWORD filter) { @@ -70,7 +70,7 @@ HRESULT WINAPI D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 texture, HRESULT hr; D3DRESOURCETYPE type; - TRACE("(%p, %p, %d, %d)\n", texture, palette, srclevel, filter); + TRACE("(%p, %p, %u, %#x)\n", texture, palette, srclevel, filter); if (!texture) return D3DERR_INVALIDCALL; @@ -137,9 +137,48 @@ HRESULT WINAPI D3DXFilterTexture(LPDIRECT3DBASETEXTURE9 texture, return D3D_OK; } + case D3DRTYPE_VOLUMETEXTURE: + { + D3DVOLUME_DESC desc; + int level, level_count; + IDirect3DVolume9 *top_volume, *mip_volume; + IDirect3DVolumeTexture9 *volume_texture = (IDirect3DVolumeTexture9*) texture; + + IDirect3DVolumeTexture9_GetLevelDesc(volume_texture, srclevel, &desc); + + if (filter == D3DX_DEFAULT) + { + if (is_pow2(desc.Width) && is_pow2(desc.Height) && is_pow2(desc.Depth)) + filter = D3DX_FILTER_BOX; + else + filter = D3DX_FILTER_BOX | D3DX_FILTER_DITHER; + } + + hr = IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, srclevel, &top_volume); + if (FAILED(hr)) + return hr; + + level_count = IDirect3DVolumeTexture9_GetLevelCount(volume_texture); + for (level = srclevel + 1; level < level_count; level++) + { + IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, level, &mip_volume); + hr = D3DXLoadVolumeFromVolume(mip_volume, palette, NULL, top_volume, palette, NULL, filter, 0); + IDirect3DVolume9_Release(top_volume); + top_volume = mip_volume; + + if (FAILED(hr)) + break; + } + + IDirect3DVolume9_Release(top_volume); + if (FAILED(hr)) + return hr; + + return D3D_OK; + } + default: - FIXME("Implement volume texture filtering\n"); - return E_NOTIMPL; + return D3DERR_INVALIDCALL; } }
1
0
0
0
Józef Kucia : d3dx9: Use structure to pass volume size to pixel format conversion functions.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: e8bfaf172782676fab4d25afeb214076afa9a09f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8bfaf172782676fab4d25afe…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri Jul 13 17:21:54 2012 +0200 d3dx9: Use structure to pass volume size to pixel format conversion functions. --- dlls/d3dx9_36/d3dx9_36_private.h | 15 +++++-- dlls/d3dx9_36/surface.c | 87 +++++++++++++++++++------------------ dlls/d3dx9_36/volume.c | 47 +++++++++------------ 3 files changed, 76 insertions(+), 73 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e8bfaf172782676fab4d2…
1
0
0
0
Józef Kucia : d3dx9: Implement point filtering for volume textures.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 29acc31506216323a4e91367520d6cb0b4fff66f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=29acc31506216323a4e913675…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri Jul 13 17:21:53 2012 +0200 d3dx9: Implement point filtering for volume textures. --- dlls/d3dx9_36/d3dx9_36_private.h | 3 + dlls/d3dx9_36/surface.c | 103 ++++++++++++++++++++------------------ dlls/d3dx9_36/tests/volume.c | 2 +- dlls/d3dx9_36/volume.c | 7 ++- 4 files changed, 63 insertions(+), 52 deletions(-) diff --git a/dlls/d3dx9_36/d3dx9_36_private.h b/dlls/d3dx9_36/d3dx9_36_private.h index fec9ede..20d013f 100644 --- a/dlls/d3dx9_36/d3dx9_36_private.h +++ b/dlls/d3dx9_36/d3dx9_36_private.h @@ -67,6 +67,9 @@ const PixelFormatDesc *get_format_info_idx(int idx) DECLSPEC_HIDDEN; void copy_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, SIZE src_size, UINT src_depth, const PixelFormatDesc *src_format, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, SIZE dst_size, UINT dst_depth, const PixelFormatDesc *dst_format, D3DCOLOR color_key) DECLSPEC_HIDDEN; +void point_filter_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, SIZE src_size, UINT src_depth, const PixelFormatDesc *src_format, + BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, SIZE dst_size, UINT dst_depth, const PixelFormatDesc *dst_format, + D3DCOLOR color_key) DECLSPEC_HIDDEN; HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; diff --git a/dlls/d3dx9_36/surface.c b/dlls/d3dx9_36/surface.c index 433c251..e640160 100644 --- a/dlls/d3dx9_36/surface.c +++ b/dlls/d3dx9_36/surface.c @@ -1353,78 +1353,83 @@ void copy_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, * using a point filter. * Works only for ARGB formats with 1 - 4 bytes per pixel. */ -static void point_filter_simple_data(const BYTE *src, UINT srcpitch, SIZE src_size, const PixelFormatDesc *srcformat, - BYTE *dest, UINT destpitch, SIZE dst_size, const PixelFormatDesc *destformat, D3DCOLOR colorkey) +void point_filter_simple_data(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, SIZE src_size, UINT src_depth, const PixelFormatDesc *src_format, + BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, SIZE dst_size, UINT dst_depth, const PixelFormatDesc *dst_format, D3DCOLOR color_key) { struct argb_conversion_info conv_info, ck_conv_info; const PixelFormatDesc *ck_format = NULL; DWORD channels[4], pixel; - - UINT x, y; + UINT x, y, z; ZeroMemory(channels, sizeof(channels)); - init_argb_conversion_info(srcformat, destformat, &conv_info); + init_argb_conversion_info(src_format, dst_format, &conv_info); - if (colorkey) + if (color_key) { /* Color keys are always represented in D3DFMT_A8R8G8B8 format. */ ck_format = get_format_info(D3DFMT_A8R8G8B8); - init_argb_conversion_info(srcformat, ck_format, &ck_conv_info); + init_argb_conversion_info(src_format, ck_format, &ck_conv_info); } - for (y = 0; y < dst_size.cy; ++y) + for (z = 0; z < dst_depth; z++) { - BYTE *destptr = dest + y * destpitch; - const BYTE *bufptr = src + srcpitch * (y * src_size.cy / dst_size.cy); + BYTE *dst_slice_ptr = dst + z * dst_slice_pitch; + const BYTE *src_slice_ptr = src + src_slice_pitch * (z * src_depth / dst_depth); - for (x = 0; x < dst_size.cx; ++x) + for (y = 0; y < dst_size.cy; y++) { - const BYTE *srcptr = bufptr + (x * src_size.cx / dst_size.cx) * srcformat->bytes_per_pixel; - DWORD val; - - /* extract source color components */ - pixel = dword_from_bytes(srcptr, srcformat->bytes_per_pixel); + BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; + const BYTE *src_row_ptr = src_slice_ptr + src_row_pitch * (y * src_size.cy / dst_size.cy); - if (!srcformat->to_rgba && !destformat->from_rgba) + for (x = 0; x < dst_size.cx; x++) { - get_relevant_argb_components(&conv_info, pixel, channels); - val = make_argb_color(&conv_info, channels); + const BYTE *src_ptr = src_row_ptr + (x * src_size.cx / dst_size.cx) * src_format->bytes_per_pixel; + DWORD val; - if (colorkey) + /* extract source color components */ + pixel = dword_from_bytes(src_ptr, src_format->bytes_per_pixel); + + if (!src_format->to_rgba && !dst_format->from_rgba) { - get_relevant_argb_components(&ck_conv_info, pixel, channels); - pixel = make_argb_color(&ck_conv_info, channels); - if (pixel == colorkey) - val &= ~conv_info.destmask[0]; - } - } - else - { - struct vec4 color, tmp; + get_relevant_argb_components(&conv_info, pixel, channels); + val = make_argb_color(&conv_info, channels); - format_to_vec4(srcformat, &pixel, &color); - if (srcformat->to_rgba) - srcformat->to_rgba(&color, &tmp); + if (color_key) + { + get_relevant_argb_components(&ck_conv_info, pixel, channels); + pixel = make_argb_color(&ck_conv_info, channels); + if (pixel == color_key) + val &= ~conv_info.destmask[0]; + } + } else - tmp = color; - - if (ck_format) { - format_from_vec4(ck_format, &tmp, &pixel); - if (pixel == colorkey) - tmp.w = 0.0f; - } + struct vec4 color, tmp; - if (destformat->from_rgba) - destformat->from_rgba(&tmp, &color); - else - color = tmp; + format_to_vec4(src_format, &pixel, &color); + if (src_format->to_rgba) + src_format->to_rgba(&color, &tmp); + else + tmp = color; - format_from_vec4(destformat, &color, &val); - } + if (ck_format) + { + format_from_vec4(ck_format, &tmp, &pixel); + if (pixel == color_key) + tmp.w = 0.0f; + } - dword_to_bytes(destptr, val, destformat->bytes_per_pixel); - destptr += destformat->bytes_per_pixel; + if (dst_format->from_rgba) + dst_format->from_rgba(&tmp, &color); + else + color = tmp; + + format_from_vec4(dst_format, &color, &val); + } + + dword_to_bytes(dst_ptr, val, dst_format->bytes_per_pixel); + dst_ptr += dst_format->bytes_per_pixel; + } } } } @@ -1581,8 +1586,8 @@ HRESULT WINAPI D3DXLoadSurfaceFromMemory(IDirect3DSurface9 *dst_surface, /* Always apply a point filter until D3DX_FILTER_LINEAR, * D3DX_FILTER_TRIANGLE and D3DX_FILTER_BOX are implemented. */ - point_filter_simple_data(src_memory, src_pitch, src_size, srcformatdesc, - lockrect.pBits, lockrect.Pitch, dst_size, destformatdesc, color_key); + point_filter_simple_data(src_memory, src_pitch, 0, src_size, 1, srcformatdesc, + lockrect.pBits, lockrect.Pitch, 0, dst_size, 1, destformatdesc, color_key); } IDirect3DSurface9_UnlockRect(dst_surface); diff --git a/dlls/d3dx9_36/tests/volume.c b/dlls/d3dx9_36/tests/volume.c index f49a634..35cd509 100644 --- a/dlls/d3dx9_36/tests/volume.c +++ b/dlls/d3dx9_36/tests/volume.c @@ -93,7 +93,7 @@ static void test_D3DXLoadVolumeFromMemory(IDirect3DDevice9 *device) ok(hr == E_FAIL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, E_FAIL); hr = D3DXLoadVolumeFromMemory(volume, NULL, NULL, pixels, D3DFMT_A8R8G8B8, 16, 16, NULL, &src_box, D3DX_DEFAULT, 0); - todo_wine ok(hr == D3D_OK, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3D_OK); + ok(hr == D3D_OK, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3D_OK); hr = D3DXLoadVolumeFromMemory(volume, NULL, &dst_box, NULL, D3DFMT_A8R8G8B8, 16, 16, NULL, &src_box, D3DX_DEFAULT, 0); ok(hr == D3DERR_INVALIDCALL, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); diff --git a/dlls/d3dx9_36/volume.c b/dlls/d3dx9_36/volume.c index 90dbd29..ca7df62 100644 --- a/dlls/d3dx9_36/volume.c +++ b/dlls/d3dx9_36/volume.c @@ -226,8 +226,11 @@ HRESULT WINAPI D3DXLoadVolumeFromMemory(IDirect3DVolume9 *dst_volume, } else { - FIXME("Filtering for volume textures not implemented\n"); - return E_NOTIMPL; + if ((filter & 0xf) != D3DX_FILTER_POINT) + FIXME("Unhandled filter %#x.\n", filter); + + point_filter_simple_data(src_addr, src_row_pitch, src_slice_pitch, src_size, src_depth, src_format_desc, + locked_box.pBits, locked_box.RowPitch, locked_box.SlicePitch, dst_size, dst_depth, dst_format_desc, color_key); } IDirect3DVolume9_UnlockBox(dst_volume);
1
0
0
0
Józef Kucia : d3dx9: Implement pixel format conversion for volume textures.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 5d4bc533434a1ab717efa71bca488ebf1bdb0772 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d4bc533434a1ab717efa71bc…
Author: Józef Kucia <joseph.kucia(a)gmail.com> Date: Fri Jul 13 17:21:52 2012 +0200 d3dx9: Implement pixel format conversion for volume textures. --- dlls/d3dx9_36/d3dx9_36_private.h | 4 + dlls/d3dx9_36/surface.c | 121 ++++++++++++++++++++----------------- dlls/d3dx9_36/tests/volume.c | 17 +++++- dlls/d3dx9_36/volume.c | 39 ++++++++++++- 4 files changed, 122 insertions(+), 59 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5d4bc533434a1ab717efa…
1
0
0
0
Jacek Caban : jscript: Don' t set constructor property to each object instance, it belongs to their prototypes.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: d0aa78c0961846be4ffcbd9384e6995cb977915d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d0aa78c0961846be4ffcbd938…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jul 16 15:32:15 2012 +0200 jscript: Don't set constructor property to each object instance, it belongs to their prototypes. --- dlls/jscript/dispex.c | 28 ++++++++++++---------------- dlls/jscript/function.c | 4 +++- dlls/jscript/jscript.h | 1 + dlls/jscript/tests/lang.js | 15 ++++++++++++--- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 44008bd..909ed37 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -922,7 +922,6 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built dispex_prop_t *prop; HRESULT hres; - static const WCHAR constructorW[] = {'c','o','n','s','t','r','u','c','t','o','r',0}; static const WCHAR prototypeW[] = {'p','r','o','t','o','t','y','p','e',0}; hres = find_prop_name_prot(constr, string_hash(prototypeW), prototypeW, &prop); @@ -947,21 +946,6 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built if(prot) jsdisp_release(prot); - if(FAILED(hres)) - return hres; - - hres = ensure_prop_name(dispex, constructorW, FALSE, 0, &prop); - if(SUCCEEDED(hres)) { - jsexcept_t jsexcept; - VARIANT var; - - var_set_jsdisp(&var, constr); - memset(&jsexcept, 0, sizeof(jsexcept)); - hres = prop_put(dispex, prop, &var, &jsexcept, NULL/*FIXME*/); - } - if(FAILED(hres)) - jsdisp_release(dispex); - return hres; } @@ -1245,6 +1229,18 @@ HRESULT jsdisp_propput_const(jsdisp_t *obj, const WCHAR *name, VARIANT *val) return VariantCopy(&prop->u.var, val); } +HRESULT jsdisp_propput_dontenum(jsdisp_t *obj, const WCHAR *name, VARIANT *val) +{ + dispex_prop_t *prop; + HRESULT hres; + + hres = ensure_prop_name(obj, name, FALSE, 0, &prop); + if(FAILED(hres)) + return hres; + + return VariantCopy(&prop->u.var, val); +} + HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, VARIANT *val, jsexcept_t *ei) { WCHAR buf[12]; diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 1d188e7..1ce1124 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -647,7 +647,7 @@ static HRESULT set_constructor_prop(script_ctx_t *ctx, jsdisp_t *constr, jsdisp_ V_VT(&v) = VT_DISPATCH; V_DISPATCH(&v) = to_disp(constr); - return jsdisp_propput_name(prot, constructorW, &v, NULL); + return jsdisp_propput_dontenum(prot, constructorW, &v); } HRESULT create_builtin_constructor(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, @@ -684,6 +684,8 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod hres = create_function(ctx, NULL, PROPF_CONSTR, FALSE, NULL, &function); if(SUCCEEDED(hres)) { hres = set_prototype(ctx, &function->dispex, prototype); + if(SUCCEEDED(hres)) + hres = set_constructor_prop(ctx, &function->dispex, prototype); if(FAILED(hres)) jsdisp_release(&function->dispex); } diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index ca91ee6..484049c 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -216,6 +216,7 @@ HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*) DECLS HRESULT jsdisp_propget(jsdisp_t*,DISPID,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN; +HRESULT jsdisp_propput_dontenum(jsdisp_t*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 515f1b5..26a28b8 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -91,8 +91,15 @@ ok(Function.prototype.prototype === undefined, "Function.prototype.prototype is ok(Date.prototype !== undefined, "Date.prototype is undefined"); ok(Date.prototype.prototype === undefined, "Date.prototype is not undefined"); -function testConstructor(constr, name) { +function testConstructor(constr, name, inst) { ok(constr.prototype.constructor === constr, name + ".prototype.constructor !== " + name); + ok(constr.prototype.hasOwnProperty("constructor"), name + ".prototype.hasOwnProperty('constructor')"); + + if(!inst) + inst = new constr(); + + ok(inst.constructor === constr, "(new " + name + "()).constructor !== " + name); + ok(!inst.hasOwnProperty("constructor"), "(new " + name + "()).hasOwnProperty('constructor')"); } testConstructor(Object, "Object"); @@ -100,10 +107,10 @@ testConstructor(String, "String"); testConstructor(Array, "Array"); testConstructor(Boolean, "Boolean"); testConstructor(Number, "Number"); -testConstructor(RegExp, "RegExp"); +testConstructor(RegExp, "RegExp", /x/); testConstructor(Function, "Function"); testConstructor(Date, "Date"); -testConstructor(VBArray, "VBArray"); +testConstructor(VBArray, "VBArray", new VBArray(createArray())); testConstructor(Error, "Error"); testConstructor(EvalError, "EvalError"); testConstructor(RangeError, "RangeError"); @@ -194,11 +201,13 @@ function testConstr1() { } testConstr1.prototype.pvar = 1; +ok(testConstr1.prototype.constructor === testConstr1, "testConstr1.prototype.constructor !== testConstr1"); var obj2 = new testConstr1(true); ok(typeof(obj2) === "object", "typeof(obj2) is not object"); ok(obj2.constructor === testConstr1, "unexpected obj2.constructor"); ok(obj2.pvar === 1, "obj2.pvar is not 1"); +ok(!obj2.hasOwnProperty('constructor'), "obj2.hasOwnProperty('constructor')"); testConstr1.prototype.pvar = 2; ok(obj2.pvar === 2, "obj2.pvar is not 2");
1
0
0
0
Jacek Caban : jscript: Expose RegExpError constructor in global object.
by Alexandre Julliard
16 Jul '12
16 Jul '12
Module: wine Branch: master Commit: 49fd90320581cdc72068824d0804eeaa8eeae0df URL:
http://source.winehq.org/git/wine.git/?a=commit;h=49fd90320581cdc72068824d0…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jul 16 15:31:58 2012 +0200 jscript: Expose RegExpError constructor in global object. --- dlls/jscript/global.c | 10 ++++++++++ dlls/jscript/tests/api.js | 1 + dlls/jscript/tests/lang.js | 2 +- 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index f50debf..23a36eb 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -48,6 +48,7 @@ static const WCHAR NumberW[] = {'N','u','m','b','e','r',0}; static const WCHAR ObjectW[] = {'O','b','j','e','c','t',0}; static const WCHAR StringW[] = {'S','t','r','i','n','g',0}; static const WCHAR RegExpW[] = {'R','e','g','E','x','p',0}; +static const WCHAR RegExpErrorW[] = {'R','e','g','E','x','p','E','r','r','o','r',0}; static const WCHAR ActiveXObjectW[] = {'A','c','t','i','v','e','X','O','b','j','e','c','t',0}; static const WCHAR VBArrayW[] = {'V','B','A','r','r','a','y',0}; static const WCHAR EnumeratorW[] = {'E','n','u','m','e','r','a','t','o','r',0}; @@ -172,6 +173,14 @@ static HRESULT JSGlobal_RangeError(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag return constructor_call(ctx->range_error_constr, flags, argc, argv, retv, ei); } +static HRESULT JSGlobal_RegExpError(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv, + VARIANT *retv, jsexcept_t *ei) +{ + TRACE("\n"); + + return constructor_call(ctx->regexp_error_constr, flags, argc, argv, retv, ei); +} + static HRESULT JSGlobal_ReferenceError(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei) { @@ -1155,6 +1164,7 @@ static const builtin_prop_t JSGlobal_props[] = { {RangeErrorW, JSGlobal_RangeError, PROPF_CONSTR|1}, {ReferenceErrorW, JSGlobal_ReferenceError, PROPF_CONSTR|1}, {RegExpW, JSGlobal_RegExp, PROPF_CONSTR|2}, + {RegExpErrorW, JSGlobal_RegExpError, PROPF_CONSTR|1}, {ScriptEngineW, JSGlobal_ScriptEngine, PROPF_METHOD}, {ScriptEngineBuildVersionW, JSGlobal_ScriptEngineBuildVersion, PROPF_METHOD}, {ScriptEngineMajorVersionW, JSGlobal_ScriptEngineMajorVersion, PROPF_METHOD}, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index ac909b2..f6b22d3 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2545,6 +2545,7 @@ ok(Date.length == 7, "Date.length = " + Date.length); ok(Enumerator.length == 7, "Enumerator.length = " + Enumerator.length); ok(Error.length == 1, "Error.length = " + Error.length); ok(EvalError.length == 1, "EvalError.length = " + EvalError.length); +ok(RegExpError.length == 1, "RegExpError.length = " + RegExpError.length); ok(Function.length == 1, "Function.length = " + Function.length); ok(GetObject.length == 2, "GetObject.length = " + GetObject.length); ok(Number.length == 1, "Number.length = " + Number.length); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 78e7782..515f1b5 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -108,7 +108,7 @@ testConstructor(Error, "Error"); testConstructor(EvalError, "EvalError"); testConstructor(RangeError, "RangeError"); testConstructor(ReferenceError, "ReferenceError"); -//testConstructor(RegExpError, "RegExpError"); +testConstructor(RegExpError, "RegExpError"); testConstructor(SyntaxError, "SyntaxError"); testConstructor(TypeError, "TypeError"); testConstructor(URIError, "URIError");
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
72
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Results per page:
10
25
50
100
200