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
August 2017
----- 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
351 discussions
Start a n
N
ew thread
Nikolay Sivov : dwrite: Use safer method to set per-factory system collection reference.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: db9990653c04dda75d0f54cfb4fd46f74ef7359a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=db9990653c04dda75d0f54cfb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 22 12:42:12 2017 +0300 dwrite: Use safer method to set per-factory system collection reference. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/main.c | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index a13b9fd..3d72a02 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -645,6 +645,27 @@ static struct collectionloader *factory_get_collection_loader(struct dwritefacto return found; } +static IDWriteFontCollection1 *factory_get_system_collection(struct dwritefactory *factory) +{ + IDWriteFontCollection1 *collection; + HRESULT hr; + + if (factory->system_collection) { + IDWriteFontCollection1_AddRef(factory->system_collection); + return factory->system_collection; + } + + if (FAILED(hr = get_system_fontcollection(&factory->IDWriteFactory5_iface, &collection))) { + WARN("Failed to create system font collection, hr %#x.\n", hr); + return NULL; + } + + if (InterlockedCompareExchangePointer((void **)&factory->system_collection, collection, NULL)) + IDWriteFontCollection1_Release(collection); + + return factory->system_collection; +} + static HRESULT WINAPI dwritefactory_QueryInterface(IDWriteFactory5 *iface, REFIID riid, void **obj) { struct dwritefactory *This = impl_from_IDWriteFactory5(iface); @@ -1095,21 +1116,23 @@ static HRESULT WINAPI dwritefactory_CreateTextFormat(IDWriteFactory5 *iface, WCH DWRITE_FONT_STRETCH stretch, FLOAT size, WCHAR const *locale, IDWriteTextFormat **format) { struct dwritefactory *This = impl_from_IDWriteFactory5(iface); - IDWriteFontCollection *syscollection = NULL; HRESULT hr; TRACE("(%p)->(%s %p %d %d %d %f %s %p)\n", This, debugstr_w(family_name), collection, weight, style, stretch, size, debugstr_w(locale), format); - if (!collection) { - hr = IDWriteFactory5_GetSystemFontCollection(iface, FALSE, (IDWriteFontCollection1**)&syscollection, FALSE); - if (FAILED(hr)) - return hr; + if (collection) + IDWriteFontCollection_AddRef(collection); + else { + collection = (IDWriteFontCollection *)factory_get_system_collection(This); + if (!collection) { + *format = NULL; + return E_FAIL; + } } - hr = create_textformat(family_name, collection ? collection : syscollection, weight, style, stretch, size, locale, format); - if (syscollection) - IDWriteFontCollection_Release(syscollection); + hr = create_textformat(family_name, collection, weight, style, stretch, size, locale, format); + IDWriteFontCollection_Release(collection); return hr; } @@ -1460,7 +1483,6 @@ static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory5 *if IDWriteFontCollection1 **collection, BOOL check_for_updates) { struct dwritefactory *This = impl_from_IDWriteFactory5(iface); - HRESULT hr = S_OK; TRACE("(%p)->(%d %p %d)\n", This, include_downloadable, collection, check_for_updates); @@ -1470,14 +1492,9 @@ static HRESULT WINAPI dwritefactory3_GetSystemFontCollection(IDWriteFactory5 *if if (check_for_updates) FIXME("checking for system font updates not implemented\n"); - if (This->system_collection) - IDWriteFontCollection1_AddRef(This->system_collection); - else - hr = get_system_fontcollection(iface, &This->system_collection); - - *collection = This->system_collection; + *collection = factory_get_system_collection(This); - return hr; + return *collection ? S_OK : E_FAIL; } static HRESULT WINAPI dwritefactory3_GetFontDownloadQueue(IDWriteFactory5 *iface, IDWriteFontDownloadQueue **queue) @@ -1783,8 +1800,7 @@ static void init_dwritefactory(struct dwritefactory *factory, DWRITE_FACTORY_TYP void factory_detach_fontcollection(IDWriteFactory5 *iface, IDWriteFontCollection1 *collection) { struct dwritefactory *factory = impl_from_IDWriteFactory5(iface); - if (factory->system_collection == collection) - factory->system_collection = NULL; + InterlockedCompareExchangePointer((void **)&factory->system_collection, NULL, collection); if (factory->eudc_collection == collection) factory->eudc_collection = NULL; IDWriteFactory5_Release(iface);
1
0
0
0
Nikolay Sivov : dwrite: Split initial cluster computation by stage.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 072a9b00cffd81599f40cd53a1bc38b27556f40d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=072a9b00cffd81599f40cd53a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 22 12:42:11 2017 +0300 dwrite: Split initial cluster computation by stage. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 5 +- dlls/dwrite/dwrite_private.h | 2 +- dlls/dwrite/layout.c | 374 ++++++++++++++++++++++++------------------- dlls/dwrite/main.c | 6 +- 4 files changed, 215 insertions(+), 172 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=072a9b00cffd81599f40c…
1
0
0
0
Nikolay Sivov : dwrite: Set drawing effect for trimming sign.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 5a70c58acd3d06ab610af8023dbaa75e4f987769 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5a70c58acd3d06ab610af8023…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 22 12:42:10 2017 +0300 dwrite: Set drawing effect for trimming sign. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/layout.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 9bf8d8d..76c3ad9 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -20,6 +20,7 @@ #define COBJMACROS +#include <assert.h> #include <stdarg.h> #include <math.h> @@ -164,8 +165,7 @@ struct regular_layout_run { UINT16 *clustermap; FLOAT *advances; DWRITE_GLYPH_OFFSET *offsets; - /* this is actual glyph count after shaping, it's not necessary the same as reported to Draw() */ - UINT32 glyphcount; + UINT32 glyphcount; /* actual glyph count after shaping, not necessarily the same as reported to Draw() */ }; struct layout_run { @@ -177,6 +177,7 @@ struct layout_run { } u; FLOAT baseline; FLOAT height; + UINT32 start_position; /* run text position in range [0, layout-text-length) */ }; struct layout_effective_run { @@ -487,7 +488,7 @@ static BOOL is_run_rtl(const struct layout_effective_run *run) return run->run->u.regular.run.bidiLevel & 1; } -static struct layout_run *alloc_layout_run(enum layout_run_kind kind) +static struct layout_run *alloc_layout_run(enum layout_run_kind kind, UINT32 start_position) { struct layout_run *ret; @@ -500,6 +501,7 @@ static struct layout_run *alloc_layout_run(enum layout_run_kind kind) ret->u.regular.sa.script = Script_Unknown; ret->u.regular.sa.shapes = DWRITE_SCRIPT_SHAPES_DEFAULT; } + ret->start_position = start_position; return ret; } @@ -695,6 +697,8 @@ static void layout_set_cluster_metrics(struct dwrite_textlayout *layout, const s const struct regular_layout_run *run = &r->u.regular; UINT32 i, start = 0; + assert(r->kind == LAYOUT_RUN_REGULAR); + for (i = 0; i < run->descr.stringLength; i++) { BOOL end = i == run->descr.stringLength - 1; @@ -781,7 +785,7 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) if (FAILED(hr)) return hr; - r = alloc_layout_run(LAYOUT_RUN_INLINE); + r = alloc_layout_run(LAYOUT_RUN_INLINE, range->h.range.startPosition); if (!r) return E_OUTOFMEMORY; @@ -891,13 +895,14 @@ static HRESULT layout_compute_runs(struct dwrite_textlayout *layout) struct layout_run *nextr; /* keep mapped part for current run, add another run for the rest */ - nextr = alloc_layout_run(LAYOUT_RUN_REGULAR); + nextr = alloc_layout_run(LAYOUT_RUN_REGULAR, 0); if (!nextr) return E_OUTOFMEMORY; *nextr = *r; + nextr->start_position = run->descr.textPosition + mapped_length; nextrun = &nextr->u.regular; - nextrun->descr.textPosition = run->descr.textPosition + mapped_length; + nextrun->descr.textPosition = nextr->start_position; nextrun->descr.stringLength = run->descr.stringLength - mapped_length; nextrun->descr.string = &layout->str[nextrun->descr.textPosition]; run->descr.stringLength = mapped_length; @@ -1228,7 +1233,8 @@ static HRESULT layout_add_effective_run(struct dwrite_textlayout *layout, const inlineobject->line = line; /* effect assigned from start position and on is used for inline objects */ - inlineobject->effect = layout_get_effect_from_pos(layout, layout->clusters[first_cluster].position); + inlineobject->effect = layout_get_effect_from_pos(layout, layout->clusters[first_cluster].position + + layout->clusters[first_cluster].run->start_position); list_add_tail(&layout->inlineobjects, &inlineobject->entry); return S_OK; @@ -1886,7 +1892,8 @@ static void layout_add_line(struct dwrite_textlayout *layout, UINT32 first_clust trimming_sign->is_rtl = FALSE; trimming_sign->line = line; - trimming_sign->effect = NULL; /* FIXME */ + trimming_sign->effect = layout_get_effect_from_pos(layout, layout->clusters[i].position + + layout->clusters[i].run->start_position); list_add_tail(&layout->inlineobjects, &trimming_sign->entry); } @@ -4504,7 +4511,7 @@ static HRESULT WINAPI dwritetextlayout_sink_SetScriptAnalysis(IDWriteTextAnalysi TRACE("[%u,%u) script=%u:%s\n", position, position + length, sa->script, debugstr_sa_script(sa->script)); - run = alloc_layout_run(LAYOUT_RUN_REGULAR); + run = alloc_layout_run(LAYOUT_RUN_REGULAR, position); if (!run) return E_OUTOFMEMORY; @@ -4564,7 +4571,7 @@ static HRESULT WINAPI dwritetextlayout_sink_SetBidiLevel(IDWriteTextAnalysisSink /* all fully covered runs are processed at this point, reuse existing run for remaining reported bidi range and add another run for the rest of original one */ - run = alloc_layout_run(LAYOUT_RUN_REGULAR); + run = alloc_layout_run(LAYOUT_RUN_REGULAR, position + length); if (!run) return E_OUTOFMEMORY;
1
0
0
0
Nikolay Sivov : dwrite: Use more readable names for spacing attributes.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 7fd7960b9d47a64ffd49484495dbd52cea547cce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7fd7960b9d47a64ffd4948449…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Aug 22 12:42:09 2017 +0300 dwrite: Use more readable names for spacing attributes. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/layout.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 2f59c0c..9bf8d8d 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -92,7 +92,11 @@ struct layout_range_attr_value { IDWriteFontCollection *collection; const WCHAR *locale; const WCHAR *fontfamily; - FLOAT spacing[3]; /* in arguments order - leading, trailing, advance */ + struct { + FLOAT leading; + FLOAT trailing; + FLOAT min_advance; + } spacing; IDWriteTypography *typography; } u; }; @@ -2095,9 +2099,9 @@ static BOOL is_same_layout_attrvalue(struct layout_range_header const *h, enum l case LAYOUT_RANGE_ATTR_FONTFAMILY: return strcmpW(range->fontfamily, value->u.fontfamily) == 0; case LAYOUT_RANGE_ATTR_SPACING: - return range_spacing->leading == value->u.spacing[0] && - range_spacing->trailing == value->u.spacing[1] && - range_spacing->min_advance == value->u.spacing[2]; + return range_spacing->leading == value->u.spacing.leading && + range_spacing->trailing == value->u.spacing.trailing && + range_spacing->min_advance == value->u.spacing.min_advance; case LAYOUT_RANGE_ATTR_TYPOGRAPHY: return range_iface->iface == (IUnknown*)value->u.typography; default: @@ -2484,12 +2488,12 @@ static BOOL set_layout_range_attrval(struct layout_range_header *h, enum layout_ } break; case LAYOUT_RANGE_ATTR_SPACING: - changed = dest_spacing->leading != value->u.spacing[0] || - dest_spacing->trailing != value->u.spacing[1] || - dest_spacing->min_advance != value->u.spacing[2]; - dest_spacing->leading = value->u.spacing[0]; - dest_spacing->trailing = value->u.spacing[1]; - dest_spacing->min_advance = value->u.spacing[2]; + changed = dest_spacing->leading != value->u.spacing.leading || + dest_spacing->trailing != value->u.spacing.trailing || + dest_spacing->min_advance != value->u.spacing.min_advance; + dest_spacing->leading = value->u.spacing.leading; + dest_spacing->trailing = value->u.spacing.trailing; + dest_spacing->min_advance = value->u.spacing.min_advance; break; case LAYOUT_RANGE_ATTR_TYPOGRAPHY: changed = set_layout_range_iface_attr((IUnknown**)&dest_iface->iface, (IUnknown*)value->u.typography); @@ -3791,9 +3795,9 @@ static HRESULT WINAPI dwritetextlayout1_SetCharacterSpacing(IDWriteTextLayout3 * return E_INVALIDARG; value.range = range; - value.u.spacing[0] = leading; - value.u.spacing[1] = trailing; - value.u.spacing[2] = min_advance; + value.u.spacing.leading = leading; + value.u.spacing.trailing = trailing; + value.u.spacing.min_advance = min_advance; return set_layout_range_attr(This, LAYOUT_RANGE_ATTR_SPACING, &value); }
1
0
0
0
Jacek Caban : mshtml.idl: Added IHTMLDocument8 declaration.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 95fa2733e5f5fce28ef9cd5b3f2735f9055267b8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=95fa2733e5f5fce28ef9cd5b3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 22 17:55:36 2017 +0200 mshtml.idl: Added IHTMLDocument8 declaration. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mshtmdid.h | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++- include/mshtml.idl | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 256 insertions(+), 1 deletion(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=95fa2733e5f5fce28ef9c…
1
0
0
0
Jacek Caban : mshtml: Added delayed DispatchEx init support and use it to expose IHTMLDOMNode3 from document node.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 856dc7eda432517d6e3c9b0c64e7e12ae4e38895 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=856dc7eda432517d6e3c9b0c6…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 21 21:35:57 2017 +0200 mshtml: Added delayed DispatchEx init support and use it to expose IHTMLDOMNode3 from document node. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/dispex.c | 63 ++++++++++++++++++++++++++++++++------- dlls/mshtml/htmldoc.c | 14 ++++++++- dlls/mshtml/htmlelem.c | 1 + dlls/mshtml/htmlwindow.c | 1 + dlls/mshtml/mshtml_private.h | 2 ++ dlls/mshtml/tests/documentmode.js | 17 +++++++++++ dlls/mshtml/tests/elements.js | 2 ++ dlls/mshtml/xmlhttprequest.c | 1 + 8 files changed, 90 insertions(+), 11 deletions(-) diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index baf251a..95c17b8 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -62,7 +62,7 @@ typedef struct { } func_info_t; struct dispex_data_t { - const dispex_static_data_t *desc; + dispex_static_data_t *desc; DWORD func_cnt; DWORD func_size; @@ -379,7 +379,7 @@ static int func_name_cmp(const void *p1, const void *p2) return strcmpiW((*(func_info_t* const*)p1)->name, (*(func_info_t* const*)p2)->name); } -static dispex_data_t *preprocess_dispex_data(const dispex_static_data_t *desc, compat_mode_t compat_mode) +static dispex_data_t *preprocess_dispex_data(dispex_static_data_t *desc, compat_mode_t compat_mode) { const tid_t *tid; dispex_data_t *data; @@ -1346,6 +1346,27 @@ HRESULT remove_attribute(DispatchEx *This, DISPID id, VARIANT_BOOL *success) } } +static dispex_data_t *ensure_dispex_info(dispex_static_data_t *desc, compat_mode_t compat_mode) +{ + if(!desc->info_cache[compat_mode]) { + EnterCriticalSection(&cs_dispex_static_data); + if(!desc->info_cache[compat_mode]) + desc->info_cache[compat_mode] = preprocess_dispex_data(desc, compat_mode); + LeaveCriticalSection(&cs_dispex_static_data); + } + return desc->info_cache[compat_mode]; +} + +static BOOL ensure_real_info(DispatchEx *dispex) +{ + if(dispex->info != dispex->info->desc->delayed_init_info) + return TRUE; + + dispex->info = ensure_dispex_info(dispex->info->desc, + dispex->info->desc->vtbl->get_compat_mode(dispex)); + return dispex->info != NULL; +} + static inline DispatchEx *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, DispatchEx, IDispatchEx_iface); @@ -1442,6 +1463,9 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %x\n", grfdex); + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + hres = get_builtin_id(This, bstrName, grfdex, pid); if(hres != DISP_E_UNKNOWNNAME) return hres; @@ -1462,6 +1486,9 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + if(wFlags == (DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF)) wFlags = DISPATCH_PROPERTYPUT; @@ -1572,6 +1599,9 @@ static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BS TRACE("(%p)->(%x %p)\n", This, id, pbstrName); + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + if(is_dynamic_dispid(id)) { DWORD idx = id - DISPID_DYNPROP_0; @@ -1617,6 +1647,9 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, TRACE("(%p)->(%x %x %p)\n", This, grfdex, id, pid); + if(!ensure_real_info(This)) + return E_OUTOFMEMORY; + if(is_dynamic_dispid(id)) { DWORD idx = id - DISPID_DYNPROP_0; @@ -1770,15 +1803,25 @@ void init_dispex_with_compat_mode(DispatchEx *dispex, IUnknown *outer, dispex_st { assert(compat_mode < COMPAT_MODE_CNT); - if(!data->info_cache[compat_mode]) { - EnterCriticalSection(&cs_dispex_static_data); - if(!data->info_cache[compat_mode]) - data->info_cache[compat_mode] = preprocess_dispex_data(data, compat_mode); - LeaveCriticalSection(&cs_dispex_static_data); - } - dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; dispex->outer = outer; - dispex->info = data->info_cache[compat_mode]; dispex->dynamic_data = NULL; + + if(data->vtbl && data->vtbl->get_compat_mode) { + /* delayed init */ + if(!data->delayed_init_info) { + EnterCriticalSection(&cs_dispex_static_data); + if(!data->delayed_init_info) { + dispex_data_t *info = heap_alloc_zero(sizeof(*data->delayed_init_info)); + if(info) { + info->desc = data; + data->delayed_init_info = info; + } + } + LeaveCriticalSection(&cs_dispex_static_data); + } + dispex->info = data->delayed_init_info; + }else { + dispex->info = ensure_dispex_info(data, compat_mode); + } } diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 3c16d2c..a8d104e 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -4813,6 +4813,16 @@ static HRESULT HTMLDocumentNode_invoke(DispatchEx *dispex, DISPID id, LCID lcid, return S_OK; } +static compat_mode_t HTMLDocumentNode_get_compat_mode(DispatchEx *dispex) +{ + HTMLDocumentNode *This = impl_from_DispatchEx(dispex); + + TRACE("(%p) returning %u\n", This, This->document_mode); + + This->document_mode_locked = TRUE; + return This->document_mode; +} + static void HTMLDocumentNode_bind_event(DispatchEx *dispex, int eid) { HTMLDocumentNode *This = impl_from_DispatchEx(dispex); @@ -4823,6 +4833,7 @@ static const dispex_static_data_vtbl_t HTMLDocumentNode_dispex_vtbl = { NULL, NULL, HTMLDocumentNode_invoke, + HTMLDocumentNode_get_compat_mode, NULL, NULL, HTMLDocumentNode_bind_event @@ -4851,7 +4862,8 @@ static const tid_t HTMLDocumentNode_iface_tids[] = { static dispex_static_data_t HTMLDocumentNode_dispex = { &HTMLDocumentNode_dispex_vtbl, DispHTMLDocument_tid, - HTMLDocumentNode_iface_tids + HTMLDocumentNode_iface_tids, + HTMLDOMNode_init_dispex_info }; static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindow *window) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 927541b..247948c 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -5319,6 +5319,7 @@ static dispex_static_data_vtbl_t HTMLElement_dispex_vtbl = { NULL, HTMLElement_get_dispid, HTMLElement_invoke, + NULL, HTMLElement_populate_props, HTMLElement_get_event_target, HTMLElement_bind_event diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 5853220..dc18f84 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3019,6 +3019,7 @@ static const dispex_static_data_vtbl_t HTMLWindow_dispex_vtbl = { NULL, HTMLWindow_invoke, NULL, + NULL, HTMLWindow_get_event_target, HTMLWindow_bind_event }; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 2ee34c1..f10a793 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -267,6 +267,7 @@ typedef struct { HRESULT (*value)(DispatchEx*,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); HRESULT (*get_dispid)(DispatchEx*,BSTR,DWORD,DISPID*); HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); + compat_mode_t (*get_compat_mode)(DispatchEx*); HRESULT (*populate_props)(DispatchEx*); /* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */ EventTarget *(*get_event_target)(DispatchEx*); @@ -279,6 +280,7 @@ typedef struct { const tid_t* const iface_tids; void (*init_info)(dispex_data_t*,compat_mode_t); dispex_data_t *info_cache[COMPAT_MODE_CNT]; + dispex_data_t *delayed_init_info; } dispex_static_data_t; struct DispatchEx { diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 69ec6a3..4224dfe 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -39,6 +39,22 @@ function test_elem_props() { next_test(); } +function test_doc_props() { + function test_exposed(prop, expect) { + if(expect) + ok(prop in document, prop + " not found in document."); + else + ok(!(prop in document), prop + " found in document."); + } + + var v = document.documentMode; + + test_exposed("textContent", v >= 9); + test_exposed("prefix", v >= 9); + + next_test(); +} + function test_doc_mode() { compat_version = parseInt(document.location.search.substring(1)); @@ -99,5 +115,6 @@ function test_conditional_comments() { var tests = [ test_doc_mode, test_elem_props, + test_doc_props, test_conditional_comments ]; diff --git a/dlls/mshtml/tests/elements.js b/dlls/mshtml/tests/elements.js index b7db0bc..ac1e2d0 100644 --- a/dlls/mshtml/tests/elements.js +++ b/dlls/mshtml/tests/elements.js @@ -77,6 +77,8 @@ function test_textContent() { ok(div.textContent === "", "div.textContent = " + div.textContent); ok(div.childNodes.length === 0, "div.childNodes.length = " + div.childNodes.length); + ok(document.textContent === null, "document.textContent = " + document.textContent); + next_test(); } diff --git a/dlls/mshtml/xmlhttprequest.c b/dlls/mshtml/xmlhttprequest.c index 1565f9b..35e91fc 100644 --- a/dlls/mshtml/xmlhttprequest.c +++ b/dlls/mshtml/xmlhttprequest.c @@ -778,6 +778,7 @@ static dispex_static_data_vtbl_t HTMLXMLHttpRequest_dispex_vtbl = { NULL, NULL, NULL, + NULL, HTMLXMLHttpRequest_bind_event };
1
0
0
0
Jacek Caban : mshtml: Don' t allow changing document mode after script insertion or when it' s already set.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: 53253aa6a42f767ab21052419e4e7454144f0aae URL:
http://source.winehq.org/git/wine.git/?a=commit;h=53253aa6a42f767ab21052419…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Aug 22 17:54:54 2017 +0200 mshtml: Don't allow changing document mode after script insertion or when it's already set. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/mshtml_private.h | 4 +++- dlls/mshtml/mutation.c | 16 ++++++++++--- dlls/mshtml/tests/dom.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 1e12a6e..2ee34c1 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -811,9 +811,11 @@ struct HTMLDocumentNode { LONG ref; - compat_mode_t document_mode; HTMLInnerWindow *window; + compat_mode_t document_mode; + BOOL document_mode_locked; + nsIDOMHTMLDocument *nsdoc; BOOL content_ready; diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c index 50e162e..cf69b60 100644 --- a/dlls/mshtml/mutation.c +++ b/dlls/mshtml/mutation.c @@ -370,9 +370,17 @@ static nsresult run_insert_script(HTMLDocumentNode *doc, nsISupports *script_ifa return NS_OK; } -static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode) +static void set_document_mode(HTMLDocumentNode *doc, compat_mode_t document_mode, BOOL lock) { + if(doc->document_mode_locked) { + WARN("attemting to set document mode %d on locked document %p\n", document_mode, doc); + return; + } + TRACE("%p: %d\n", doc, document_mode); + + if(lock) + doc->document_mode_locked = TRUE; doc->document_mode = document_mode; } @@ -444,7 +452,7 @@ static void process_meta_element(HTMLDocumentNode *doc, nsIDOMHTMLMetaElement *m if(!strcmpiW(http_equiv, x_ua_compatibleW)) { compat_mode_t document_mode; if(parse_ua_compatible(content, &document_mode)) - set_document_mode(doc, document_mode); + set_document_mode(doc, document_mode, TRUE); else FIXME("Unsupported document mode %s\n", debugstr_w(content)); } @@ -755,7 +763,7 @@ static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface, if(NS_SUCCEEDED(nsres)) { TRACE("doctype node\n"); /* FIXME: We should set it to something higher for internet zone. */ - set_document_mode(This, COMPAT_MODE_IE7); + set_document_mode(This, COMPAT_MODE_IE7, FALSE); nsIDOMDocumentType_Release(nsdoctype); } } @@ -814,6 +822,8 @@ static void NSAPI nsDocumentObserver_AttemptToExecuteScript(nsIDocumentObserver if(NS_SUCCEEDED(nsres)) { TRACE("script node\n"); + This->document_mode_locked = TRUE; + add_script_runner(This, run_insert_script, (nsISupports*)nsscript, (nsISupports*)aParser); nsIDOMHTMLScriptElement_Release(nsscript); } diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 5276166..c6053a6 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -10530,12 +10530,65 @@ static void run_domtest(const char *str, domtest_t test) "ref = %d\n", ref); } +static float expected_document_mode; + +static void test_document_mode(IHTMLDocument2 *doc2) +{ + IHTMLDocument6 *doc; + VARIANT v; + HRESULT hres; + + if(expected_document_mode >= 9) { + IHTMLDocument7 *doc7; + hres = IHTMLDocument2_QueryInterface(doc2, &IID_IHTMLDocument7, (void**)&doc7); + if(FAILED(hres)) { + win_skip("IHTMLDocument7 interface not supported: %08x\n", hres); + return; + } + IHTMLDocument7_Release(doc7); + } + + hres = IHTMLDocument2_QueryInterface(doc2, &IID_IHTMLDocument6, (void**)&doc); + ok(hres == S_OK, "Could not get IHTMLDocument6 interface: %08x\n", hres); + + V_VT(&v) = VT_EMPTY; + hres = IHTMLDocument6_get_documentMode(doc, &v); + ok(hres == S_OK, "get_documentMode failed: %08x\n", hres); + ok(V_VT(&v) == VT_R4, "V_VT(documentMode) = %u\n", V_VT(&v)); + ok(V_R4(&v) == expected_document_mode, "documentMode = %f\n", V_R4(&v)); + IHTMLDocument6_Release(doc); +} + static void test_quirks_mode(void) { run_domtest("<html></html>", check_quirks_mode); run_domtest("<!DOCTYPE html>\n<html></html>", check_strict_mode); run_domtest("<!-- comment --><!DOCTYPE html>\n<html></html>", check_quirks_mode); run_domtest("<html><body></body></html>", test_quirks_mode_offsetHeight); + + expected_document_mode = 5; + run_domtest("<html><body></body></html>", test_document_mode); + + expected_document_mode = 9; + run_domtest("<!DOCTYPE html>\n" + "<html>" + " <head>" + " <meta http-equiv=\"x-ua-compatible\" content=\"IE=9\" />" + " </head>" + " <body>" + " </body>" + "</html>", test_document_mode); + + expected_document_mode = 8; + run_domtest("<!DOCTYPE html>\n" + "<html>" + " <head>" + " <meta http-equiv=\"x-ua-compatible\" content=\"IE=8\" />" + " <meta http-equiv=\"x-ua-compatible\" content=\"IE=9\" />" + " </head>" + " <body>" + " </body>" + "</html>", test_document_mode); } START_TEST(dom)
1
0
0
0
Jacek Caban : mshtml: Return documentMode as VT_R4.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: bec8063948e64f32c85021381a8bea590de9d38c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bec8063948e64f32c85021381…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 21 21:34:47 2017 +0200 mshtml: Return documentMode as VT_R4. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmldoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index c216448..3c16d2c 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -3103,8 +3103,8 @@ static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface, VARI return E_UNEXPECTED; } - V_VT(p) = VT_I4; - V_I4(p) = compat_mode_info[This->doc_node->document_mode].document_mode; + V_VT(p) = VT_R4; + V_R4(p) = compat_mode_info[This->doc_node->document_mode].document_mode; return S_OK; }
1
0
0
0
Jacek Caban : jscript: Added support for VT_R4 VARIANT types.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: c25208f2af32c05d59cbdfa5946b1f74362030ca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c25208f2af32c05d59cbdfa59…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Aug 21 21:34:39 2017 +0200 jscript: Added support for VT_R4 VARIANT types. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/jsutils.c | 3 +++ dlls/jscript/tests/run.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index e7100ba..edfebcf 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -303,6 +303,9 @@ HRESULT variant_to_jsval(VARIANT *var, jsval_t *r) case VT_UI4: *r = jsval_number(V_UI4(var)); return S_OK; + case VT_R4: + *r = jsval_number(V_R4(var)); + return S_OK; case VT_UNKNOWN: if(V_UNKNOWN(var)) { IDispatch *disp; diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index ff6edce..1d42c54 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -1315,7 +1315,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, return S_OK; case DISPID_GLOBAL_TESTARGTYPES: { - VARIANT args[6], v; + VARIANT args[7], v; DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0}; HRESULT hres; @@ -1355,6 +1355,8 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, V_UI4(args+4) = 0xffffffff; V_VT(args+5) = VT_BYREF|VT_VARIANT; V_VARIANTREF(args+5) = &v; + V_VT(args+6) = VT_R4; + V_R4(args+6) = 0.5; V_VT(&v) = VT_I4; V_I4(&v) = 2; hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL); @@ -2644,7 +2646,8 @@ static BOOL run_tests(void) CHECK_CALLED(global_propargput_i); SET_EXPECT(global_testargtypes_i); - parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(i4ref,ui4,nullunk,d,i,s) {" + parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp," + "function(r4,i4ref,ui4,nullunk,d,i,s) {" " ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));" " ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));" " ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));" @@ -2654,6 +2657,8 @@ static BOOL run_tests(void) " ok(ui4 > 0, 'ui4 = ' + ui4);" " ok(getVT(i4ref) === 'VT_I4', 'getVT(i4ref) = ' + getVT(i4ref));" " ok(i4ref === 2, 'i4ref = ' + i4ref);" + " ok(r4 === 0.5, 'r4 = ' + r4);" + " ok(getVT(r4) === 'VT_R8', 'getVT(r4) = ' + getVT(r4));" "});"); CHECK_CALLED(global_testargtypes_i);
1
0
0
0
Dmitry Timoshkov : gdiplus/tests: Add a test for loading PNG grayscale images.
by Alexandre Julliard
24 Aug '17
24 Aug '17
Module: wine Branch: master Commit: ae65558ba180808c7ea7f802e13878e720f72a85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae65558ba180808c7ea7f802e…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Aug 21 11:12:30 2017 -0500 gdiplus/tests: Add a test for loading PNG grayscale images. Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/image.c | 60 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 225dc54..989c217 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -2,7 +2,7 @@ * Unit test suite for images * * Copyright (C) 2007 Google (Evan Stade) - * Copyright (C) 2012 Dmitry Timoshkov + * Copyright (C) 2012, 2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -4966,6 +4966,63 @@ static void test_imageabort(void) GdipDisposeImage((GpImage*)bm); } +/* RGB 24 bpp 1x1 pixel PNG image */ +static const char png_1x1_data[] = { + 0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a, + 0x00,0x00,0x00,0x0d,'I','H','D','R',0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x08,0x02,0x00,0x00,0x00,0x90,0x77,0x53,0xde, + 0x00,0x00,0x00,0x0c,'I','D','A','T',0x08,0xd7,0x63,0xf8,0xff,0xff,0x3f,0x00,0x05,0xfe,0x02,0xfe,0xdc,0xcc,0x59,0xe7, + 0x00,0x00,0x00,0x00,'I','E','N','D',0xae,0x42,0x60,0x82 +}; + +static void test_png_color_formats(void) +{ + static const struct + { + char bit_depth, color_type; + PixelFormat format; + } td[] = + { + /* 2 - PNG_COLOR_TYPE_RGB */ + { 8, 2, PixelFormat24bppRGB }, + /* 0 - PNG_COLOR_TYPE_GRAY */ + { 1, 0, PixelFormat1bppIndexed }, + { 2, 0, PixelFormat32bppARGB }, + { 4, 0, PixelFormat32bppARGB }, + { 8, 0, PixelFormat32bppARGB }, + { 16, 0, PixelFormat32bppARGB }, + }; + BYTE buf[sizeof(png_1x1_data)]; + GpStatus status; + GpImage *image; + ImageType type; + PixelFormat format; + int i; + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + memcpy(buf, png_1x1_data, sizeof(png_1x1_data)); + buf[24] = td[i].bit_depth; + buf[25] = td[i].color_type; + + image = load_image(buf, sizeof(buf)); + ok(image != NULL, "%d: failed to load image data\n", i); + if (!image) continue; + + status = GdipGetImageType(image, &type); + ok(status == Ok, "%u: GdipGetImageType error %d\n", i, status); + ok(type == ImageTypeBitmap, "%d: wrong image type %d\n", i, type); + + status = GdipGetImagePixelFormat(image, &format); + expect(Ok, status); +todo_wine_if(td[i].bit_depth == 8 && td[i].color_type == 0) + ok(format == td[i].format || + broken(td[i].bit_depth == 1 && td[i].color_type == 0 && format == PixelFormat32bppARGB), /* XP */ + "%d: expected %#x, got %#x\n", i, td[i].format, format); + + GdipDisposeImage(image); + } +} + START_TEST(image) { HMODULE mod = GetModuleHandleA("gdiplus.dll"); @@ -4990,6 +5047,7 @@ START_TEST(image) pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); + test_png_color_formats(); test_supported_encoders(); test_CloneBitmapArea(); test_ARGB_conversion();
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
36
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
Results per page:
10
25
50
100
200