winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 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
499 discussions
Start a n
N
ew thread
Michael Stefaniuc : windowscodecs: Remove redundant NULL check before HeapFree().
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: eb271ec4ba6855271bd06256f89e94211e5ea191 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eb271ec4ba6855271bd06256…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jan 29 20:38:08 2019 +0100 windowscodecs: Remove redundant NULL check before HeapFree(). Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/pngformat.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index faffeae..db0fa9e 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -815,8 +815,7 @@ static HRESULT WINAPI PngDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p end: LeaveCriticalSection(&This->lock); - if (row_pointers) - HeapFree(GetProcessHeap(), 0, row_pointers); + HeapFree(GetProcessHeap(), 0, row_pointers); return hr; }
1
0
0
0
Michael Stefaniuc : windowscodecs: Use the ARRAY_SIZE() macro.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: 52066ee0922e460ff26bb1d05ffebd82d551babc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=52066ee0922e460ff26bb1d0…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Tue Jan 29 20:38:04 2019 +0100 windowscodecs: Use the ARRAY_SIZE() macro. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/converter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index 8e0fb77..37b60fa 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -709,7 +709,7 @@ static void check_tiff_format(IStream *stream, const WICPixelFormatGUID *format) ok(hr == S_OK, "GetCount error %#x\n", hr); ok(count != 0, "wrong count %u\n", count); - for (i = 0; i < sizeof(tag)/sizeof(tag[0]); i++) + for (i = 0; i < ARRAY_SIZE(tag); i++) { PropVariantInit(&id); PropVariantInit(&value);
1
0
0
0
Dmitry Timoshkov : gdiplus/tests: Add some tests for GdipInitializePalette.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: b7aa42c0086dea2d1bb1ecaff6d1be011cc66c31 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b7aa42c0086dea2d1bb1ecaf…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 31 09:56:07 2019 +0800 gdiplus/tests: Add some tests for GdipInitializePalette. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/tests/image.c | 146 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 72a984a..5aec1c2 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -34,6 +34,8 @@ static GpStatus (WINAPI *pGdipBitmapGetHistogramSize)(HistogramFormat,UINT*); static GpStatus (WINAPI *pGdipBitmapGetHistogram)(GpBitmap*,HistogramFormat,UINT,UINT*,UINT*,UINT*,UINT*); static GpStatus (WINAPI *pGdipImageSetAbort)(GpImage*,GdiplusAbort*); +static GpStatus (WINGDIPAPI *pGdipInitializePalette)(ColorPalette*,PaletteType,INT,BOOL,GpBitmap*); + #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (UINT)(expected), (UINT)(got)) #define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) @@ -5339,6 +5341,149 @@ static void test_GdipLoadImageFromStream(void) IStream_Release(stream); } +static BYTE *init_bitmap(UINT *width, UINT *height, UINT *stride) +{ + BYTE *src; + UINT i, j, scale; + + *width = 256; + *height = 256; + *stride = (*width * 3 + 3) & ~3; + trace("width %d, height %d, stride %d\n", *width, *height, *stride); + + src = HeapAlloc(GetProcessHeap(), 0, *stride * *height); + + scale = 256 / *width; + if (!scale) scale = 1; + + for (i = 0; i < *height; i++) + { + for (j = 0; j < *width; j++) + { + src[i * *stride + j*3 + 0] = scale * i; + src[i * *stride + j*3 + 1] = scale * (255 - (i+j)/2); + src[i * *stride + j*3 + 2] = scale * j; + } + } + + return src; +} + +static void test_GdipInitializePalette(void) +{ + GpStatus status; + BYTE *data; + GpBitmap *bitmap; + ColorPalette *palette; + UINT width, height, stride; + + pGdipInitializePalette = (void *)GetProcAddress(GetModuleHandleA("gdiplus.dll"), "GdipInitializePalette"); + if (!pGdipInitializePalette) + { + win_skip("GdipInitializePalette is not supported on this platform\n"); + return; + } + + data = init_bitmap(&width, &height, &stride); + + status = GdipCreateBitmapFromScan0(width, height, stride, PixelFormat24bppRGB, data, &bitmap); + expect(Ok, status); + + palette = GdipAlloc(sizeof(*palette) + sizeof(ARGB) * 255); + + palette->Flags = 0; + palette->Count = 15; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); + expect(GenericError, status); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, NULL); + expect(InvalidParameter, status); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeCustom, 16, FALSE, NULL); + expect(Ok, status); + expect(0, palette->Flags); + expect(256, palette->Count); + expect(0x11111111, palette->Entries[0]); + expect(0x11111111, palette->Entries[128]); + expect(0x11111111, palette->Entries[255]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedBW, 0, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x200, palette->Flags); + expect(2, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffffffff, palette->Entries[1]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, NULL); + expect(Ok, status); +todo_wine + expect(0x300, palette->Flags); + expect(16, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffc0c0c0, palette->Entries[8]); + expect(0xff008080, palette->Entries[15]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone8, 1, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x300, palette->Flags); + expect(16, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xffc0c0c0, palette->Entries[8]); + expect(0xff008080, palette->Entries[15]); + + memset(palette->Entries, 0x11, sizeof(ARGB) * 256); + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeFixedHalftone252, 1, FALSE, bitmap); + expect(Ok, status); +todo_wine + expect(0x800, palette->Flags); + expect(252, palette->Count); + expect(0xff000000, palette->Entries[0]); + expect(0xff990066, palette->Entries[128]); + expect(0xffffffff, palette->Entries[251]); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 1, FALSE, bitmap); + expect(InvalidParameter, status); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 2, FALSE, bitmap); + expect(Ok, status); + expect(0, palette->Flags); + expect(2, palette->Count); + + palette->Flags = 0; + palette->Count = 256; + status = pGdipInitializePalette(palette, PaletteTypeOptimal, 16, FALSE, bitmap); + expect(Ok, status); + expect(0, palette->Flags); + expect(16, palette->Count); + + /* passing invalid enumeration palette type crashes under most Windows versions */ + + GdipFree(palette); + GdipDisposeImage((GpImage *)bitmap); +} + START_TEST(image) { HMODULE mod = GetModuleHandleA("gdiplus.dll"); @@ -5363,6 +5508,7 @@ START_TEST(image) pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); + test_GdipInitializePalette(); test_png_color_formats(); test_supported_encoders(); test_CloneBitmapArea();
1
0
0
0
Dmitry Timoshkov : gdiplus: Implement GdipInitializePalette.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: cbc486aca1c0691df09801f5dc3ef039272a66a7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbc486aca1c0691df09801f5…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 31 09:56:03 2019 +0800 gdiplus: Implement GdipInitializePalette. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 110 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index e0cf6d5..ed9d50c 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -615,7 +615,7 @@ 615 stub GdipGetEffectParameterSize 616 stub GdipGetEffectParameters 617 stdcall GdipSetEffectParameters(ptr ptr long) -618 stub GdipInitializePalette +618 stdcall GdipInitializePalette(ptr long long long ptr) 619 stdcall GdipBitmapCreateApplyEffect(ptr long ptr ptr ptr ptr long ptr ptr) 620 stdcall GdipBitmapApplyEffect(ptr ptr ptr long ptr ptr) 621 stdcall GdipBitmapGetHistogram(ptr long long ptr ptr ptr ptr) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 8a136ef..1966401 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5640,3 +5640,111 @@ GpStatus WINGDIPAPI GdipBitmapGetHistogramSize(HistogramFormat format, UINT *num *num_of_entries = 256; return Ok; } + +static GpStatus create_optimal_palette(ColorPalette *palette, INT desired, + BOOL transparent, GpBitmap *bitmap) +{ + GpStatus status; + BitmapData data; + HRESULT hr; + IWICImagingFactory *factory; + IWICPalette *wic_palette; + + if (!bitmap) return InvalidParameter; + if (palette->Count < desired) return GenericError; + + status = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, PixelFormat24bppRGB, &data); + if (status != Ok) return status; + + hr = WICCreateImagingFactory_Proxy(WINCODEC_SDK_VERSION, &factory); + if (hr != S_OK) + { + GdipBitmapUnlockBits(bitmap, &data); + return hresult_to_status(hr); + } + + hr = IWICImagingFactory_CreatePalette(factory, &wic_palette); + if (hr == S_OK) + { + IWICBitmap *bitmap; + + /* PixelFormat24bppRGB actually stores the bitmap bits as BGR. */ + hr = IWICImagingFactory_CreateBitmapFromMemory(factory, data.Width, data.Height, + &GUID_WICPixelFormat24bppBGR, data.Stride, data.Stride * data.Width, data.Scan0, &bitmap); + if (hr == S_OK) + { + hr = IWICPalette_InitializeFromBitmap(wic_palette, (IWICBitmapSource *)bitmap, desired, transparent); + if (hr == S_OK) + { + palette->Flags = 0; + IWICPalette_GetColorCount(wic_palette, &palette->Count); + IWICPalette_GetColors(wic_palette, palette->Count, palette->Entries, &palette->Count); + } + + IWICBitmap_Release(bitmap); + } + + IWICPalette_Release(wic_palette); + } + + IWICImagingFactory_Release(factory); + GdipBitmapUnlockBits(bitmap, &data); + + return hresult_to_status(hr); +} + +/***************************************************************************** + * GdipInitializePalette [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipInitializePalette(ColorPalette *palette, + PaletteType type, INT desired, BOOL transparent, GpBitmap *bitmap) +{ + TRACE("(%p,%d,%d,%d,%p)\n", palette, type, desired, transparent, bitmap); + + if (!palette) return InvalidParameter; + + switch (type) + { + case PaletteTypeCustom: + return Ok; + + case PaletteTypeOptimal: + return create_optimal_palette(palette, desired, transparent, bitmap); + + /* WIC palette type enumeration matches these gdiplus enums */ + case PaletteTypeFixedBW: + case PaletteTypeFixedHalftone8: + case PaletteTypeFixedHalftone27: + case PaletteTypeFixedHalftone64: + case PaletteTypeFixedHalftone125: + case PaletteTypeFixedHalftone216: + case PaletteTypeFixedHalftone252: + case PaletteTypeFixedHalftone256: + { + ColorPalette *wic_palette; + GpStatus status = Ok; + + wic_palette = get_palette(NULL, type); + if (!wic_palette) return OutOfMemory; + + if (palette->Count >= wic_palette->Count) + { + palette->Flags = wic_palette->Flags; + palette->Count = wic_palette->Count; + memcpy(palette->Entries, wic_palette->Entries, wic_palette->Count * sizeof(wic_palette->Entries[0])); + } + else + status = GenericError; + + heap_free(wic_palette); + + return status; + } + + default: + FIXME("unknown palette type %d\n", type); + break; + } + + return InvalidParameter; +} diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index ad944d6..57fa6c6 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -266,6 +266,7 @@ GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB); GpStatus WINGDIPAPI GdipGraphicsSetAbort(GpGraphics*,GdiplusAbort*); GpStatus WINGDIPAPI GdipGetVisibleClipBounds(GpGraphics*,GpRectF*); GpStatus WINGDIPAPI GdipGetVisibleClipBoundsI(GpGraphics*,GpRect*); +GpStatus WINGDIPAPI GdipInitializePalette(ColorPalette*,PaletteType,INT,BOOL,GpBitmap*); GpStatus WINGDIPAPI GdipIsClipEmpty(GpGraphics*, BOOL*); GpStatus WINGDIPAPI GdipIsVisiblePoint(GpGraphics*,REAL,REAL,BOOL*); GpStatus WINGDIPAPI GdipIsVisiblePointI(GpGraphics*,INT,INT,BOOL*);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Implement IWICPalette:: InitializeFromBitmap.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: d102d6e9f7c705970bb97feae03592e0ac702c60 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d102d6e9f7c705970bb97fea…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 31 09:55:58 2019 +0800 windowscodecs: Implement IWICPalette::InitializeFromBitmap. Based on median cut implementation created by Sebastian Lackner. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Vincent Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/palette.c | 279 ++++++++++++++++++++++++++++++++++++- dlls/windowscodecs/tests/palette.c | 21 +-- 2 files changed, 275 insertions(+), 25 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=d102d6e9f7c705970bb9…
1
0
0
0
Andrey Gusev : d3dx11: Fix D3DX11CreateShaderResourceViewFromMemory spec entry.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: 8bf63a4c37e534d02b0eeebf91135d99b8ee4a88 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8bf63a4c37e534d02b0eeebf…
Author: Andrey Gusev <andrey.goosev(a)gmail.com> Date: Wed Jan 30 22:41:49 2019 +0200 d3dx11: Fix D3DX11CreateShaderResourceViewFromMemory spec entry. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=42078
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx11_43/d3dx11_43.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3dx11_43/d3dx11_43.spec b/dlls/d3dx11_43/d3dx11_43.spec index 76a3916..dde8821 100644 --- a/dlls/d3dx11_43/d3dx11_43.spec +++ b/dlls/d3dx11_43/d3dx11_43.spec @@ -17,7 +17,7 @@ @ stub D3DX11CreateAsyncTextureProcessor @ stub D3DX11CreateShaderResourceViewFromFileA @ stub D3DX11CreateShaderResourceViewFromFileW -@ stub D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) +@ stdcall D3DX11CreateShaderResourceViewFromMemory(ptr ptr long ptr ptr ptr ptr) @ stub D3DX11CreateShaderResourceViewFromResourceA @ stub D3DX11CreateShaderResourceViewFromResourceW @ stdcall D3DX11CreateTextureFromFileA(ptr str ptr ptr ptr ptr)
1
0
0
0
Dmitry Timoshkov : crypt32: Simplify the code.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: fca88e169a56186dbe11da944c321766791d1802 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fca88e169a56186dbe11da94…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 31 13:24:25 2019 +0800 crypt32: Simplify the code. cache can't be FALSE at this point. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/cert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index cf14c2c..e1c7c54 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -919,7 +919,7 @@ BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert, if (pdwKeySpec) *pdwKeySpec = keyContext.dwKeySpec; if (pfCallerFreeProv) - *pfCallerFreeProv = !cache; + *pfCallerFreeProv = FALSE; } } if (!*phCryptProv)
1
0
0
0
Dmitry Timoshkov : crypt32: Add support for CRYPT_ACQUIRE_SILENT_FLAG to CryptAcquireCertificatePrivateKey.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: df173bd0973630c10c88b1c3b39ce22c77647eb0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=df173bd0973630c10c88b1c3…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jan 31 13:24:21 2019 +0800 crypt32: Add support for CRYPT_ACQUIRE_SILENT_FLAG to CryptAcquireCertificatePrivateKey. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/crypt32/cert.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index dde6528..cf14c2c 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -826,7 +826,7 @@ BOOL WINAPI CertSetCertificateContextProperty(PCCERT_CONTEXT pCertContext, * the certificate if info is NULL. The acquired provider is returned in * *phCryptProv, and the key spec for the provider is returned in *pdwKeySpec. */ -static BOOL CRYPT_AcquirePrivateKeyFromProvInfo(PCCERT_CONTEXT pCert, +static BOOL CRYPT_AcquirePrivateKeyFromProvInfo(PCCERT_CONTEXT pCert, DWORD dwFlags, PCRYPT_KEY_PROV_INFO info, HCRYPTPROV *phCryptProv, DWORD *pdwKeySpec) { DWORD size = 0; @@ -857,7 +857,7 @@ static BOOL CRYPT_AcquirePrivateKeyFromProvInfo(PCCERT_CONTEXT pCert, if (ret) { ret = CryptAcquireContextW(phCryptProv, info->pwszContainerName, - info->pwszProvName, info->dwProvType, 0); + info->pwszProvName, info->dwProvType, (dwFlags & CRYPT_ACQUIRE_SILENT_FLAG) ? CRYPT_SILENT : 0); if (ret) { DWORD i; @@ -924,7 +924,7 @@ BOOL WINAPI CryptAcquireCertificatePrivateKey(PCCERT_CONTEXT pCert, } if (!*phCryptProv) { - ret = CRYPT_AcquirePrivateKeyFromProvInfo(pCert, info, + ret = CRYPT_AcquirePrivateKeyFromProvInfo(pCert, dwFlags, info, &keyContext.hCryptProv, &keyContext.dwKeySpec); if (ret) {
1
0
0
0
Nikolay Sivov : dwrite: Implement masking with positional lookup flags.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: cb39c9853c5ff0161090f439711a257a0e66d0c8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cb39c9853c5ff0161090f439…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 31 11:35:30 2019 +0300 dwrite: Implement masking with positional lookup flags. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/analyzer.c | 2 + dlls/dwrite/dwrite_private.h | 7 +++ dlls/dwrite/opentype.c | 127 ++++++++++++++++++++++++++++++++++++++++++- dlls/dwrite/shape.c | 1 + 4 files changed, 136 insertions(+), 1 deletion(-) diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 13c1941..7f15c91 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -1313,6 +1313,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphPlacements(IDWriteTextAnalyzer2 context.text = text; context.length = text_len; context.is_rtl = is_rtl; + context.u.pos.glyphs = glyphs; context.u.pos.glyph_props = glyph_props; context.glyph_count = glyph_count; context.advances = advances; @@ -1374,6 +1375,7 @@ static HRESULT WINAPI dwritetextanalyzer_GetGdiCompatibleGlyphPlacements(IDWrite context.text = text; context.length = text_len; context.is_rtl = is_rtl; + context.u.pos.glyphs = glyphs; context.u.pos.glyph_props = glyph_props; context.glyph_count = glyph_count; context.advances = advances; diff --git a/dlls/dwrite/dwrite_private.h b/dlls/dwrite/dwrite_private.h index b7d5d45..5a6cd4b 100644 --- a/dlls/dwrite/dwrite_private.h +++ b/dlls/dwrite/dwrite_private.h @@ -366,6 +366,12 @@ struct scriptshaping_cache unsigned int feature_list; unsigned int lookup_list; } gpos; + + struct + { + struct dwrite_fonttable table; + unsigned int classdef; + } gdef; }; struct scriptshaping_context @@ -381,6 +387,7 @@ struct scriptshaping_context { struct { + const UINT16 *glyphs; const DWRITE_SHAPING_GLYPH_PROPERTIES *glyph_props; } pos; } u; diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index b360bbb..8cc7463 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -32,6 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); #define MS_OS2_TAG DWRITE_MAKE_OPENTYPE_TAG('O','S','/','2') #define MS_POST_TAG DWRITE_MAKE_OPENTYPE_TAG('p','o','s','t') #define MS_TTCF_TAG DWRITE_MAKE_OPENTYPE_TAG('t','t','c','f') +#define MS_GDEF_TAG DWRITE_MAKE_OPENTYPE_TAG('G','D','E','F') #define MS_GPOS_TAG DWRITE_MAKE_OPENTYPE_TAG('G','P','O','S') #define MS_GSUB_TAG DWRITE_MAKE_OPENTYPE_TAG('G','S','U','B') #define MS_NAME_TAG DWRITE_MAKE_OPENTYPE_TAG('n','a','m','e') @@ -416,6 +417,47 @@ struct ot_script_list struct ot_script_record scripts[1]; }; +enum ot_gdef_class +{ + GDEF_CLASS_UNCLASSIFIED = 0, + GDEF_CLASS_BASE = 1, + GDEF_CLASS_LIGATURE = 2, + GDEF_CLASS_MARK = 3, + GDEF_CLASS_COMPONENT = 4, + GDEF_CLASS_MAX = GDEF_CLASS_COMPONENT, +}; + +struct gdef_header +{ + DWORD version; + WORD classdef; + WORD attach_list; + WORD ligcaret_list; + WORD markattach_classdef; +}; + +struct ot_gdef_classdef_format1 +{ + WORD format; + WORD start_glyph; + WORD glyph_count; + WORD classes[1]; +}; + +struct ot_gdef_class_range +{ + WORD start_glyph; + WORD end_glyph; + WORD glyph_class; +}; + +struct ot_gdef_classdef_format2 +{ + WORD format; + WORD range_count; + struct ot_gdef_class_range ranges[1]; +}; + struct gpos_gsub_header { DWORD version; @@ -424,6 +466,16 @@ struct gpos_gsub_header WORD lookup_list; }; +enum gsub_gpos_lookup_flags +{ + LOOKUP_FLAG_RTL = 0x1, + LOOKUP_FLAG_IGNORE_BASE = 0x2, + LOOKUP_FLAG_IGNORE_LIGATURES = 0x4, + LOOKUP_FLAG_IGNORE_MARKS = 0x8, + + LOOKUP_FLAG_IGNORE_MASK = 0xe, +}; + enum gpos_lookup_type { GPOS_LOOKUP_SINGLE_ADJUSTMENT = 1, @@ -2447,6 +2499,12 @@ void opentype_layout_scriptshaping_cache_init(struct scriptshaping_cache *cache) cache->gpos.lookup_list = table_read_be_word(&cache->gpos.table, FIELD_OFFSET(struct gpos_gsub_header, lookup_list)); } + + cache->font->grab_font_table(cache->context, MS_GDEF_TAG, &cache->gdef.table.data, &cache->gdef.table.size, + &cache->gdef.table.context); + + if (cache->gdef.table.data) + cache->gdef.classdef = table_read_be_word(&cache->gdef.table, FIELD_OFFSET(struct gdef_header, classdef)); } DWORD opentype_layout_find_script(const struct scriptshaping_cache *cache, DWORD kind, DWORD script, @@ -2519,6 +2577,64 @@ DWORD opentype_layout_find_language(const struct scriptshaping_cache *cache, DWO return 0; } +static int gdef_class_compare_format2(const void *g, const void *r) +{ + const struct ot_gdef_class_range *range = r; + UINT16 glyph = *(UINT16 *)g; + + if (glyph < GET_BE_WORD(range->start_glyph)) + return -1; + else if (glyph > GET_BE_WORD(range->end_glyph)) + return 1; + else + return 0; +} + +static unsigned int opentype_layout_get_glyph_class(const struct dwrite_fonttable *table, + unsigned int offset, UINT16 glyph) +{ + WORD format = table_read_be_word(table, offset), count; + unsigned int glyph_class = GDEF_CLASS_UNCLASSIFIED; + + if (format == 1) + { + const struct ot_gdef_classdef_format1 *format1; + + count = table_read_be_word(table, offset + FIELD_OFFSET(struct ot_gdef_classdef_format1, glyph_count)); + format1 = table_read_ensure(table, offset, FIELD_OFFSET(struct ot_gdef_classdef_format1, classes[count])); + if (format1) + { + WORD start_glyph = GET_BE_WORD(format1->start_glyph); + if (glyph >= start_glyph && (glyph - start_glyph) < count) + { + glyph_class = GET_BE_WORD(format1->classes[glyph - start_glyph]); + if (glyph_class > GDEF_CLASS_MAX) + glyph_class = GDEF_CLASS_UNCLASSIFIED; + } + } + } + else if (format == 2) + { + const struct ot_gdef_classdef_format2 *format2; + + count = table_read_be_word(table, offset + FIELD_OFFSET(struct ot_gdef_classdef_format2, range_count)); + format2 = table_read_ensure(table, offset, FIELD_OFFSET(struct ot_gdef_classdef_format2, ranges[count])); + if (format2) + { + const struct ot_gdef_class_range *range = bsearch(&glyph, format2->ranges, count, + sizeof(struct ot_gdef_class_range), gdef_class_compare_format2); + glyph_class = range && glyph <= GET_BE_WORD(range->end_glyph) ? + GET_BE_WORD(range->glyph_class) : GDEF_CLASS_UNCLASSIFIED; + if (glyph_class > GDEF_CLASS_MAX) + glyph_class = GDEF_CLASS_UNCLASSIFIED; + } + } + else + WARN("Unknown GDEF format %u.\n", format); + + return glyph_class; +} + struct lookup { unsigned int offset; @@ -2545,7 +2661,16 @@ static void glyph_iterator_init(const struct scriptshaping_context *context, uns static BOOL glyph_iterator_match(const struct glyph_iterator *iter) { - /* FIXME: implement class matching */ + struct scriptshaping_cache *cache = iter->context->cache; + + if (cache->gdef.classdef) + { + unsigned int glyph_class = opentype_layout_get_glyph_class(&cache->gdef.table, cache->gdef.classdef, + iter->context->u.pos.glyphs[iter->pos]); + if ((1 << glyph_class) & iter->flags & LOOKUP_FLAG_IGNORE_MASK) + return FALSE; + } + return TRUE; } diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c index 831c775..d7d1261 100644 --- a/dlls/dwrite/shape.c +++ b/dlls/dwrite/shape.c @@ -51,6 +51,7 @@ void release_scriptshaping_cache(struct scriptshaping_cache *cache) if (!cache) return; + cache->font->release_font_table(cache->context, cache->gdef.table.context); cache->font->release_font_table(cache->context, cache->gpos.table.context); heap_free(cache); }
1
0
0
0
Nikolay Sivov : dwrite: Add a helper to apply positional lookup.
by Alexandre Julliard
31 Jan '19
31 Jan '19
Module: wine Branch: master Commit: b2d6fbe1005205331d8ca7a2423045577055b408 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b2d6fbe1005205331d8ca7a2…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Jan 31 11:35:29 2019 +0300 dwrite: Add a helper to apply positional lookup. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dwrite/opentype.c | 227 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 209 insertions(+), 18 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=b2d6fbe1005205331d8c…
1
0
0
0
← Newer
1
2
3
4
5
...
50
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
Results per page:
10
25
50
100
200