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
February 2017
----- 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
838 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Send sampler GL initialisation through the command stream.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: 9e2498f25e47d64a044c51f2abf60e3104bd4bf7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9e2498f25e47d64a044c51f2a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Feb 16 00:58:53 2017 +0100 wined3d: Send sampler GL initialisation through the command stream. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/buffer.c | 2 +- dlls/wined3d/cs.c | 26 ++++++++++++++++++-------- dlls/wined3d/palette.c | 2 +- dlls/wined3d/query.c | 2 +- dlls/wined3d/resource.c | 2 +- dlls/wined3d/sampler.c | 25 ++++++++++++++++--------- dlls/wined3d/shader.c | 2 +- dlls/wined3d/state.c | 2 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/vertexdeclaration.c | 2 +- dlls/wined3d/view.c | 6 +++--- dlls/wined3d/wined3d_private.h | 7 ++++--- 12 files changed, 49 insertions(+), 31 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=9e2498f25e47d64a044c5…
1
0
0
0
Henri Verbeet : wined3d: Use create_primary_opengl_context() in wined3d_device_init_3d().
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: 325d415ea480f2c2667efaefef340a1cd98b636c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=325d415ea480f2c2667efaefe…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Feb 16 00:58:52 2017 +0100 wined3d: Use create_primary_opengl_context() in wined3d_device_init_3d(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/device.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a7ee5bc..57bec83 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1013,7 +1013,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct wined3d_swapchain *swapchain = NULL; - struct wined3d_context *context; DWORD clear_flags = 0; HRESULT hr; @@ -1027,18 +1026,6 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, if (!(device->fb.render_targets = wined3d_calloc(gl_info->limits.buffers, sizeof(*device->fb.render_targets)))) return E_OUTOFMEMORY; - if (FAILED(hr = device->shader_backend->shader_alloc_private(device, - device->adapter->vertex_pipe, device->adapter->fragment_pipe))) - { - TRACE("Shader private data couldn't be allocated\n"); - goto err_out; - } - if (FAILED(hr = device->blitter->alloc_private(device))) - { - TRACE("Blitter private data couldn't be allocated\n"); - goto err_out; - } - /* Setup the implicit swapchain. This also initializes a context. */ TRACE("Creating implicit swapchain\n"); hr = device->device_parent->ops->create_swapchain(device->device_parent, @@ -1075,19 +1062,15 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, goto err_out; } device->swapchains[0] = swapchain; - device_init_swapchain_state(device, swapchain); - context = context_acquire(device, NULL, 0); - - create_dummy_textures(device, context); - create_default_samplers(device, context); + if (FAILED(hr = create_primary_opengl_context(device, swapchain))) + goto err_out; + device_init_swapchain_state(device, swapchain); device->contexts[0]->last_was_rhw = 0; TRACE("All defaults now set up, leaving 3D init.\n"); - context_release(context); - /* Clear the screen */ if (swapchain->back_buffers && swapchain->back_buffers[0]) clear_flags |= WINED3DCLEAR_TARGET; @@ -1103,17 +1086,13 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, return WINED3D_OK; err_out: - HeapFree(GetProcessHeap(), 0, device->fb.render_targets); HeapFree(GetProcessHeap(), 0, device->swapchains); device->swapchain_count = 0; if (device->back_buffer_view) wined3d_rendertarget_view_decref(device->back_buffer_view); if (swapchain) wined3d_swapchain_decref(swapchain); - if (device->blit_priv) - device->blitter->free_private(device); - if (device->shader_priv) - device->shader_backend->shader_free_private(device); + HeapFree(GetProcessHeap(), 0, device->fb.render_targets); return hr; }
1
0
0
0
Piotr Caban : gdiplus: Add GdipCreateHBITMAPFromBitmap tests when bitmap bits are locked.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: e1006611cddd904e6361e0010a6eb1988afab033 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1006611cddd904e6361e0010…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 14 10:24:53 2017 +0100 gdiplus: Add GdipCreateHBITMAPFromBitmap tests when bitmap bits are locked. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/image.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 6abd026..0ef72b2 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -1666,6 +1666,7 @@ static void test_createhbitmap(void) HDC hdc; COLORREF pixel; BYTE bits[640]; + BitmapData lockeddata; memset(bits, 0x68, 640); @@ -1850,6 +1851,30 @@ static void test_createhbitmap(void) stat = GdipDisposeImage((GpImage*)bitmap); expect(Ok, stat); + + /* create HBITMAP from locked data */ + memset(bits, 0x68, 640); + stat = GdipCreateBitmapFromScan0(10, 20, 32, PixelFormat24bppRGB, bits, &bitmap); + expect(Ok, stat); + + memset(&lockeddata, 0, sizeof(lockeddata)); + stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead | ImageLockModeWrite, + PixelFormat32bppRGB, &lockeddata); + expect(Ok, stat); + ((DWORD*)lockeddata.Scan0)[0] = 0xff242424; + stat = GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); + expect(Ok, stat); + stat = GdipBitmapUnlockBits(bitmap, &lockeddata); + expect(Ok, stat); + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); + + hdc = CreateCompatibleDC(NULL); + oldhbitmap = SelectObject(hdc, hbitmap); + pixel = GetPixel(hdc, 0, 0); + expect(0x686868, pixel); + SelectObject(hdc, oldhbitmap); + DeleteDC(hdc); } static void test_getthumbnail(void)
1
0
0
0
Piotr Caban : gdiplus: Reimplement GdipCreateHBITMAPFromBitmap so it can work on locked bitmaps.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: b58276af4dad993bdac52b979da2d8d9baa1ea8b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b58276af4dad993bdac52b979…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 14 10:24:47 2017 +0100 gdiplus: Reimplement GdipCreateHBITMAPFromBitmap so it can work on locked bitmaps. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/image.c | 53 +++++++++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index dd01f77..07609ac 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1477,10 +1477,12 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, UINT width, height; BITMAPINFOHEADER bih; LPBYTE bits; - BitmapData lockeddata; + BOOL unlock; + TRACE("(%p,%p,%x)\n", bitmap, hbmReturn, background); if (!bitmap || !hbmReturn) return InvalidParameter; + if (!image_lock(&bitmap->image, &unlock)) return ObjectBusy; GdipGetImageWidth(&bitmap->image, &width); GdipGetImageHeight(&bitmap->image, &height); @@ -1498,41 +1500,36 @@ GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, bih.biClrImportant = 0; result = CreateDIBSection(0, (BITMAPINFO*)&bih, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - - if (result) + if (!result) { - lockeddata.Stride = -width * 4; - lockeddata.Scan0 = bits + (width * 4 * (height - 1)); - - stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead|ImageLockModeUserInputBuf, - PixelFormat32bppPARGB, &lockeddata); - - if (stat == Ok) - stat = GdipBitmapUnlockBits(bitmap, &lockeddata); - - if (stat == Ok && (background & 0xffffff)) - { - DWORD *ptr; - UINT i; - for (ptr = (DWORD*)bits, i = 0; i < width * height; ptr++, i++) - { - if ((*ptr & 0xff000000) == 0xff000000) continue; - *ptr = blend_argb_no_bkgnd_alpha(*ptr, background); - } - } + image_unlock(&bitmap->image, unlock); + return GenericError; } - else - stat = GenericError; - if (stat != Ok && result) + stat = convert_pixels(width, height, -width*4, + bits + (width * 4 * (height - 1)), PixelFormat32bppPARGB, + bitmap->stride, bitmap->bits, bitmap->format, bitmap->image.palette); + if (stat != Ok) { DeleteObject(result); - result = NULL; + image_unlock(&bitmap->image, unlock); + return stat; } - *hbmReturn = result; + if (background & 0xffffff) + { + DWORD *ptr; + UINT i; + for (ptr = (DWORD*)bits, i = 0; i < width * height; ptr++, i++) + { + if ((*ptr & 0xff000000) == 0xff000000) continue; + *ptr = blend_argb_no_bkgnd_alpha(*ptr, background); + } + } - return stat; + *hbmReturn = result; + image_unlock(&bitmap->image, unlock); + return Ok; } GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height,
1
0
0
0
Piotr Caban : gdiplus: GpBitmap can be only locked once, get rid of numlocks field.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: 5673d82b8e90112d03e80fb709faec23644f9878 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5673d82b8e90112d03e80fb70…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 14 10:24:43 2017 +0100 gdiplus: GpBitmap can be only locked once, get rid of numlocks field. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 1 - dlls/gdiplus/image.c | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 2e98065..dd210fc 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -391,7 +391,6 @@ struct GpBitmap{ INT height; PixelFormat format; ImageLockMode lockmode; - INT numlocks; BYTE *bitmapbits; /* pointer to the buffer we passed in BitmapLockBits */ HBITMAP hbitmap; HDC hdc; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 4de8ecc..dd01f77 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1071,7 +1071,6 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, bitmap->stride * act_rect.Y; bitmap->lockmode = flags | ImageLockModeRead; - bitmap->numlocks++; image_unlock(&bitmap->image, unlock); return Ok; @@ -1148,7 +1147,6 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, } bitmap->lockmode = flags | ImageLockModeRead; - bitmap->numlocks++; bitmap->lockx = act_rect.X; bitmap->locky = act_rect.Y; @@ -1190,9 +1188,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, } if(!(lockeddata->Reserved & ImageLockModeWrite)){ - if(!(--bitmap->numlocks)) - bitmap->lockmode = 0; - + bitmap->lockmode = 0; heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; image_unlock(&bitmap->image, unlock); @@ -1203,7 +1199,6 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, { /* we passed a direct reference; no need to do anything */ bitmap->lockmode = 0; - bitmap->numlocks = 0; image_unlock(&bitmap->image, unlock); return Ok; } @@ -1228,7 +1223,6 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; bitmap->lockmode = 0; - bitmap->numlocks = 0; image_unlock(&bitmap->image, unlock); return stat;
1
0
0
0
Piotr Caban : gdiplus: Make GpBitmap->bitmapbits access thread safe.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: wine Branch: master Commit: 0eaaa1514454d584eb6638e0c7a31bb64bbc773b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0eaaa1514454d584eb6638e0c…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Tue Feb 14 10:24:36 2017 +0100 gdiplus: Make GpBitmap->bitmapbits access thread safe. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus_private.h | 14 ++++++++++++ dlls/gdiplus/image.c | 51 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index b44340f..2e98065 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -348,6 +348,7 @@ struct GpImage{ UINT frame_count, current_frame; ColorPalette *palette; REAL xres, yres; + LONG busy; }; struct GpMetafile{ @@ -515,4 +516,17 @@ GpStatus gdip_format_string(HDC hdc, void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN; +static inline BOOL image_lock(GpImage *image, BOOL *unlock) +{ + LONG tid = GetCurrentThreadId(), owner_tid; + owner_tid = InterlockedCompareExchange(&image->busy, tid, 0); + *unlock = !owner_tid; + return !owner_tid || owner_tid==tid; +} + +static inline void image_unlock(GpImage *image, BOOL unlock) +{ + if (unlock) image->busy = 0; +} + #endif diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 21d5a3a..4de8ecc 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1027,16 +1027,22 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, INT bitspp = PIXELFORMATBPP(format); GpRect act_rect; /* actual rect to be used */ GpStatus stat; + BOOL unlock; TRACE("%p %p %d 0x%x %p\n", bitmap, rect, flags, format, lockeddata); if(!lockeddata || !bitmap) return InvalidParameter; + if(!image_lock(&bitmap->image, &unlock)) + return ObjectBusy; if(rect){ if(rect->X < 0 || rect->Y < 0 || (rect->X + rect->Width > bitmap->width) || (rect->Y + rect->Height > bitmap->height) || !flags) + { + image_unlock(&bitmap->image, unlock); return InvalidParameter; + } act_rect = *rect; } @@ -1049,6 +1055,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if(bitmap->lockmode) { WARN("bitmap is already locked and cannot be locked again\n"); + image_unlock(&bitmap->image, unlock); return WrongState; } @@ -1066,6 +1073,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, bitmap->lockmode = flags | ImageLockModeRead; bitmap->numlocks++; + image_unlock(&bitmap->image, unlock); return Ok; } @@ -1076,6 +1084,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if (stat == NotImplemented) { FIXME("cannot read bitmap from %x to %x\n", bitmap->format, format); + image_unlock(&bitmap->image, unlock); return NotImplemented; } } @@ -1088,6 +1097,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, if (stat == NotImplemented) { FIXME("cannot write bitmap from %x to %x\n", format, bitmap->format); + image_unlock(&bitmap->image, unlock); return NotImplemented; } } @@ -1103,7 +1113,11 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, bitmap->bitmapbits = heap_alloc_zero(lockeddata->Stride * act_rect.Height); - if (!bitmap->bitmapbits) return OutOfMemory; + if (!bitmap->bitmapbits) + { + image_unlock(&bitmap->image, unlock); + return OutOfMemory; + } lockeddata->Scan0 = bitmap->bitmapbits; } @@ -1128,6 +1142,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, { heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; + image_unlock(&bitmap->image, unlock); return stat; } } @@ -1137,6 +1152,7 @@ GpStatus WINGDIPAPI GdipBitmapLockBits(GpBitmap* bitmap, GDIPCONST GpRect* rect, bitmap->lockx = act_rect.X; bitmap->locky = act_rect.Y; + image_unlock(&bitmap->image, unlock); return Ok; } @@ -1158,14 +1174,20 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, { GpStatus stat; static BOOL fixme = FALSE; + BOOL unlock; TRACE("(%p,%p)\n", bitmap, lockeddata); if(!bitmap || !lockeddata) return InvalidParameter; + if(!image_lock(&bitmap->image, &unlock)) + return ObjectBusy; if(!bitmap->lockmode) + { + image_unlock(&bitmap->image, unlock); return WrongState; + } if(!(lockeddata->Reserved & ImageLockModeWrite)){ if(!(--bitmap->numlocks)) @@ -1173,6 +1195,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, heap_free(bitmap->bitmapbits); bitmap->bitmapbits = NULL; + image_unlock(&bitmap->image, unlock); return Ok; } @@ -1181,6 +1204,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, /* we passed a direct reference; no need to do anything */ bitmap->lockmode = 0; bitmap->numlocks = 0; + image_unlock(&bitmap->image, unlock); return Ok; } @@ -1206,6 +1230,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap, bitmap->lockmode = 0; bitmap->numlocks = 0; + image_unlock(&bitmap->image, unlock); return stat; } @@ -3746,6 +3771,7 @@ static GpStatus select_frame_wic(GpImage *image, UINT active_frame) if(status != Ok) return status; + new_image->busy = image->busy; memcpy(&new_image->format, &image->format, sizeof(GUID)); free_image_data(image); if (image->type == ImageTypeBitmap) @@ -4219,30 +4245,39 @@ GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *d { GpStatus stat; const struct image_codec *codec = NULL; + BOOL unlock; TRACE("(%p,%s,%u)\n", image, debugstr_guid(dimensionID), frame); if (!image || !dimensionID) return InvalidParameter; + if(!image_lock(image, &unlock)) + return ObjectBusy; if (frame >= image->frame_count) { WARN("requested frame %u, but image has only %u\n", frame, image->frame_count); + image_unlock(image, unlock); return InvalidParameter; } if (image->type != ImageTypeBitmap && image->type != ImageTypeMetafile) { WARN("invalid image type %d\n", image->type); + image_unlock(image, unlock); return InvalidParameter; } if (image->current_frame == frame) + { + image_unlock(image, unlock); return Ok; + } if (!image->decoder) { TRACE("image doesn't have an associated decoder\n"); + image_unlock(image, unlock); return Ok; } @@ -4251,10 +4286,13 @@ GpStatus WINGDIPAPI GdipImageSelectActiveFrame(GpImage *image, GDIPCONST GUID *d if (stat != Ok) { WARN("can't find decoder info\n"); + image_unlock(image, unlock); return stat; } - return codec->select_func(image, frame); + stat = codec->select_func(image, frame); + image_unlock(image, unlock); + return stat; } GpStatus WINGDIPAPI GdipLoadImageFromStream(IStream *stream, GpImage **image) @@ -5264,11 +5302,14 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) UINT x, y, width, height; BitmapData src_lock, dst_lock; GpStatus stat; + BOOL unlock; TRACE("(%p, %u)\n", image, type); if (!image) return InvalidParameter; + if (!image_lock(image, &unlock)) + return ObjectBusy; rotate_90 = type&1; flip_x = (type&6) == 2 || (type&6) == 4; @@ -5277,6 +5318,7 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) if (image->type != ImageTypeBitmap) { FIXME("Not implemented for type %i\n", image->type); + image_unlock(image, unlock); return NotImplemented; } @@ -5286,6 +5328,7 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) if (bpp < 8) { FIXME("Not implemented for %i bit images\n", bpp); + image_unlock(image, unlock); return NotImplemented; } @@ -5305,7 +5348,10 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) stat = GdipCreateBitmapFromScan0(width, height, 0, bitmap->format, NULL, &new_bitmap); if (stat != Ok) + { + image_unlock(image, unlock); return stat; + } stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, bitmap->format, &src_lock); @@ -5365,6 +5411,7 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) else GdipDisposeImage(&new_bitmap->image); + image_unlock(image, unlock); return stat; }
1
0
0
0
Francois Gouget : winetest: Add support for reports containing pids.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: tools Branch: master Commit: 17eb1e231e34be789d3e457f58f582ed097b38bd URL:
http://source.winehq.org/git/tools.git/?a=commit;h=17eb1e231e34be789d3e457f…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Feb 16 12:35:44 2017 +0100 winetest: Add support for reports containing pids. Let dissect recognize the test result lines despite the extra pid field but do not yet put it to use. Also make the 'tests executed' regexp a bit stricter. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- winetest/dissect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winetest/dissect b/winetest/dissect index d9404fe..a4f3f99 100755 --- a/winetest/dissect +++ b/winetest/dissect @@ -306,7 +306,7 @@ while (<IN>) { $dll = undef; mydie "too many tests skipped by user request\n" if ++$user_skips > $maxuserskips; } - } elsif (/^(.*$unit.*: (\d+) tests executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\.)\r?$/) { + } elsif (/^((?:[0-9a-f]+:)?$unit: (\d+) tests executed \((\d+) marked as todo, (\d+) failures?\), (\d+) skipped\.)\r?$/) { $lines++; $total += $2; $todo += $3; @@ -318,7 +318,7 @@ while (<IN>) { if ($failed) { $class .= " failed"; } elsif ($todo) { $class .= " todo"; } $testbox->{data} .= sprintf "<div class=\"%s\">%s</div>\n", $class, escapeHTML($_); - } elsif (/$dll:$unit done \((-?\d+)\)(?:\r?$| in)/) { + } elsif (/$dll:$unit(?::[0-9a-f]+)? done \((-?\d+)\)(?:\r?$| in)/) { chomp; # current test ended if ($lines==0 || $1 < 0) { $result = "failed $1 - -";
1
0
0
0
Francois Gouget : testbot: Add a tool to generate Winetest report test cases.
by Alexandre Julliard
16 Feb '17
16 Feb '17
Module: tools Branch: master Commit: f1dd8155567175082fbc48060a2da318c16bc020 URL:
http://source.winehq.org/git/tools.git/?a=commit;h=f1dd8155567175082fbc4806…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Thu Feb 16 12:34:47 2017 +0100 testbot: Add a tool to generate Winetest report test cases. This generates WineTest-style report containing test cases for tools that parse and verify them such as the TestBot and
test.winehq.org
scripts. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- testbot/src/reporttest/Makefile | 28 + testbot/src/reporttest/report.template | 955 +++++++++++++++++++++++++++++++++ testbot/src/reporttest/reporttest.c | 255 +++++++++ testbot/src/reporttest/reporttest.rc | 1 + 4 files changed, 1239 insertions(+) Diff:
http://source.winehq.org/git/tools.git/?a=commitdiff;h=f1dd8155567175082fbc…
1
0
0
0
Henri Verbeet : usp10: Itemise ZWSP like ZWNJ and ZWJ.
by Alexandre Julliard
15 Feb '17
15 Feb '17
Module: wine Branch: master Commit: d00f7315e0cec0c2fe34ba5ab2b55cf5718860dd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d00f7315e0cec0c2fe34ba5ab…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Feb 13 22:57:14 2017 +0100 usp10: Itemise ZWSP like ZWNJ and ZWJ. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/tests/usp10.c | 2 +- dlls/usp10/usp10.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index 2e87d3c..c5cc401 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1799,7 +1799,7 @@ static void test_ScriptShape(HDC hdc) chars[1] = c; hr = ScriptItemize(chars, 3, 4, NULL, NULL, items, &nb); ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr); - todo_wine_if(c == 0x200b) ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n", + ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n", lf.lfFaceName, c, nb); item = &items[test_data[j].item]; diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 221aab4..3595ca2 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1363,7 +1363,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, for (i = 0; i < cInChars; i++) { /* Joiners get merged preferencially right */ - if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ)) + if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ || pwcInChars[i] == ZWSP)) { int j; if (i+1 == cInChars) @@ -1372,7 +1372,8 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, { for (j = i+1; j < cInChars; j++) { - if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ && pwcInChars[j] != Numeric_space) + if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ + && pwcInChars[j] != ZWSP && pwcInChars[j] != Numeric_space) { scripts[i] = scripts[j]; break; @@ -1497,14 +1498,15 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, } /* Joiners get merged preferencially right */ - if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ)) + if (i > 0 && (pwcInChars[i] == ZWJ || pwcInChars[i] == ZWNJ || pwcInChars[i] == ZWSP)) { int j; if (i+1 == cInChars && levels[i-1] == levels[i]) strength[i] = strength[i-1]; else for (j = i+1; j < cInChars && levels[i] == levels[j]; j++) - if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ && pwcInChars[j] != Numeric_space) + if (pwcInChars[j] != ZWJ && pwcInChars[j] != ZWNJ + && pwcInChars[j] != ZWSP && pwcInChars[j] != Numeric_space) { strength[i] = strength[j]; break;
1
0
0
0
Henri Verbeet : usp10: Explicitly check for zero-width control characters in ScriptShapeOpenType ().
by Alexandre Julliard
15 Feb '17
15 Feb '17
Module: wine Branch: master Commit: 721fbf617b06d2ac3ab44ca7074ca9b0862d6426 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=721fbf617b06d2ac3ab44ca70…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Feb 13 22:57:13 2017 +0100 usp10: Explicitly check for zero-width control characters in ScriptShapeOpenType(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/tests/usp10.c | 105 +++++++++++++++++++++++++++++++---------------- dlls/usp10/usp10.c | 20 +++++++-- 2 files changed, 85 insertions(+), 40 deletions(-) diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index b6fc038..2e87d3c 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1614,7 +1614,7 @@ static void test_ScriptShape(HDC hdc) SCRIPT_CACHE sc = NULL; WORD glyphs[4], glyphs2[4], logclust[4], glyphs3[4]; SCRIPT_VISATTR attrs[4]; - SCRIPT_ITEM items[2]; + SCRIPT_ITEM items[4]; int nb, i, j; hr = ScriptItemize(test1, 4, 2, NULL, NULL, items, NULL); @@ -1744,9 +1744,33 @@ static void test_ScriptShape(HDC hdc) for (i = 0; i < 2; i++) { static const WCHAR space[] = {' ', 0}; - static const WCHAR blanks[] = {'\t', '\r', '\n', 0x001c, 0x001d, 0x001e, 0x001f, - 0x200b, 0x200c, 0x200d, 0x200e, 0x200f, /* ZWSP, ZWNJ, ZWJ, LRM, RLM */ - 0x202a, 0x202b, 0x202c, 0x202d, 0x202e, 0}; /* LRE, RLE, PDF, LRO, RLO */ + static const struct + { + WCHAR c; + unsigned int item_count; + unsigned int item; + } + test_data[] = + { + {0x0009, 3, 1}, /* \t */ + {0x000a, 3, 1}, /* \n */ + {0x000d, 3, 1}, /* \r */ + {0x001c, 3, 1}, /* FS */ + {0x001d, 3, 1}, /* GS */ + {0x001e, 3, 1}, /* RS */ + {0x001f, 3, 1}, /* US */ + {0x200b, 1, 0}, /* ZWSP */ + {0x200c, 1, 0}, /* ZWNJ */ + {0x200d, 1, 0}, /* ZWJ */ + {0x200e, 3, 1}, /* LRM */ + {0x200f, 3, 1}, /* RLM */ + {0x202a, 3, 1}, /* LRE */ + {0x202b, 3, 1}, /* RLE */ + {0x202c, 3, 1}, /* PDF */ + {0x202d, 3, 1}, /* LRO */ + {0x202e, 3, 1}, /* RLO */ + }; + WCHAR chars[3]; HFONT font, oldfont = NULL; LOGFONTA lf; @@ -1765,43 +1789,52 @@ static void test_ScriptShape(HDC hdc) ok(hr == S_OK, "%s: expected S_OK, got %08x\n", lf.lfFaceName, hr); ok(nb == 1, "%s: expected 1, got %d\n", lf.lfFaceName, nb); - for (j = 0; blanks[j]; j++) + chars[0] = 'A'; + chars[2] = 'A'; + for (j = 0; j < sizeof(test_data) / sizeof(*test_data); ++j) { - hr = ScriptItemize(&blanks[j], 1, 2, NULL, NULL, items, NULL); - ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); - - ok(!items[0].a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", - lf.lfFaceName, blanks[j], items[0].a.fNoGlyphIndex); - hr = ScriptShape(hdc, &sc, &blanks[j], 1, 1, &items[0].a, glyphs2, logclust, attrs, &nb); - ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); - ok(nb == 1, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, blanks[j], nb); - ok(!items[0].a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", - lf.lfFaceName, blanks[j], items[0].a.fNoGlyphIndex); - - ok(glyphs[0] == glyphs2[0] || - broken(glyphs2[0] == blanks[j] && (blanks[j] < 0x10)), - "%s: [%02x] expected %04x, got %04x\n", lf.lfFaceName, blanks[j], glyphs[0], glyphs2[0]); - ok(attrs[0].fZeroWidth || broken(!attrs[0].fZeroWidth && (blanks[j] < 0x10) /* Vista */), - "%s: [%02x] got unexpected fZeroWidth %#x.\n", lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); - - items[0].a.fNoGlyphIndex = 1; - hr = ScriptShape(hdc, &sc, &blanks[j], 1, 1, &items[0].a, glyphs2, logclust, attrs, &nb); - ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, blanks[j], hr); - ok(nb == 1, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, blanks[j], nb); - - if (blanks[j] == 0x200b || blanks[j] == 0x200c || blanks[j] == 0x200d) + WCHAR c = test_data[j].c; + SCRIPT_ITEM *item; + + chars[1] = c; + hr = ScriptItemize(chars, 3, 4, NULL, NULL, items, &nb); + ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr); + todo_wine_if(c == 0x200b) ok(nb == test_data[j].item_count, "%s: [%02x] Got unexpected item count %d.\n", + lf.lfFaceName, c, nb); + item = &items[test_data[j].item]; + + ok(!item->a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", + lf.lfFaceName, c, item->a.fNoGlyphIndex); + hr = ScriptShape(hdc, &sc, chars, 3, 3, &item->a, glyphs2, logclust, attrs, &nb); + ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr); + ok(nb == 3, "%s: [%02x] expected 3, got %d\n", lf.lfFaceName, c, nb); + ok(!item->a.fNoGlyphIndex, "%s: [%02x] got unexpected fNoGlyphIndex %#x.\n", + lf.lfFaceName, c, item->a.fNoGlyphIndex); + + ok(glyphs[0] == glyphs2[1] || + broken(glyphs2[1] == c && (c < 0x10)), + "%s: [%02x] expected %04x, got %04x\n", lf.lfFaceName, c, glyphs[0], glyphs2[1]); + ok(attrs[1].fZeroWidth || broken(!attrs[1].fZeroWidth && (c < 0x10) /* Vista */), + "%s: [%02x] got unexpected fZeroWidth %#x.\n", lf.lfFaceName, c, attrs[1].fZeroWidth); + + item->a.fNoGlyphIndex = 1; + hr = ScriptShape(hdc, &sc, chars, 3, 3, &item->a, glyphs2, logclust, attrs, &nb); + ok(hr == S_OK, "%s: [%02x] expected S_OK, got %08x\n", lf.lfFaceName, c, hr); + ok(nb == 3, "%s: [%02x] expected 1, got %d\n", lf.lfFaceName, c, nb); + + if (c == 0x200b || c == 0x200c || c == 0x200d) { - ok(glyphs2[0] == 0x0020, - "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, blanks[j], glyphs2[0]); - ok(attrs[0].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", - lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + ok(glyphs2[1] == 0x0020, + "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, c, glyphs2[1]); + ok(attrs[1].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", + lf.lfFaceName, c, attrs[1].fZeroWidth); } else { - ok(glyphs2[0] == blanks[j], - "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, blanks[j], glyphs2[0]); - ok(!attrs[0].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", - lf.lfFaceName, blanks[j], attrs[0].fZeroWidth); + ok(glyphs2[1] == c, + "%s: [%02x] got unexpected %04x.\n", lf.lfFaceName, c, glyphs2[1]); + ok(!attrs[1].fZeroWidth, "%s: [%02x] got unexpected fZeroWidth %#x.\n", + lf.lfFaceName, c, attrs[1].fZeroWidth); } } if (oldfont) diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 0471fc6..221aab4 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -3123,9 +3123,6 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, chInput = mirror_char(pwcChars[idx]); else chInput = pwcChars[idx]; - /* special case for tabs */ - if (chInput == 0x0009) - chInput = 0x0020; rChars[i] = chInput; } else @@ -3165,6 +3162,20 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, SHAPE_ContextualShaping(hdc, (ScriptCache *)*psc, psa, rChars, cChars, pwOutGlyphs, pcGlyphs, cMaxGlyphs, pwLogClust); SHAPE_ApplyDefaultOpentypeFeatures(hdc, (ScriptCache *)*psc, psa, pwOutGlyphs, pcGlyphs, cMaxGlyphs, cChars, pwLogClust); SHAPE_CharGlyphProp(hdc, (ScriptCache *)*psc, psa, pwcChars, cChars, pwOutGlyphs, *pcGlyphs, pwLogClust, pCharProps, pOutGlyphProps); + + for (i = 0; i < cChars; ++i) + { + /* Special case for tabs and joiners. As control characters, ZWNJ + * and ZWJ would in principle get handled by the corresponding + * shaping functions. However, since ZWNJ and ZWJ can get merged + * into adjoining runs during itemisation, these don't generally + * get classified as Script_Control. */ + if (pwcChars[i] == 0x0009 || pwcChars[i] == ZWSP || pwcChars[i] == ZWNJ || pwcChars[i] == ZWJ) + { + pwOutGlyphs[pwLogClust[i]] = ((ScriptCache *)*psc)->sfp.wgBlank; + pOutGlyphProps[pwLogClust[i]].sva.fZeroWidth = 1; + } + } heap_free(rChars); } else @@ -3189,7 +3200,8 @@ HRESULT WINAPI ScriptShapeOpenType( HDC hdc, SCRIPT_CACHE *psc, pOutGlyphProps[i].sva.fZeroWidth = 1; } } - else if (psa->eScript == Script_Control) + else if (psa->eScript == Script_Control || pwcChars[idx] == ZWSP + || pwcChars[idx] == ZWNJ || pwcChars[idx] == ZWJ) { if (pwcChars[idx] == 0x0009 || pwcChars[idx] == 0x000A || pwcChars[idx] == 0x000D || pwcChars[idx] >= 0x001C)
1
0
0
0
← Newer
1
...
37
38
39
40
41
42
43
...
84
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
Results per page:
10
25
50
100
200