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
May 2019
----- 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
1019 discussions
Start a n
N
ew thread
Paul Gofman : ddraw/tests: Test lighting with ambient light and material in ddraw1.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 034d2b9963b58eca2112757b1bdbfe17e9e8e8a2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=034d2b9963b58eca2112757b…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Tue May 14 13:19:09 2019 +0300 ddraw/tests: Test lighting with ambient light and material in ddraw1. Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw1.c | 99 ++++++++++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 39 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=034d2b9963b58eca2112…
1
0
0
0
Nikolay Sivov : kernelbase: Duplicate some path handling functions from shlwapi.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 44ac5af07aebb2e8a79b058332c45cafbb7d6571 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=44ac5af07aebb2e8a79b0583…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:30:35 2019 +0300 kernelbase: Duplicate some path handling functions from shlwapi. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernelbase/kernelbase.spec | 54 +-- dlls/kernelbase/path.c | 753 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 780 insertions(+), 27 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=44ac5af07aebb2e8a79b…
1
0
0
0
Nikolay Sivov : dwrite/tests: Fix a typo in test message.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 7c02ab5ed1669b46139f8a62b79adc5889fa9b7e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7c02ab5ed1669b46139f8a62…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:29 2019 +0300 dwrite/tests: Fix a typo in test message. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/tests/layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 8337ce7..2c90e31 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -3307,7 +3307,7 @@ todo_wine ok(metrics.layoutWidth == 500.0, "Unexpected box width %f.\n", metrics.layoutWidth); ok(metrics.layoutHeight == 1000.0, "Unexpected box height %f.\n", metrics.layoutHeight); ok(metrics.maxBidiReorderingDepth == 1, "Unexpected reordering depth %u.\n", metrics.maxBidiReorderingDepth); - ok(metrics.lineCount == 1, "Unexpected line coun %u.\n", metrics.lineCount); + ok(metrics.lineCount == 1, "Unexpected line count %u.\n", metrics.lineCount); IDWriteTextLayout_Release(layout); IDWriteTextFormat_Release(format);
1
0
0
0
Nikolay Sivov : dwrite/layout: Use array allocation helper for line metrics.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 1315098aef784e7d6fccd79b36a799eab7260249 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1315098aef784e7d6fccd79b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:28 2019 +0300 dwrite/layout: Use array allocation helper for line metrics. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/layout.c | 116 ++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c index 4e9ce14..5140dec 100644 --- a/dlls/dwrite/layout.c +++ b/dlls/dwrite/layout.c @@ -227,9 +227,11 @@ struct layout_cluster { UINT32 position; /* relative to run, first cluster has 0 position */ }; -struct layout_line { - FLOAT height; /* height based on content */ - FLOAT baseline; /* baseline based on content */ +struct layout_line +{ + float height; /* height based on content */ + float baseline; /* baseline based on content */ + DWRITE_LINE_METRICS1 metrics; }; enum layout_recompute_mask { @@ -276,8 +278,7 @@ struct dwrite_textlayout { FLOAT minwidth; struct layout_line *lines; - DWRITE_LINE_METRICS1 *linemetrics; - UINT32 line_alloc; + size_t lines_size; DWRITE_TEXT_METRICS1 metrics; DWRITE_OVERHANG_METRICS overhangs; @@ -1364,16 +1365,16 @@ static void layout_apply_line_spacing(struct dwrite_textlayout *layout, UINT32 l switch (layout->format.spacing.method) { case DWRITE_LINE_SPACING_METHOD_DEFAULT: - layout->linemetrics[line].height = layout->lines[line].height; - layout->linemetrics[line].baseline = layout->lines[line].baseline; + layout->lines[line].metrics.height = layout->lines[line].height; + layout->lines[line].metrics.baseline = layout->lines[line].baseline; break; case DWRITE_LINE_SPACING_METHOD_UNIFORM: - layout->linemetrics[line].height = layout->format.spacing.height; - layout->linemetrics[line].baseline = layout->format.spacing.baseline; + layout->lines[line].metrics.height = layout->format.spacing.height; + layout->lines[line].metrics.baseline = layout->format.spacing.baseline; break; case DWRITE_LINE_SPACING_METHOD_PROPORTIONAL: - layout->linemetrics[line].height = layout->lines[line].height * layout->format.spacing.height; - layout->linemetrics[line].baseline = layout->lines[line].baseline * layout->format.spacing.baseline; + layout->lines[line].metrics.height = layout->lines[line].height * layout->format.spacing.height; + layout->lines[line].metrics.baseline = layout->lines[line].baseline * layout->format.spacing.baseline; break; default: ERR("Unknown spacing method %u\n", layout->format.spacing.method); @@ -1382,37 +1383,15 @@ static void layout_apply_line_spacing(struct dwrite_textlayout *layout, UINT32 l static HRESULT layout_set_line_metrics(struct dwrite_textlayout *layout, DWRITE_LINE_METRICS1 *metrics) { - UINT32 i = layout->metrics.lineCount; - - if (!layout->line_alloc) { - layout->line_alloc = 5; - layout->linemetrics = heap_calloc(layout->line_alloc, sizeof(*layout->linemetrics)); - layout->lines = heap_calloc(layout->line_alloc, sizeof(*layout->lines)); - if (!layout->linemetrics || !layout->lines) { - heap_free(layout->linemetrics); - heap_free(layout->lines); - layout->linemetrics = NULL; - layout->lines = NULL; - return E_OUTOFMEMORY; - } - } - - if (layout->metrics.lineCount == layout->line_alloc) { - DWRITE_LINE_METRICS1 *metrics; - struct layout_line *lines; - - if ((metrics = heap_realloc(layout->linemetrics, layout->line_alloc * 2 * sizeof(*layout->linemetrics)))) - layout->linemetrics = metrics; - if ((lines = heap_realloc(layout->lines, layout->line_alloc * 2 * sizeof(*layout->lines)))) - layout->lines = lines; + size_t i = layout->metrics.lineCount; - if (!metrics || !lines) - return E_OUTOFMEMORY; - - layout->line_alloc *= 2; + if (!dwrite_array_reserve((void **)&layout->lines, &layout->lines_size, layout->metrics.lineCount + 1, + sizeof(*layout->lines))) + { + return E_OUTOFMEMORY; } - layout->linemetrics[i] = *metrics; + layout->lines[i].metrics = *metrics; layout->lines[i].height = metrics->height; layout->lines[i].baseline = metrics->baseline; @@ -1674,8 +1653,9 @@ static void layout_apply_par_alignment(struct dwrite_textlayout *layout) erun = layout_get_next_erun(layout, NULL); inrun = layout_get_next_inline_run(layout, NULL); - for (line = 0; line < layout->metrics.lineCount; line++) { - FLOAT pos_y = origin_y + layout->linemetrics[line].baseline; + for (line = 0; line < layout->metrics.lineCount; line++) + { + float pos_y = origin_y + layout->lines[line].metrics.baseline; while (erun && erun->line == line) { erun->origin.y = pos_y; @@ -1687,7 +1667,7 @@ static void layout_apply_par_alignment(struct dwrite_textlayout *layout) inrun = layout_get_next_inline_run(layout, inrun); } - origin_y += layout->linemetrics[line].height; + origin_y += layout->lines[line].metrics.height; } } @@ -1992,8 +1972,9 @@ static void layout_set_line_positions(struct dwrite_textlayout *layout) erun = layout_get_next_erun(layout, NULL); inrun = layout_get_next_inline_run(layout, NULL); - for (line = 0, origin_y = 0.0f; line < layout->metrics.lineCount; line++) { - FLOAT pos_y = origin_y + layout->linemetrics[line].baseline; + for (line = 0, origin_y = 0.0f; line < layout->metrics.lineCount; line++) + { + float pos_y = origin_y + layout->lines[line].metrics.baseline; /* For all runs on this line */ while (erun && erun->line == line) { @@ -2007,7 +1988,7 @@ static void layout_set_line_positions(struct dwrite_textlayout *layout) inrun = layout_get_next_inline_run(layout, inrun); } - origin_y += layout->linemetrics[line].height; + origin_y += layout->lines[line].metrics.height; } layout->metrics.height = origin_y; @@ -2862,7 +2843,6 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout3 *iface) heap_free(This->actual_breakpoints); heap_free(This->clustermetrics); heap_free(This->clusters); - heap_free(This->linemetrics); heap_free(This->lines); heap_free(This->str); heap_free(This); @@ -3574,23 +3554,25 @@ static HRESULT WINAPI dwritetextlayout_Draw(IDWriteTextLayout3 *iface, static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout3 *iface, DWRITE_LINE_METRICS *metrics, UINT32 max_count, UINT32 *count) { - struct dwrite_textlayout *This = impl_from_IDWriteTextLayout3(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextLayout3(iface); + unsigned int line_count; HRESULT hr; + size_t i; - TRACE("(%p)->(%p %u %p)\n", This, metrics, max_count, count); + TRACE("%p, %p, %u, %p.\n", iface, metrics, max_count, count); - hr = layout_compute_effective_runs(This); - if (FAILED(hr)) + if (FAILED(hr = layout_compute_effective_runs(layout))) return hr; - if (metrics) { - UINT32 i, c = min(max_count, This->metrics.lineCount); - for (i = 0; i < c; i++) - memcpy(metrics + i, This->linemetrics + i, sizeof(*metrics)); + if (metrics) + { + line_count = min(max_count, layout->metrics.lineCount); + for (i = 0; i < line_count; ++i) + memcpy(&metrics[i], &layout->lines[i].metrics, sizeof(*metrics)); } - *count = This->metrics.lineCount; - return max_count >= This->metrics.lineCount ? S_OK : E_NOT_SUFFICIENT_BUFFER; + *count = layout->metrics.lineCount; + return max_count >= layout->metrics.lineCount ? S_OK : E_NOT_SUFFICIENT_BUFFER; } static HRESULT layout_update_metrics(struct dwrite_textlayout *layout) @@ -4061,20 +4043,25 @@ static HRESULT WINAPI dwritetextlayout3_GetLineSpacing(IDWriteTextLayout3 *iface static HRESULT WINAPI dwritetextlayout3_GetLineMetrics(IDWriteTextLayout3 *iface, DWRITE_LINE_METRICS1 *metrics, UINT32 max_count, UINT32 *count) { - struct dwrite_textlayout *This = impl_from_IDWriteTextLayout3(iface); + struct dwrite_textlayout *layout = impl_from_IDWriteTextLayout3(iface); + unsigned int line_count; HRESULT hr; + size_t i; - TRACE("(%p)->(%p %u %p)\n", This, metrics, max_count, count); + TRACE("%p, %p, %u, %p.\n", iface, metrics, max_count, count); - hr = layout_compute_effective_runs(This); - if (FAILED(hr)) + if (FAILED(hr = layout_compute_effective_runs(layout))) return hr; if (metrics) - memcpy(metrics, This->linemetrics, sizeof(*metrics) * min(max_count, This->metrics.lineCount)); + { + line_count = min(max_count, layout->metrics.lineCount); + for (i = 0; i < line_count; ++i) + metrics[i] = layout->lines[i].metrics; + } - *count = This->metrics.lineCount; - return max_count >= This->metrics.lineCount ? S_OK : E_NOT_SUFFICIENT_BUFFER; + *count = layout->metrics.lineCount; + return max_count >= layout->metrics.lineCount ? S_OK : E_NOT_SUFFICIENT_BUFFER; } static const IDWriteTextLayout3Vtbl dwritetextlayoutvtbl = { @@ -4978,9 +4965,8 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite layout->cluster_count = 0; layout->clustermetrics = NULL; layout->clusters = NULL; - layout->linemetrics = NULL; layout->lines = NULL; - layout->line_alloc = 0; + layout->lines_size = 0; layout->minwidth = 0.0f; list_init(&layout->eruns); list_init(&layout->inlineobjects);
1
0
0
0
Nikolay Sivov : dwrite: Use array allocation helper for strings object.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 0a3aef62d85720af1b1dcc133300d0afcc347ba6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a3aef62d85720af1b1dcc13…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:27 2019 +0300 dwrite: Use array allocation helper for strings object. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/main.c | 146 ++++++++++++++++++++++++++--------------------------- 1 file changed, 72 insertions(+), 74 deletions(-) diff --git a/dlls/dwrite/main.c b/dlls/dwrite/main.c index 1816fbc..3fe2b7e 100644 --- a/dlls/dwrite/main.c +++ b/dlls/dwrite/main.c @@ -241,13 +241,14 @@ struct localizedpair { WCHAR *string; }; -struct localizedstrings { +struct localizedstrings +{ IDWriteLocalizedStrings IDWriteLocalizedStrings_iface; - LONG ref; + LONG refcount; struct localizedpair *data; - UINT32 count; - UINT32 alloc; + size_t size; + size_t count; }; static inline struct localizedstrings *impl_from_IDWriteLocalizedStrings(IDWriteLocalizedStrings *iface) @@ -275,54 +276,61 @@ static HRESULT WINAPI localizedstrings_QueryInterface(IDWriteLocalizedStrings *i static ULONG WINAPI localizedstrings_AddRef(IDWriteLocalizedStrings *iface) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); - ULONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p)->(%d)\n", This, ref); - return ref; + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); + ULONG refcount = InterlockedIncrement(&strings->refcount); + + TRACE("%p, refcount %d.\n", iface, refcount); + + return refcount; } static ULONG WINAPI localizedstrings_Release(IDWriteLocalizedStrings *iface) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); - ULONG ref = InterlockedDecrement(&This->ref); - - TRACE("(%p)->(%d)\n", This, ref); + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); + ULONG refcount = InterlockedDecrement(&strings->refcount); + size_t i; - if (!ref) { - unsigned int i; + TRACE("%p, refcount %d.\n", iface, refcount); - for (i = 0; i < This->count; i++) { - heap_free(This->data[i].locale); - heap_free(This->data[i].string); + if (!refcount) + { + for (i = 0; i < strings->count; ++i) + { + heap_free(strings->data[i].locale); + heap_free(strings->data[i].string); } - heap_free(This->data); - heap_free(This); + heap_free(strings->data); + heap_free(strings); } - return ref; + return refcount; } static UINT32 WINAPI localizedstrings_GetCount(IDWriteLocalizedStrings *iface) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); - TRACE("(%p)\n", This); - return This->count; + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); + + TRACE("%p.\n", iface); + + return strings->count; } static HRESULT WINAPI localizedstrings_FindLocaleName(IDWriteLocalizedStrings *iface, WCHAR const *locale_name, UINT32 *index, BOOL *exists) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); - UINT32 i; + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); + size_t i; - TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(locale_name), index, exists); + TRACE("%p, %s, %p, %p.\n", iface, debugstr_w(locale_name), index, exists); *exists = FALSE; *index = ~0; - for (i = 0; i < This->count; i++) { - if (!strcmpiW(This->data[i].locale, locale_name)) { + for (i = 0; i < strings->count; ++i) + { + if (!strcmpiW(strings->data[i].locale, locale_name)) + { *exists = TRUE; *index = i; break; @@ -334,16 +342,17 @@ static HRESULT WINAPI localizedstrings_FindLocaleName(IDWriteLocalizedStrings *i static HRESULT WINAPI localizedstrings_GetLocaleNameLength(IDWriteLocalizedStrings *iface, UINT32 index, UINT32 *length) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); - TRACE("(%p)->(%u %p)\n", This, index, length); + TRACE("%p, %u, %p.\n", iface, index, length); - if (index >= This->count) { + if (index >= strings->count) + { *length = (UINT32)-1; return E_FAIL; } - *length = strlenW(This->data[index].locale); + *length = strlenW(strings->data[index].locale); return S_OK; } @@ -416,58 +425,45 @@ static const IDWriteLocalizedStringsVtbl localizedstringsvtbl = { HRESULT create_localizedstrings(IDWriteLocalizedStrings **strings) { - struct localizedstrings *This; + struct localizedstrings *object; *strings = NULL; - This = heap_alloc(sizeof(struct localizedstrings)); - if (!This) return E_OUTOFMEMORY; - - This->IDWriteLocalizedStrings_iface.lpVtbl = &localizedstringsvtbl; - This->ref = 1; - This->count = 0; - This->data = heap_alloc_zero(sizeof(struct localizedpair)); - if (!This->data) { - heap_free(This); + object = heap_alloc_zero(sizeof(*object)); + if (!object) return E_OUTOFMEMORY; - } - This->alloc = 1; - *strings = &This->IDWriteLocalizedStrings_iface; + object->IDWriteLocalizedStrings_iface.lpVtbl = &localizedstringsvtbl; + object->refcount = 1; + + *strings = &object->IDWriteLocalizedStrings_iface; return S_OK; } HRESULT add_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *locale, const WCHAR *string) { - struct localizedstrings *This = impl_from_IDWriteLocalizedStrings(iface); - UINT32 i; + struct localizedstrings *strings = impl_from_IDWriteLocalizedStrings(iface); + size_t i, count = strings->count; /* make sure there's no duplicates */ - for (i = 0; i < This->count; i++) - if (!strcmpW(This->data[i].locale, locale)) + for (i = 0; i < count; i++) + if (!strcmpW(strings->data[i].locale, locale)) return S_OK; - if (This->count == This->alloc) { - void *ptr; - - ptr = heap_realloc(This->data, 2*This->alloc*sizeof(struct localizedpair)); - if (!ptr) - return E_OUTOFMEMORY; - - This->alloc *= 2; - This->data = ptr; - } + if (!dwrite_array_reserve((void **)&strings->data, &strings->size, strings->count + 1, sizeof(*strings->data))) + return E_OUTOFMEMORY; - This->data[This->count].locale = heap_strdupW(locale); - This->data[This->count].string = heap_strdupW(string); - if (!This->data[This->count].locale || !This->data[This->count].string) { - heap_free(This->data[This->count].locale); - heap_free(This->data[This->count].string); + strings->data[count].locale = heap_strdupW(locale); + strings->data[count].string = heap_strdupW(string); + if (!strings->data[count].locale || !strings->data[count].string) + { + heap_free(strings->data[count].locale); + heap_free(strings->data[count].string); return E_OUTOFMEMORY; } - This->count++; + strings->count++; return S_OK; } @@ -475,7 +471,7 @@ HRESULT add_localizedstring(IDWriteLocalizedStrings *iface, const WCHAR *locale, HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedStrings **ret) { struct localizedstrings *strings, *strings_clone; - int i; + size_t i; *ret = NULL; @@ -483,24 +479,26 @@ HRESULT clone_localizedstring(IDWriteLocalizedStrings *iface, IDWriteLocalizedSt return S_FALSE; strings = impl_from_IDWriteLocalizedStrings(iface); - strings_clone = heap_alloc(sizeof(*strings_clone)); + strings_clone = heap_alloc_zero(sizeof(*strings_clone)); if (!strings_clone) return E_OUTOFMEMORY; - strings_clone->IDWriteLocalizedStrings_iface.lpVtbl = &localizedstringsvtbl; - strings_clone->ref = 1; - strings_clone->count = strings->count; - strings_clone->data = heap_calloc(strings_clone->count, sizeof(*strings_clone->data)); - if (!strings_clone->data) { + if (!dwrite_array_reserve((void **)&strings_clone->data, &strings_clone->size, strings->count, + sizeof(*strings_clone->data))) + { heap_free(strings_clone); return E_OUTOFMEMORY; } - for (i = 0; i < strings_clone->count; i++) + + strings_clone->IDWriteLocalizedStrings_iface.lpVtbl = &localizedstringsvtbl; + strings_clone->refcount = 1; + strings_clone->count = strings->count; + + for (i = 0; i < strings_clone->count; ++i) { strings_clone->data[i].locale = heap_strdupW(strings->data[i].locale); strings_clone->data[i].string = heap_strdupW(strings->data[i].string); } - strings_clone->alloc = strings_clone->count; *ret = &strings_clone->IDWriteLocalizedStrings_iface;
1
0
0
0
Nikolay Sivov : dwrite/analyzer: Use array allocation helper for fallback builder.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: a782605ef52bbcdc0cc841c1ab666a771fc249b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a782605ef52bbcdc0cc841c1…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:26 2019 +0300 dwrite/analyzer: Use array allocation helper for fallback builder. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 70 +++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index ca6dca1..679e1ed 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -236,13 +236,14 @@ struct dwrite_fontfallback { UINT32 mappings_count; }; -struct dwrite_fontfallback_builder { +struct dwrite_fontfallback_builder +{ IDWriteFontFallbackBuilder IDWriteFontFallbackBuilder_iface; - LONG ref; + LONG refcount; IDWriteFactory5 *factory; struct fallback_mapping *mappings; - UINT32 mappings_count; - UINT32 mappings_capacity; + size_t size; + size_t count; }; struct dwrite_numbersubstitution { @@ -2228,9 +2229,7 @@ static const IDWriteFontFallbackVtbl customfontfallbackvtbl = static HRESULT WINAPI fontfallbackbuilder_QueryInterface(IDWriteFontFallbackBuilder *iface, REFIID riid, void **obj) { - struct dwrite_fontfallback_builder *fallbackbuilder = impl_from_IDWriteFontFallbackBuilder(iface); - - TRACE("(%p)->(%s %p)\n", fallbackbuilder, debugstr_guid(riid), obj); + TRACE("%p, %s, %p.\n", iface, debugstr_guid(riid), obj); if (IsEqualIID(riid, &IID_IDWriteFontFallbackBuilder) || IsEqualIID(riid, &IID_IUnknown)) { *obj = iface; @@ -2247,22 +2246,25 @@ static HRESULT WINAPI fontfallbackbuilder_QueryInterface(IDWriteFontFallbackBuil static ULONG WINAPI fontfallbackbuilder_AddRef(IDWriteFontFallbackBuilder *iface) { struct dwrite_fontfallback_builder *fallbackbuilder = impl_from_IDWriteFontFallbackBuilder(iface); - ULONG ref = InterlockedIncrement(&fallbackbuilder->ref); - TRACE("(%p)->(%d)\n", fallbackbuilder, ref); - return ref; + ULONG refcount = InterlockedIncrement(&fallbackbuilder->refcount); + + TRACE("%p, refcount %d.\n", iface, refcount); + + return refcount; } static ULONG WINAPI fontfallbackbuilder_Release(IDWriteFontFallbackBuilder *iface) { struct dwrite_fontfallback_builder *fallbackbuilder = impl_from_IDWriteFontFallbackBuilder(iface); - ULONG ref = InterlockedDecrement(&fallbackbuilder->ref); - - TRACE("(%p)->(%d)\n", fallbackbuilder, ref); + ULONG refcount = InterlockedDecrement(&fallbackbuilder->refcount); + size_t i; - if (!ref) { - UINT32 i; + TRACE("%p, refcount %d.\n", iface, refcount); - for (i = 0; i < fallbackbuilder->mappings_count; i++) { + if (!refcount) + { + for (i = 0; i < fallbackbuilder->count; ++i) + { struct fallback_mapping *mapping = &fallbackbuilder->mappings[i]; UINT32 j; @@ -2281,7 +2283,7 @@ static ULONG WINAPI fontfallbackbuilder_Release(IDWriteFontFallbackBuilder *ifac heap_free(fallbackbuilder); } - return ref; + return refcount; } static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder *iface, @@ -2292,8 +2294,8 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder struct fallback_mapping *mapping; UINT32 i; - TRACE("(%p)->(%p, %u, %p, %u, %p, %s, %s, %f)\n", fallbackbuilder, ranges, ranges_count, target_families, - families_count, collection, debugstr_w(locale), debugstr_w(base_family), scale); + TRACE("%p, %p, %u, %p, %u, %p, %s, %s, %f.\n", iface, ranges, ranges_count, target_families, families_count, + collection, debugstr_w(locale), debugstr_w(base_family), scale); if (!ranges || ranges_count == 0 || !target_families || families_count == 0 || scale < 0.0f) return E_INVALIDARG; @@ -2301,25 +2303,13 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder if (base_family) FIXME("base family ignored.\n"); - if (fallbackbuilder->mappings_count == fallbackbuilder->mappings_capacity) { - struct fallback_mapping *mappings; - - if (fallbackbuilder->mappings_capacity == 0) { - if ((mappings = heap_calloc(16, sizeof(*mappings)))) - fallbackbuilder->mappings_capacity = 16; - } - else { - if ((mappings = heap_realloc(fallbackbuilder->mappings, sizeof(*fallbackbuilder->mappings) * - fallbackbuilder->mappings_capacity * 2))) - fallbackbuilder->mappings_capacity *= 2; - } - if (!mappings) - return E_OUTOFMEMORY; - - fallbackbuilder->mappings = mappings; + if (!dwrite_array_reserve((void **)&fallbackbuilder->mappings, &fallbackbuilder->size, fallbackbuilder->count + 1, + sizeof(*fallbackbuilder->mappings))) + { + return E_OUTOFMEMORY; } - mapping = &fallbackbuilder->mappings[fallbackbuilder->mappings_count++]; + mapping = &fallbackbuilder->mappings[fallbackbuilder->count++]; mapping->ranges = heap_calloc(ranges_count, sizeof(*mapping->ranges)); memcpy(mapping->ranges, ranges, sizeof(*mapping->ranges) * ranges_count); @@ -2339,9 +2329,7 @@ static HRESULT WINAPI fontfallbackbuilder_AddMapping(IDWriteFontFallbackBuilder static HRESULT WINAPI fontfallbackbuilder_AddMappings(IDWriteFontFallbackBuilder *iface, IDWriteFontFallback *fallback) { - struct dwrite_fontfallback_builder *fallbackbuilder = impl_from_IDWriteFontFallbackBuilder(iface); - - FIXME("(%p)->(%p): stub\n", fallbackbuilder, fallback); + FIXME("%p, %p stub.\n", iface, fallback); return E_NOTIMPL; } @@ -2352,7 +2340,7 @@ static HRESULT WINAPI fontfallbackbuilder_CreateFontFallback(IDWriteFontFallback struct dwrite_fontfallback_builder *fallbackbuilder = impl_from_IDWriteFontFallbackBuilder(iface); struct dwrite_fontfallback *fallback; - FIXME("(%p)->(%p): stub\n", fallbackbuilder, ret); + FIXME("%p, %p stub.\n", iface, ret); *ret = NULL; @@ -2390,7 +2378,7 @@ HRESULT create_fontfallback_builder(IDWriteFactory5 *factory, IDWriteFontFallbac return E_OUTOFMEMORY; builder->IDWriteFontFallbackBuilder_iface.lpVtbl = &fontfallbackbuildervtbl; - builder->ref = 1; + builder->refcount = 1; builder->factory = factory; IDWriteFactory5_AddRef(builder->factory);
1
0
0
0
Nikolay Sivov : dwrite: Use array allocation helper for in-memory loader.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 3cfd0a7a4b29cb081508705731eb01e90cd77517 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3cfd0a7a4b29cb0815087057…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:25 2019 +0300 dwrite: Use array allocation helper for in-memory loader. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c index de7ccef..5f4abc7 100644 --- a/dlls/dwrite/font.c +++ b/dlls/dwrite/font.c @@ -4588,8 +4588,8 @@ struct dwrite_inmemory_fileloader LONG ref; struct dwrite_inmemory_stream_data **streams; - UINT32 filecount; - UINT32 capacity; + size_t size; + size_t count; }; static inline struct dwrite_localfontfileloader *impl_from_IDWriteLocalFontFileLoader(IDWriteLocalFontFileLoader *iface) @@ -6208,13 +6208,12 @@ static ULONG WINAPI inmemoryfontfileloader_Release(IDWriteInMemoryFontFileLoader { struct dwrite_inmemory_fileloader *loader = impl_from_IDWriteInMemoryFontFileLoader(iface); ULONG ref = InterlockedDecrement(&loader->ref); + size_t i; TRACE("(%p)->(%u)\n", loader, ref); if (!ref) { - UINT32 i; - - for (i = 0; i < loader->filecount; i++) + for (i = 0; i < loader->count; ++i) release_inmemory_stream(loader->streams[i]); heap_free(loader->streams); heap_free(loader); @@ -6239,7 +6238,7 @@ static HRESULT WINAPI inmemoryfontfileloader_CreateStreamFromKey(IDWriteInMemory index = *(DWORD *)key; - if (index >= loader->filecount) + if (index >= loader->count) return E_INVALIDARG; if (!(stream = heap_alloc(sizeof(*stream)))) @@ -6266,21 +6265,8 @@ static HRESULT WINAPI inmemoryfontfileloader_CreateInMemoryFontFileReference(IDW *fontfile = NULL; - if (loader->filecount == loader->capacity) { - if (loader->streams) { - struct dwrite_inmemory_stream_data **ptr; - - if (!(ptr = heap_realloc(loader->streams, 2 * loader->capacity * sizeof(*loader->streams)))) - return E_OUTOFMEMORY; - - loader->streams = ptr; - loader->capacity *= 2; - } - else { - loader->capacity = 16; - loader->streams = heap_calloc(loader->capacity, sizeof(*loader->streams)); - } - } + if (!dwrite_array_reserve((void **)&loader->streams, &loader->size, loader->count + 1, sizeof(*loader->streams))) + return E_OUTOFMEMORY; if (!(stream = heap_alloc(sizeof(*stream)))) return E_OUTOFMEMORY; @@ -6300,8 +6286,8 @@ static HRESULT WINAPI inmemoryfontfileloader_CreateInMemoryFontFileReference(IDW memcpy(stream->data, data, data_size); } - key = loader->filecount; - loader->streams[loader->filecount++] = stream; + key = loader->count; + loader->streams[loader->count++] = stream; return IDWriteFactory_CreateCustomFontFileReference(factory, &key, sizeof(key), (IDWriteFontFileLoader *)&loader->IDWriteInMemoryFontFileLoader_iface, fontfile); @@ -6311,9 +6297,9 @@ static UINT32 WINAPI inmemoryfontfileloader_GetFileCount(IDWriteInMemoryFontFile { struct dwrite_inmemory_fileloader *loader = impl_from_IDWriteInMemoryFontFileLoader(iface); - TRACE("(%p)\n", loader); + TRACE("%p.\n", iface); - return loader->filecount; + return loader->count; } static const IDWriteInMemoryFontFileLoaderVtbl inmemoryfontfileloadervtbl =
1
0
0
0
Nikolay Sivov : dwrite: Use array allocation helper to manage collection entries.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 0520b593775b2a618cd513323d29a5073d57e3a7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0520b593775b2a618cd51332…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:24 2019 +0300 dwrite: Use array allocation helper to manage collection entries. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 142 ++++++++++++++++++++++++++++------------------------- 1 file changed, 74 insertions(+), 68 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=0520b593775b2a618cd5…
1
0
0
0
Nikolay Sivov : dwrite: Use array allocation helper to manage family entries.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 958911c699b5ef90bb4fe73faf3d8766d34da144 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=958911c699b5ef90bb4fe73f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue May 14 13:27:23 2019 +0300 dwrite: Use array allocation helper to manage family entries. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/font.c | 166 ++++++++++++++++++++++++++--------------------------- 1 file changed, 82 insertions(+), 84 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=958911c699b5ef90bb4f…
1
0
0
0
Matteo Bruni : wined3d: Avoid some redundant glVertexAttrib4f() calls.
by Alexandre Julliard
14 May '19
14 May '19
Module: wine Branch: master Commit: 8958eb68d7f59b002e4d8e20d8cc7c45c18a68b3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8958eb68d7f59b002e4d8e20…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Tue May 14 15:44:26 2019 +0430 wined3d: Avoid some redundant glVertexAttrib4f() calls. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 20 ++++++++++++++++++-- dlls/wined3d/wined3d_private.h | 5 ++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index cda1ea0..75abee8 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -5358,9 +5358,23 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c if (context->numbered_array_mask & (1u << i)) context_unload_numbered_array(context, i); if (!use_vs(state) && i == WINED3D_FFP_DIFFUSE) - GL_EXTCALL(glVertexAttrib4f(i, 1.0f, 1.0f, 1.0f, 1.0f)); + { + if (!(context_gl->default_attrib_value_set & (1u << i)) || !context_gl->diffuse_attrib_to_1) + { + GL_EXTCALL(glVertexAttrib4f(i, 1.0f, 1.0f, 1.0f, 1.0f)); + context_gl->diffuse_attrib_to_1 = 1; + } + } else - GL_EXTCALL(glVertexAttrib4f(i, 0.0f, 0.0f, 0.0f, 0.0f)); + { + if (!(context_gl->default_attrib_value_set & (1u << i))) + { + GL_EXTCALL(glVertexAttrib4f(i, 0.0f, 0.0f, 0.0f, 0.0f)); + if (i == WINED3D_FFP_DIFFUSE) + context_gl->diffuse_attrib_to_1 = 0; + } + } + context_gl->default_attrib_value_set |= 1u << i; continue; } @@ -5380,6 +5394,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c * mode instead. */ if (context->numbered_array_mask & (1u << i)) context_unload_numbered_array(context, i); + context_gl->default_attrib_value_set &= ~(1u << i); continue; } @@ -5526,6 +5541,7 @@ static void wined3d_context_gl_load_numbered_arrays(struct wined3d_context_gl *c break; } + context_gl->default_attrib_value_set &= ~(1u << i); } } checkGLcall("Loading numbered arrays"); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 0a8c8ca..bb982f8 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1996,7 +1996,10 @@ struct wined3d_context_gl struct wined3d_context c; uint32_t fog_enabled : 1; - uint32_t padding : 31; + uint32_t diffuse_attrib_to_1 : 1; + uint32_t padding : 30; + + uint32_t default_attrib_value_set; GLenum *texture_type;
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200