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
January 2016
----- 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
627 discussions
Start a n
N
ew thread
Paul Gofman : ole32: Fix behaviour of OLE init/uninit.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: b4b0c138fe6e5058270f4de7e2a9144a431335ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b4b0c138fe6e5058270f4de7e…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Fri Jan 15 13:29:31 2016 +0300 ole32: Fix behaviour of OLE init/uninit. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/compobj.c | 2 ++ dlls/ole32/ole2.c | 7 +++++ dlls/ole32/tests/compobj.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index 90b049a..080940e 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -1972,6 +1972,8 @@ void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void) if (!--info->inits) { + if (info->ole_inits) + WARN("uninitializing apartment while Ole is still initialized\n"); apartment_release(info->apt); info->apt = NULL; } diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index 7929d3d..f078fb6 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -186,6 +186,8 @@ HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved) if (!COM_CurrentInfo()->ole_inits) hr = S_OK; + else + hr = S_FALSE; /* * Then, it has to initialize the OLE specific modules. @@ -229,6 +231,11 @@ void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void) { TRACE("()\n"); + if (COM_CurrentInfo()->ole_inits == 0) + { + WARN("ole_inits is already 0\n"); + return ; + } /* * If we hit the bottom of the lock stack, free the libraries. */ diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index 5fe9876..6fa6dfc 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -2181,6 +2181,73 @@ static void test_CoInitializeEx(void) OleUninitialize(); } +static void test_OleInitialize_InitCounting(void) +{ + HRESULT hr; + IUnknown *pUnk; + REFCLSID rclsid = &CLSID_InternetZoneManager; + + /* 1. OleInitialize fails but OleUnintialize is still called: apartment stays inited */ + hr = pCoInitializeEx(NULL, COINIT_MULTITHREADED); + ok(hr == S_OK, "CoInitializeEx(COINIT_MULTITHREADED) failed with error 0x%08x\n", hr); + + hr = OleInitialize(NULL); + ok(hr == RPC_E_CHANGED_MODE, "OleInitialize should have returned 0x%08x instead of 0x%08x\n", RPC_E_CHANGED_MODE, hr); + OleUninitialize(); + + pUnk = (IUnknown *)0xdeadbeef; + hr = CoCreateInstance(rclsid, NULL, 0x17, &IID_IUnknown, (void **)&pUnk); + ok(hr == S_OK, "CoCreateInstance should have returned 0x%08x instead of 0x%08x\n", S_OK, hr); + if (pUnk) IUnknown_Release(pUnk); + + CoUninitialize(); + + /* 2. Extra multiple OleUninitialize: apartment stays inited until CoUnitialize */ + hr = CoInitialize(NULL); + ok(hr == S_OK, "CoInitialize() failed with error 0x%08x\n", hr); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize should have returned 0x%08x instead of 0x%08x\n", S_OK, hr); + OleUninitialize(); + OleUninitialize(); + OleUninitialize(); + + pUnk = (IUnknown *)0xdeadbeef; + hr = CoCreateInstance(rclsid, NULL, 0x17, &IID_IUnknown, (void **)&pUnk); + ok(hr == S_OK, "CoCreateInstance should have returned 0x%08x instead of 0x%08x\n", S_OK, hr); + if (pUnk) IUnknown_Release(pUnk); + + CoUninitialize(); + + pUnk = (IUnknown *)0xdeadbeef; + hr = CoCreateInstance(rclsid, NULL, 0x17, &IID_IUnknown, (void **)&pUnk); + ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned 0x%08x instead of 0x%08x\n", CO_E_NOTINITIALIZED, hr); + if (pUnk) IUnknown_Release(pUnk); + + /* 3. CoUninitialize does not formally deinit Ole */ + hr = CoInitialize(NULL); + ok(hr == S_OK, "CoInitialize() failed with error 0x%08x\n", hr); + + hr = OleInitialize(NULL); + ok(hr == S_OK, "OleInitialize should have returned 0x%08x instead of 0x%08x\n", S_OK, hr); + + CoUninitialize(); + CoUninitialize(); + + pUnk = (IUnknown *)0xdeadbeef; + hr = CoCreateInstance(rclsid, NULL, 0x17, &IID_IUnknown, (void **)&pUnk); + ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned 0x%08x instead of 0x%08x\n", CO_E_NOTINITIALIZED, hr); + /* COM is not initialized anymore */ + if (pUnk) IUnknown_Release(pUnk); + + hr = OleInitialize(NULL); + ok(hr == S_FALSE, "OleInitialize should have returned 0x%08x instead of 0x%08x\n", S_FALSE, hr); + /* ... but native OleInit returns S_FALSE as if Ole is considered initialized */ + + OleUninitialize(); + +} + static void test_OleRegGetMiscStatus(void) { ULONG_PTR cookie; @@ -2871,6 +2938,7 @@ START_TEST(compobj) test_CoGetContextToken(); test_TreatAsClass(); test_CoInitializeEx(); + test_OleInitialize_InitCounting(); test_OleRegGetMiscStatus(); test_CoCreateGuid(); test_CoWaitForMultipleHandles();
1
0
0
0
Akihiro Sagawa : gdi32: Implement synthesizing bold glyphs for bitmap fonts.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: a8d426e93a735a89c3116207d44b1fd4a82b2fd5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a8d426e93a735a89c3116207d…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Jan 13 23:09:11 2016 +0900 gdi32: Implement synthesizing bold glyphs for bitmap fonts. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 569dc02..ea81ee1 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6917,8 +6917,10 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, } metrics = ft_face->glyph->metrics; - if(font->fake_bold) - get_bold_glyph_outline(ft_face->glyph, font->ppem, &metrics); + if(font->fake_bold) { + if (!get_bold_glyph_outline(ft_face->glyph, font->ppem, &metrics) && metrics.width) + metrics.width += 1 << 6; + } /* Some poorly-created fonts contain glyphs that exceed the boundaries set * by the text metrics. The proper behavior is to clip the glyph metrics to @@ -7068,7 +7070,17 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, INT w = min( pitch, (ft_face->glyph->bitmap.width + 7) >> 3 ); INT h = min( height, ft_face->glyph->bitmap.rows ); while(h--) { - memcpy(dst, src, w); + if (!font->fake_bold) + memcpy(dst, src, w); + else { + INT x; + dst[0] = 0; + for (x = 0; x < w; x++) { + dst[x ] = (dst[x] & 0x80) | (src[x] >> 1) | src[x]; + if (x+1 < pitch) + dst[x+1] = (src[x] & 0x01) << 7; + } + } src += ft_face->glyph->bitmap.pitch; dst += pitch; } @@ -7124,8 +7136,12 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, INT x; memset( buf, 0, needed ); while(h--) { - for(x = 0; x < pitch && x < ft_face->glyph->bitmap.width; x++) - if (src[x / 8] & masks[x % 8]) dst[x] = max_level; + for(x = 0; x < pitch && x < ft_face->glyph->bitmap.width; x++) { + if (src[x / 8] & masks[x % 8]) { + dst[x] = max_level; + if (font->fake_bold && x+1 < pitch) dst[x+1] = max_level; + } + } src += ft_face->glyph->bitmap.pitch; dst += pitch; } @@ -7199,7 +7215,10 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, for (x = 0; x < width && x < ft_face->glyph->bitmap.width; x++) { if ( src[x / 8] & masks[x % 8] ) + { ((unsigned int *)dst)[x] = ~0u; + if (font->fake_bold && x+1 < width) ((unsigned int *)dst)[x+1] = ~0u; + } } src += src_pitch; dst += pitch;
1
0
0
0
Akihiro Sagawa : gdi32: Return an boolean value whether synthesizing bold glyph is success.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: ba79c19d09a5943c80033f1896a10fe86448c13f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ba79c19d09a5943c80033f189…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Jan 13 23:09:09 2016 +0900 gdi32: Return an boolean value whether synthesizing bold glyph is success. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 52 ++++++++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 30 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index a5b320b..569dc02 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6400,40 +6400,32 @@ static inline FT_Vector normalize_vector(FT_Vector *vec) return out; } -static void synthesize_bold_glyph(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metrics *metrics) +static BOOL get_bold_glyph_outline(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metrics *metrics) { FT_Error err; - static UINT once; + FT_Pos strength; + FT_BBox bbox; - switch(glyph->format) { - case FT_GLYPH_FORMAT_OUTLINE: - { - FT_Pos strength; - FT_BBox bbox; - if(!pFT_Outline_Embolden) - break; - - strength = MulDiv(ppem, 1 << 6, 24); - err = pFT_Outline_Embolden(&glyph->outline, strength); - if(err) { - TRACE("FT_Ouline_Embolden returns %d, ignored\n", err); - break; - } + if(glyph->format != FT_GLYPH_FORMAT_OUTLINE) + return FALSE; + if(!pFT_Outline_Embolden) + return FALSE; - pFT_Outline_Get_CBox(&glyph->outline, &bbox); - metrics->width = bbox.xMax - bbox.xMin; - metrics->height = bbox.yMax - bbox.yMin; - metrics->horiBearingX = bbox.xMin; - metrics->horiBearingY = bbox.yMax; - metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2; - metrics->vertBearingY = (metrics->vertAdvance - metrics->height) / 2; - break; - } - default: - if (!once++) - WARN("Emboldening format 0x%x is not supported\n", glyph->format); - return; + strength = MulDiv(ppem, 1 << 6, 24); + err = pFT_Outline_Embolden(&glyph->outline, strength); + if(err) { + TRACE("FT_Ouline_Embolden returns %d\n", err); + return FALSE; } + + pFT_Outline_Get_CBox(&glyph->outline, &bbox); + metrics->width = bbox.xMax - bbox.xMin; + metrics->height = bbox.yMax - bbox.yMin; + metrics->horiBearingX = bbox.xMin; + metrics->horiBearingY = bbox.yMax; + metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2; + metrics->vertBearingY = (metrics->vertAdvance - metrics->height) / 2; + return TRUE; } static inline BYTE get_max_level( UINT format ) @@ -6926,7 +6918,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, metrics = ft_face->glyph->metrics; if(font->fake_bold) - synthesize_bold_glyph(ft_face->glyph, font->ppem, &metrics); + get_bold_glyph_outline(ft_face->glyph, font->ppem, &metrics); /* Some poorly-created fonts contain glyphs that exceed the boundaries set * by the text metrics. The proper behavior is to clip the glyph metrics to
1
0
0
0
Akihiro Sagawa : gdi32: Fix the advance width in synthetic bold glyphs with scaling.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: 34e73617903da1f73f628d1eca355a9e2173da2e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=34e73617903da1f73f628d1ec…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Jan 13 23:09:08 2016 +0900 gdi32: Fix the advance width in synthetic bold glyphs with scaling. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 31 ++++++++++++++++++++++++++++--- dlls/gdi32/tests/font.c | 2 +- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 8550020..a5b320b 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -162,6 +162,7 @@ MAKE_FUNCPTR(FT_Render_Glyph); MAKE_FUNCPTR(FT_Select_Charmap); MAKE_FUNCPTR(FT_Set_Charmap); MAKE_FUNCPTR(FT_Set_Pixel_Sizes); +MAKE_FUNCPTR(FT_Vector_Length); MAKE_FUNCPTR(FT_Vector_Transform); MAKE_FUNCPTR(FT_Vector_Unit); static FT_Error (*pFT_Outline_Embolden)(FT_Outline *, FT_Pos); @@ -4084,6 +4085,7 @@ static BOOL init_freetype(void) LOAD_FUNCPTR(FT_Select_Charmap) LOAD_FUNCPTR(FT_Set_Charmap) LOAD_FUNCPTR(FT_Set_Pixel_Sizes) + LOAD_FUNCPTR(FT_Vector_Length) LOAD_FUNCPTR(FT_Vector_Transform) LOAD_FUNCPTR(FT_Vector_Unit) #undef LOAD_FUNCPTR @@ -6384,6 +6386,20 @@ static inline BOOL is_identity_MAT2(const MAT2 *matrix) return !memcmp(matrix, &identity, sizeof(MAT2)); } +static inline FT_Vector normalize_vector(FT_Vector *vec) +{ + FT_Vector out; + FT_Fixed len; + len = pFT_Vector_Length(vec); + if (len) { + out.x = (vec->x << 6) / len; + out.y = (vec->y << 6) / len; + } + else + out.x = out.y = 0; + return out; +} + static void synthesize_bold_glyph(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metrics *metrics) { FT_Error err; @@ -6409,8 +6425,6 @@ static void synthesize_bold_glyph(FT_GlyphSlot glyph, LONG ppem, FT_Glyph_Metric metrics->height = bbox.yMax - bbox.yMin; metrics->horiBearingX = bbox.xMin; metrics->horiBearingY = bbox.yMax; - metrics->horiAdvance += (1 << 6); - metrics->vertAdvance += (1 << 6); metrics->vertBearingX = metrics->horiBearingX - metrics->horiAdvance / 2; metrics->vertBearingY = (metrics->vertAdvance - metrics->height) / 2; break; @@ -6466,7 +6480,6 @@ static FT_Vector get_advance_metric(GdiFont *incoming_font, GdiFont *font, halfwidth characters. */ if(FT_IS_SCALABLE(incoming_font->ft_face) && (incoming_font->potm || get_outline_text_metrics(incoming_font)) && - !font->fake_bold && !(incoming_font->potm->otmTextMetrics.tmPitchAndFamily & TMPF_FIXED_PITCH)) { UINT avg_advance; em_scale = MulDiv(incoming_font->ppem, 1 << 16, @@ -6490,6 +6503,18 @@ static FT_Vector get_advance_metric(GdiFont *incoming_font, GdiFont *font, } } + if (font->fake_bold) { + if (!transMat) + adv.x += 1 << 6; + else { + FT_Vector fake_bold_adv, vec = { 1 << 6, 0 }; + pFT_Vector_Transform(&vec, transMat); + fake_bold_adv = normalize_vector(&vec); + adv.x += fake_bold_adv.x; + adv.y += fake_bold_adv.y; + } + } + adv.x = (adv.x + 63) & -64; adv.y = -((adv.y + 63) & -64); return adv; diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 417b722..b5ce93e 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -6365,7 +6365,7 @@ static void test_fake_bold_font(void) ok(data[0].w + 1 == data[1].w, "expected %d, got %d\n", data[0].w + 1, data[1].w); - todo_wine ok(data[0].gm.gmCellIncX + 1 == data[1].gm.gmCellIncX, + ok(data[0].gm.gmCellIncX + 1 == data[1].gm.gmCellIncX, "expected %d, got %d\n", data[0].gm.gmCellIncX + 1, data[1].gm.gmCellIncX); ok(data[0].gm.gmCellIncY == data[1].gm.gmCellIncY, "expected %d, got %d\n", data[0].gm.gmCellIncY, data[1].gm.gmCellIncY);
1
0
0
0
Akihiro Sagawa : gdi32: Add a helper function to calculate the glyph advance metric.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: f0831ecd2fe3328e4c0b0a2acdad4254cd6dba04 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f0831ecd2fe3328e4c0b0a2ac…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Wed Jan 13 23:09:06 2016 +0900 gdi32: Add a helper function to calculate the glyph advance metric. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/freetype.c | 114 ++++++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 54 deletions(-) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index f7cd0ee..8550020 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6444,6 +6444,57 @@ static BOOL check_unicode_tategaki(WCHAR uchar) return (orientation == 1 || orientation == 3); } +static FT_Vector get_advance_metric(GdiFont *incoming_font, GdiFont *font, + const FT_Glyph_Metrics *metrics, + const FT_Matrix *transMat, BOOL vertical_metrics) +{ + FT_Vector adv; + FT_Fixed base_advance, em_scale = 0; + BOOL fixed_pitch_full = FALSE; + + if (vertical_metrics) + base_advance = metrics->vertAdvance; + else + base_advance = metrics->horiAdvance; + + adv.x = base_advance; + adv.y = 0; + + /* In fixed-pitch font, we adjust the fullwidth character advance so that + they have double halfwidth character width. E.g. if the font is 19 ppem, + we return 20 (not 19) for fullwidth characters as we return 10 for + halfwidth characters. */ + if(FT_IS_SCALABLE(incoming_font->ft_face) && + (incoming_font->potm || get_outline_text_metrics(incoming_font)) && + !font->fake_bold && + !(incoming_font->potm->otmTextMetrics.tmPitchAndFamily & TMPF_FIXED_PITCH)) { + UINT avg_advance; + em_scale = MulDiv(incoming_font->ppem, 1 << 16, + incoming_font->ft_face->units_per_EM); + avg_advance = pFT_MulFix(incoming_font->ntmAvgWidth, em_scale); + fixed_pitch_full = (avg_advance > 0 && + (base_advance + 63) >> 6 == + pFT_MulFix(incoming_font->ntmAvgWidth*2, em_scale)); + if (fixed_pitch_full && !transMat) + adv.x = (avg_advance * 2) << 6; + } + + if (transMat) { + pFT_Vector_Transform(&adv, transMat); + if (fixed_pitch_full && adv.y == 0) { + FT_Vector vec; + vec.x = incoming_font->ntmAvgWidth; + vec.y = 0; + pFT_Vector_Transform(&vec, transMat); + adv.x = (pFT_MulFix(vec.x, em_scale) * 2) << 6; + } + } + + adv.x = (adv.x + 63) & -64; + adv.y = -((adv.y + 63) & -64); + return adv; +} + static unsigned int get_native_glyph_outline(FT_Outline *outline, unsigned int buflen, char *buf) { TTPOLYGONHEADER *pph; @@ -6656,7 +6707,8 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, DWORD width, height, pitch, needed = 0; FT_Bitmap ft_bitmap; FT_Error err; - INT left, right, top = 0, bottom = 0, adv; + INT left, right, top = 0, bottom = 0; + FT_Vector adv; INT origin_x = 0, origin_y = 0; FT_Angle angle = 0; FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; @@ -6668,8 +6720,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, BOOL tategaki = (font->name[0] == '@'); BOOL vertical_metrics; UINT original_index; - LONG avgAdvance = 0; - FT_Fixed em_scale; TRACE("%p, %04x, %08x, %p, %08x, %p, %p\n", font, glyph, format, lpgm, buflen, buf, lpmat); @@ -6868,32 +6918,13 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, /* metrics.width = min( metrics.width, ptm->tmMaxCharWidth << 6 ); */ } - em_scale = MulDiv(incoming_font->ppem, 1 << 16, incoming_font->ft_face->units_per_EM); - - if(FT_IS_SCALABLE(incoming_font->ft_face) && !font->fake_bold) { - TEXTMETRICW tm; - if (get_text_metrics(incoming_font, &tm) && - !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH)) { - avgAdvance = pFT_MulFix(incoming_font->ntmAvgWidth, em_scale); - if (avgAdvance && - (metrics.horiAdvance+63) >> 6 == pFT_MulFix(incoming_font->ntmAvgWidth*2, em_scale)) - TRACE("Fixed-pitch full-width character detected\n"); - else - avgAdvance = 0; /* cancel this feature */ - } - } - if(!needsTransform) { left = (INT)(metrics.horiBearingX) & -64; right = (INT)((metrics.horiBearingX + metrics.width) + 63) & -64; - if (!avgAdvance) - adv = (INT)(metrics.horiAdvance + 63) >> 6; - else - adv = (INT)avgAdvance * 2; - top = (metrics.horiBearingY + 63) & -64; bottom = (metrics.horiBearingY - metrics.height) & -64; - gm.gmCellIncX = adv; + adv = get_advance_metric(incoming_font, font, &metrics, NULL, vertical_metrics); + gm.gmCellIncX = adv.x >> 6; gm.gmCellIncY = 0; origin_x = left; origin_y = top; @@ -6949,36 +6980,11 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, } TRACE("transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom); - if (vertical_metrics) - vec.x = metrics.vertAdvance; - else - vec.x = metrics.horiAdvance; - vec.y = 0; - pFT_Vector_Transform(&vec, &transMat); - gm.gmCellIncY = -((vec.y+63) >> 6); - if (!avgAdvance || vec.y) - gm.gmCellIncX = (vec.x+63) >> 6; - else { - vec.x = incoming_font->ntmAvgWidth; - vec.y = 0; - pFT_Vector_Transform(&vec, &transMat); - gm.gmCellIncX = pFT_MulFix(vec.x, em_scale) * 2; - } + adv = get_advance_metric(incoming_font, font, &metrics, &transMat, vertical_metrics); + gm.gmCellIncX = adv.x >> 6; + gm.gmCellIncY = adv.y >> 6; - if (vertical_metrics) - vec.x = metrics.vertAdvance; - else - vec.x = metrics.horiAdvance; - vec.y = 0; - pFT_Vector_Transform(&vec, &transMatUnrotated); - if (!avgAdvance || vec.y) - adv = (vec.x+63) >> 6; - else { - vec.x = incoming_font->ntmAvgWidth; - vec.y = 0; - pFT_Vector_Transform(&vec, &transMatUnrotated); - adv = pFT_MulFix(vec.x, em_scale) * 2; - } + adv = get_advance_metric(incoming_font, font, &metrics, &transMatUnrotated, vertical_metrics); vec.x = lsb; vec.y = 0; @@ -7001,7 +7007,7 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format, gm.gmptGlyphOrigin.x = origin_x >> 6; gm.gmptGlyphOrigin.y = origin_y >> 6; if (!abc->abcB) abc->abcB = 1; - abc->abcC = adv - abc->abcA - abc->abcB; + abc->abcC = (adv.x >> 6) - abc->abcA - abc->abcB; TRACE("%u,%u,%s,%d,%d\n", gm.gmBlackBoxX, gm.gmBlackBoxY, wine_dbgstr_point(&gm.gmptGlyphOrigin),
1
0
0
0
Andrew Eikum : winegstreamer: Update to use gstreamer-1.0.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: e8311270ab7e01b8c58ec615f039335bd166882a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8311270ab7e01b8c58ec615f…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Thu Jan 14 13:23:04 2016 -0600 winegstreamer: Update to use gstreamer-1.0. Based on initial work by Rafał Mużyło. Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 93 +++---- configure.ac | 17 +- dlls/winegstreamer/gst_cbs.c | 93 +++---- dlls/winegstreamer/gst_cbs.h | 67 +++--- dlls/winegstreamer/gst_private.h | 4 +- dlls/winegstreamer/gstdemux.c | 507 ++++++++++++++++++++------------------- dlls/winegstreamer/gsttffilter.c | 201 ++++++++-------- dlls/winegstreamer/main.c | 4 +- 8 files changed, 464 insertions(+), 522 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=e8311270ab7e01b8c58ec…
1
0
0
0
Andrew Eikum : winegstreamer: Add TRACEs and improve formatting.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: 99894cf37cf9616800c33c47a102f58338f448a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=99894cf37cf9616800c33c47a…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Thu Jan 14 13:22:11 2016 -0600 winegstreamer: Add TRACEs and improve formatting. Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winegstreamer/gstdemux.c | 269 ++++++++++++++++++++++++++++----------- dlls/winegstreamer/gsttffilter.c | 130 +++++++++++++++---- dlls/winegstreamer/main.c | 6 +- 3 files changed, 305 insertions(+), 100 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=99894cf37cf9616800c33…
1
0
0
0
Nikolay Sivov : dwrite: Store locale name range attribute in lower case.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: 0874c7be151a420226d7c3f06ebdad2f0c1b3513 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0874c7be151a420226d7c3f06…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 15 00:24:24 2016 +0300 dwrite: Store locale name range attribute in lower case. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/layout.c | 4 +++- dlls/dwrite/tests/layout.c | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 9556827..57c8ddc 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -2158,8 +2158,10 @@ static BOOL set_layout_range_attrval(struct layout_range_header *h, enum layout_ break; case LAYOUT_RANGE_ATTR_LOCALE: changed = strcmpiW(dest->locale, value->u.locale) != 0; - if (changed) + if (changed) { strcpyW(dest->locale, value->u.locale); + strlwrW(dest->locale); + } break; case LAYOUT_RANGE_ATTR_FONTFAMILY: changed = strcmpW(dest->fontfamily, value->u.fontfamily) != 0; diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 919e6e9..c112ebd 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -2097,7 +2097,6 @@ if (0) /* crashes on native */ range.length = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 0, buffW, sizeof(buffW)/sizeof(WCHAR), &range); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW)); ok((range.startPosition == 0 && range.length == ~0u) || broken(range.startPosition == 0 && range.length == 4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); @@ -2107,7 +2106,6 @@ todo_wine range.length = 0; hr = IDWriteTextLayout_GetLocaleName(layout, 100, buffW, sizeof(buffW)/sizeof(WCHAR), &range); ok(hr == S_OK, "got 0x%08x\n", hr); -todo_wine ok(!lstrcmpW(buffW, enusW), "got %s\n", wine_dbgstr_w(buffW)); ok((range.startPosition == 0 && range.length == ~0u) || broken(range.startPosition == 4 && range.length == ~0u-4) /* vista/win7 */, "got %u,%u\n", range.startPosition, range.length); @@ -4418,7 +4416,7 @@ todo_wine flush_sequence(sequences, RENDERER_ID); hr = IDWriteTextLayout_Draw(layout, NULL, &testrenderer, 0.0f, 0.0f); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, RENDERER_ID, drawunderline3_seq, "draw underline test 2", TRUE); + ok_sequence(sequences, RENDERER_ID, drawunderline3_seq, "draw underline test 2", FALSE); IDWriteTextLayout_Release(layout);
1
0
0
0
Nikolay Sivov : dwrite: Implement support for underlines.
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: c5fce83f3db14858f38cc9cf460ceade450d6b15 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5fce83f3db14858f38cc9cf4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Jan 15 00:24:23 2016 +0300 dwrite: Implement support for underlines. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/layout.c | 192 ++++++++++++++++++++++++++++++++++++++++----- dlls/dwrite/tests/layout.c | 33 +++++++- 2 files changed, 203 insertions(+), 22 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=c5fce83f3db14858f38cc…
1
0
0
0
Nikolay Sivov : ole2disp: Implement SafeArrayAccessData()/ SafeArrayUnaccessData().
by Alexandre Julliard
15 Jan '16
15 Jan '16
Module: wine Branch: master Commit: cfbac8d2ed4b79b42952e9cc99f656cfe967088a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cfbac8d2ed4b79b42952e9cc9…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 14 23:34:17 2016 +0300 ole2disp: Implement SafeArrayAccessData()/SafeArrayUnaccessData(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole2disp.dll16/ole2disp.c | 43 +++++++++++++++++++++++++++++---- dlls/ole2disp.dll16/ole2disp.dll16.spec | 4 +-- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/dlls/ole2disp.dll16/ole2disp.c b/dlls/ole2disp.dll16/ole2disp.c index af6f03c..d61b5e8 100644 --- a/dlls/ole2disp.dll16/ole2disp.c +++ b/dlls/ole2disp.dll16/ole2disp.c @@ -89,6 +89,15 @@ static ULONG safearray_getcellcount(const SAFEARRAY16 *sa) return cells; } +static HRESULT safearray_lock(SAFEARRAY16 *sa) +{ + if (sa->cLocks == 0xffff) + return E_UNEXPECTED; + + sa->cLocks++; + return S_OK; +} + /****************************************************************************** * SafeArrayGetDim [OLE2DISP.17] */ @@ -117,11 +126,7 @@ HRESULT WINAPI SafeArrayLock16(SAFEARRAY16 *sa) if (!sa) return E_INVALIDARG16; - if (sa->cLocks == 0xffff) - return E_UNEXPECTED; - - sa->cLocks++; - return S_OK; + return safearray_lock(sa); } /****************************************************************************** @@ -142,6 +147,34 @@ HRESULT WINAPI SafeArrayUnlock16(SAFEARRAY16 *sa) } /****************************************************************************** + * SafeArrayAccessData [OLE2DISP.23] + */ +HRESULT WINAPI SafeArrayAccessData16(SAFEARRAY16 *sa, SEGPTR *data) +{ + HRESULT hr; + + TRACE("(%p, %p)\n", sa, data); + + /* arguments are not tested, it crashes if any of them is NULL */ + + hr = safearray_lock(sa); + if (FAILED(hr)) + return hr; + + *data = sa->pvData; + return S_OK; +} + +/****************************************************************************** + * SafeArrayUnaccessData [OLE2DISP.24] + */ +HRESULT WINAPI SafeArrayUnaccessData16(SAFEARRAY16 *sa) +{ + TRACE("(%p)\n", sa); + return SafeArrayUnlock16(sa); +} + +/****************************************************************************** * SafeArrayAllocDescriptor [OLE2DISP.38] */ HRESULT WINAPI SafeArrayAllocDescriptor16(UINT16 dims, SEGPTR *ret) diff --git a/dlls/ole2disp.dll16/ole2disp.dll16.spec b/dlls/ole2disp.dll16/ole2disp.dll16.spec index b0db920..4ee52e1 100644 --- a/dlls/ole2disp.dll16/ole2disp.dll16.spec +++ b/dlls/ole2disp.dll16/ole2disp.dll16.spec @@ -20,8 +20,8 @@ 20 stub SAFEARRAYGETLBOUND 21 pascal SafeArrayLock(ptr) SafeArrayLock16 22 pascal SafeArrayUnlock(ptr) SafeArrayUnlock16 -23 stub SAFEARRAYACCESSDATA -24 stub SAFEARRAYUNACCESSDATA +23 pascal SafeArrayAccessData(ptr ptr) SafeArrayAccessData16 +24 pascal SafeArrayUnaccessData(ptr) SafeArrayUnaccessData16 25 stub SAFEARRAYGETELEMENT 26 stub SAFEARRAYPUTELEMENT 27 stub SAFEARRAYCOPY
1
0
0
0
← Newer
1
...
34
35
36
37
38
39
40
...
63
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
Results per page:
10
25
50
100
200