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 2011
----- 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
879 discussions
Start a n
N
ew thread
Vincent Povirk : windowscodecs: Accept failure when seeking to the start of a TGA footer.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: f4ef7ff48ae9b5decaddd5f2be9856466bfe01af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4ef7ff48ae9b5decaddd5f2b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 17:13:02 2011 -0600 windowscodecs: Accept failure when seeking to the start of a TGA footer. --- dlls/windowscodecs/tgaformat.c | 31 +++++++++++++++++++------------ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/dlls/windowscodecs/tgaformat.c b/dlls/windowscodecs/tgaformat.c index 14510cf..8db1cf1 100644 --- a/dlls/windowscodecs/tgaformat.c +++ b/dlls/windowscodecs/tgaformat.c @@ -284,25 +284,32 @@ static HRESULT WINAPI TgaDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p /* Read footer if there is one */ seek.QuadPart = -sizeof(tga_footer); hr = IStream_Seek(pIStream, seek, STREAM_SEEK_END, NULL); - if (FAILED(hr)) goto end; - hr = IStream_Read(pIStream, &footer, sizeof(tga_footer), &bytesread); - if (SUCCEEDED(hr) && bytesread != sizeof(tga_footer)) - { - TRACE("got only %u footer bytes\n", bytesread); - hr = E_FAIL; - } - if (FAILED(hr)) goto end; + if (SUCCEEDED(hr)) { + hr = IStream_Read(pIStream, &footer, sizeof(tga_footer), &bytesread); + if (SUCCEEDED(hr) && bytesread != sizeof(tga_footer)) + { + TRACE("got only %u footer bytes\n", bytesread); + hr = E_FAIL; + } - if (memcmp(footer.magic, tga_footer_magic, sizeof(tga_footer_magic)) == 0) - { - This->extension_area_offset = footer.extension_area_offset; - This->developer_directory_offset = footer.developer_directory_offset; + if (memcmp(footer.magic, tga_footer_magic, sizeof(tga_footer_magic)) == 0) + { + This->extension_area_offset = footer.extension_area_offset; + This->developer_directory_offset = footer.developer_directory_offset; + } + else + { + This->extension_area_offset = 0; + This->developer_directory_offset = 0; + } } else { + /* File is too small to have a footer. */ This->extension_area_offset = 0; This->developer_directory_offset = 0; + hr = S_OK; } if (This->extension_area_offset)
1
0
0
0
Vincent Povirk : windowscodecs: Ignore an unspecified extra sample in RGB TIFF images.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 377d890820f36a1d363e4f857c47a2d8e433755b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=377d890820f36a1d363e4f857…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 15:46:44 2011 -0600 windowscodecs: Ignore an unspecified extra sample in RGB TIFF images. --- dlls/windowscodecs/tiffformat.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 5c8aae9..976870a 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -333,6 +333,9 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) else switch(extra_samples[0]) { + case 0: /* Unspecified data */ + decode_info->format = &GUID_WICPixelFormat32bppBGR; + break; case 1: /* Associated (pre-multiplied) alpha data */ decode_info->format = &GUID_WICPixelFormat32bppPBGRA; break; @@ -350,6 +353,10 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) else switch(extra_samples[0]) { + case 0: /* Unspecified data */ + /* decode_info->format = &GUID_WICPixelFormat64bppRGB; */ + FIXME("64-bit RGB is unsupported\n"); + return E_FAIL; case 1: /* Associated (pre-multiplied) alpha data */ decode_info->format = &GUID_WICPixelFormat64bppPRGBA; break;
1
0
0
0
Vincent Povirk : windowscodecs: Avoid an iface -> impl conversion from a non-method.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: a16df86db360d2704d156a1aca881679308e43ac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a16df86db360d2704d156a1ac…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 15:36:14 2011 -0600 windowscodecs: Avoid an iface -> impl conversion from a non-method. --- dlls/windowscodecs/bmpdecode.c | 49 ++++++++++++++++++++----------- dlls/windowscodecs/icoformat.c | 6 ++- dlls/windowscodecs/wincodecs_private.h | 7 +++- 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c index 04e300d..bd0ace1 100644 --- a/dlls/windowscodecs/bmpdecode.c +++ b/dlls/windowscodecs/bmpdecode.c @@ -59,10 +59,9 @@ typedef struct { DWORD bc2AppData; } BITMAPCOREHEADER2; -struct BmpDecoder; -typedef HRESULT (*ReadDataFunc)(struct BmpDecoder* This); +typedef HRESULT (*ReadDataFunc)(BmpDecoder* This); -typedef struct BmpDecoder { +struct BmpDecoder { const IWICBitmapDecoderVtbl *lpVtbl; const IWICBitmapFrameDecodeVtbl *lpFrameVtbl; LONG ref; @@ -80,7 +79,7 @@ typedef struct BmpDecoder { CRITICAL_SECTION lock; /* must be held when initialized/imagedata is set or stream is accessed */ int packed; /* If TRUE, don't look for a file header and assume a packed DIB. */ int icoframe; /* If TRUE, this is a frame of a .ico file. */ -} BmpDecoder; +}; static inline BmpDecoder *impl_from_frame(IWICBitmapFrameDecode *iface) { @@ -1142,16 +1141,9 @@ static const IWICBitmapDecoderVtbl BmpDecoder_Vtbl = { BmpDecoder_GetFrame }; -static HRESULT BmpDecoder_Construct(int packed, int icoframe, IUnknown *pUnkOuter, REFIID iid, void** ppv) +static HRESULT BmpDecoder_Create(int packed, int icoframe, BmpDecoder **ppDecoder) { BmpDecoder *This; - HRESULT ret; - - TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv); - - *ppv = NULL; - - if (pUnkOuter) return CLASS_E_NOAGGREGATION; This = HeapAlloc(GetProcessHeap(), 0, sizeof(BmpDecoder)); if (!This) return E_OUTOFMEMORY; @@ -1167,6 +1159,25 @@ static HRESULT BmpDecoder_Construct(int packed, int icoframe, IUnknown *pUnkOute This->packed = packed; This->icoframe = icoframe; + *ppDecoder = This; + + return S_OK; +} + +static HRESULT BmpDecoder_Construct(int packed, int icoframe, IUnknown *pUnkOuter, REFIID iid, void** ppv) +{ + BmpDecoder *This; + HRESULT ret; + + TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv); + + *ppv = NULL; + + if (pUnkOuter) return CLASS_E_NOAGGREGATION; + + ret = BmpDecoder_Create(packed, icoframe, &This); + if (FAILED(ret)) return ret; + ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This); @@ -1183,17 +1194,19 @@ HRESULT DibDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) return BmpDecoder_Construct(TRUE, FALSE, pUnkOuter, iid, ppv); } -HRESULT IcoDibDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) +HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder) { - return BmpDecoder_Construct(TRUE, TRUE, pUnkOuter, iid, ppv); + return BmpDecoder_Create(TRUE, TRUE, ppDecoder); } -/* Return the offset where the mask of an icon might be, or 0 for failure. */ -void BmpDecoder_FindIconMask(IWICBitmapDecoder *decoder, ULONG *mask_offset, int *topdown) +void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder) { - BmpDecoder *This = (BmpDecoder*)decoder; + *ppDecoder = (IWICBitmapDecoder*)This; +} - assert(This->lpVtbl == &BmpDecoder_Vtbl); +/* Return the offset where the mask of an icon might be, or 0 for failure. */ +void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown) +{ assert(This->stream != NULL); if (This->read_data_func == BmpFrameDecode_ReadUncompressed) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 1e939d7..de6ebe6 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -220,6 +220,7 @@ static inline void pixel_set_trans(DWORD* pixel, BOOL transparent) static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) { HRESULT hr; + BmpDecoder *bmp_decoder; IWICBitmapDecoder *decoder; IWICBitmapFrameDecode *framedecode; WICPixelFormatGUID pixelformat; @@ -227,9 +228,10 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) int has_alpha=FALSE; /* if TRUE, alpha data might be in the image data */ WICRect rc; - hr = IcoDibDecoder_CreateInstance(NULL, &IID_IWICBitmapDecoder, (void**)&decoder); + hr = IcoDibDecoder_CreateInstance(&bmp_decoder); if (SUCCEEDED(hr)) { + BmpDecoder_GetWICDecoder(bmp_decoder, &decoder); hr = IWICBitmapDecoder_Initialize(decoder, stream, WICDecodeMetadataCacheOnLoad); if (SUCCEEDED(hr)) @@ -317,7 +319,7 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) LARGE_INTEGER seek; int topdown; - BmpDecoder_FindIconMask(decoder, &offset, &topdown); + BmpDecoder_FindIconMask(bmp_decoder, &offset, &topdown); if (offset) { diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index 3c416b0..fc2d17c 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -40,7 +40,6 @@ extern HRESULT JpegDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void* extern HRESULT TiffDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT IcnsEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); -extern HRESULT IcoDibDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT TgaDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT FlipRotator_Create(IWICBitmapFlipRotator **fliprotator); @@ -58,6 +57,10 @@ extern HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2); extern HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo); extern HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnknown **ppIEnumUnknown); -void BmpDecoder_FindIconMask(IWICBitmapDecoder *decoder, ULONG *mask_offset, int *topdown); +typedef struct BmpDecoder BmpDecoder; + +extern HRESULT IcoDibDecoder_CreateInstance(BmpDecoder **ppDecoder); +extern void BmpDecoder_GetWICDecoder(BmpDecoder *This, IWICBitmapDecoder **ppDecoder); +extern void BmpDecoder_FindIconMask(BmpDecoder *This, ULONG *mask_offset, int *topdown); #endif /* WINCODECS_PRIVATE_H */
1
0
0
0
Vincent Povirk : windowscodecs: Support 8-bit RGB (as opposed to BGR) bitfields bitmaps.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: b00c2979cf1ef1e7780db7856641e4493586c1fd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b00c2979cf1ef1e7780db7856…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 15:24:08 2011 -0600 windowscodecs: Support 8-bit RGB (as opposed to BGR) bitfields bitmaps. --- dlls/windowscodecs/bmpdecode.c | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/bmpdecode.c b/dlls/windowscodecs/bmpdecode.c index 5131f47..04e300d 100644 --- a/dlls/windowscodecs/bmpdecode.c +++ b/dlls/windowscodecs/bmpdecode.c @@ -399,6 +399,27 @@ fail: return hr; } +static HRESULT BmpFrameDecode_ReadRGB8(BmpDecoder* This) +{ + HRESULT hr; + UINT width, height; + + hr = IWICBitmapFrameDecode_GetSize((IWICBitmapFrameDecode*)&This->lpFrameVtbl, &width, &height); + + if (SUCCEEDED(hr)) + { + hr = BmpFrameDecode_ReadUncompressed(This); + } + + if (SUCCEEDED(hr)) + { + reverse_bgr8(This->bitsperpixel/8, This->imagedatastart, + width, height, This->stride); + } + + return hr; +} + static HRESULT ReadByte(IStream *stream, BYTE *buffer, ULONG buffer_size, ULONG *cursor, ULONG *bytesread, BYTE *result) { @@ -705,6 +726,7 @@ static const struct bitfields_format bitfields_formats[] = { {16,0xf800,0x7e0,0x1f,0,&GUID_WICPixelFormat16bppBGR565,BmpFrameDecode_ReadUncompressed}, {32,0xff0000,0xff00,0xff,0,&GUID_WICPixelFormat32bppBGR,BmpFrameDecode_ReadUncompressed}, {32,0xff0000,0xff00,0xff,0xff000000,&GUID_WICPixelFormat32bppBGRA,BmpFrameDecode_ReadUncompressed}, + {32,0xff,0xff00,0xff0000,0,&GUID_WICPixelFormat32bppBGR,BmpFrameDecode_ReadRGB8}, {0} };
1
0
0
0
Vincent Povirk : windowscodecs: Add a utility function for swapping 8-bit BGR/RGB data.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: d9fb1a4b92ddf186bd17cb89cc1cd7ed3f9c2951 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d9fb1a4b92ddf186bd17cb89c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 15:23:17 2011 -0600 windowscodecs: Add a utility function for swapping 8-bit BGR/RGB data. --- dlls/windowscodecs/jpegformat.c | 17 ++++------------- dlls/windowscodecs/main.c | 19 +++++++++++++++++++ dlls/windowscodecs/tiffformat.c | 15 +++------------ dlls/windowscodecs/wincodecs_private.h | 2 ++ 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c index e7a22c9..789a60b 100644 --- a/dlls/windowscodecs/jpegformat.c +++ b/dlls/windowscodecs/jpegformat.c @@ -577,7 +577,7 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, UINT first_scanline = This->cinfo.output_scanline; UINT max_rows; JSAMPROW out_rows[4]; - UINT i, j; + UINT i; JDIMENSION ret; max_rows = min(This->cinfo.output_height-first_scanline, 4); @@ -596,18 +596,9 @@ static HRESULT WINAPI JpegDecoder_Frame_CopyPixels(IWICBitmapFrameDecode *iface, if (bpp == 24) { /* libjpeg gives us RGB data and we want BGR, so byteswap the data */ - for (i=first_scanline; i<This->cinfo.output_scanline; i++) - { - BYTE *pixel = This->image_data + stride * i; - for (j=0; j<This->cinfo.output_width; j++) - { - BYTE red=pixel[0]; - BYTE blue=pixel[2]; - pixel[0]=blue; - pixel[2]=red; - pixel+=3; - } - } + reverse_bgr8(3, This->image_data + stride * first_scanline, + This->cinfo.output_width, This->cinfo.output_scanline - first_scanline, + stride); } if (This->cinfo.out_color_space == JCS_CMYK && This->cinfo.saw_Adobe_marker) diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 823fec2..a6588fd 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -112,3 +112,22 @@ HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer, return E_FAIL; } } + +void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride) +{ + UINT x, y; + BYTE *pixel, temp; + + for (y=0; y<height; y++) + { + pixel = bits + stride * y; + + for (x=0; x<width; x++) + { + temp = pixel[2]; + pixel[2] = pixel[0]; + pixel[0] = temp; + pixel += bytesperpixel; + } + } +} diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 9dfd4ba..5c8aae9 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -800,19 +800,10 @@ static HRESULT TiffFrameDecode_ReadTile(TiffFrameDecode *This, UINT tile_x, UINT { if (This->decode_info.bps == 8) { - UINT i, total_pixels, sample_count; - BYTE *pixel, temp; + UINT sample_count = This->decode_info.samples; - total_pixels = This->decode_info.tile_width * This->decode_info.tile_height; - pixel = This->cached_tile; - sample_count = This->decode_info.samples; - for (i=0; i<total_pixels; i++) - { - temp = pixel[2]; - pixel[2] = pixel[0]; - pixel[0] = temp; - pixel += sample_count; - } + reverse_bgr8(sample_count, This->cached_tile, This->decode_info.tile_width, + This->decode_info.tile_height, This->decode_info.tile_width * sample_count); } } diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index e50d130..3c416b0 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -51,6 +51,8 @@ extern HRESULT copy_pixels(UINT bpp, const BYTE *srcbuffer, UINT srcwidth, UINT srcheight, INT srcstride, const WICRect *rc, UINT dststride, UINT dstbuffersize, BYTE *dstbuffer); +extern void reverse_bgr8(UINT bytesperpixel, LPBYTE bits, UINT width, UINT height, INT stride); + extern HRESULT CreatePropertyBag2(IPropertyBag2 **ppPropertyBag2); extern HRESULT CreateComponentInfo(REFCLSID clsid, IWICComponentInfo **ppIInfo);
1
0
0
0
Vincent Povirk : windowscodecs: Ignore the alpha channel of ICO files if it 's empty.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: d747652102d6e1e5662a0f49da7ffdbce3a3f460 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d747652102d6e1e5662a0f49d…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Mon Jan 10 14:36:19 2011 -0600 windowscodecs: Ignore the alpha channel of ICO files if it's empty. --- dlls/windowscodecs/icoformat.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index e6a590f..1e939d7 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -277,6 +277,30 @@ static HRESULT ReadIcoDib(IStream *stream, IcoFrameDecode *result) IWICBitmapFrameDecode_Release(framedecode); } + if (SUCCEEDED(hr) && has_alpha) + { + /* If the alpha channel is fully transparent, we should ignore it. */ + int nonzero_alpha = 0; + int i; + + for (i=0; i<(result->height*result->width); i++) + { + if (result->bits[i*4+3] != 0) + { + nonzero_alpha = 1; + break; + } + } + + if (!nonzero_alpha) + { + for (i=0; i<(result->height*result->width); i++) + result->bits[i*4+3] = 0xff; + + has_alpha = FALSE; + } + } + if (SUCCEEDED(hr) && !has_alpha) { /* set alpha data based on the AND mask */
1
0
0
0
Jacek Caban : mshtml: Get rid of win9x test failures workarounds.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 226c44097b26dcb547d533cb1690f60182d1728e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=226c44097b26dcb547d533cb1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Jan 10 23:07:46 2011 +0100 mshtml: Get rid of win9x test failures workarounds. --- dlls/mshtml/tests/htmldoc.c | 47 ++++++++++++------------------------------ 1 files changed, 14 insertions(+), 33 deletions(-) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index ed322ba..75be8ab 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -165,7 +165,7 @@ static BOOL expect_InPlaceUIWindow_SetActiveObject_active = TRUE; static BOOL ipsex, ipsw; static BOOL set_clientsite, container_locked, navigated_load; static BOOL readystate_set_loading = FALSE, readystate_set_interactive = FALSE, load_from_stream; -static BOOL editmode = FALSE, show_failed; +static BOOL editmode = FALSE; static BOOL inplace_deactivated, open_call; static int stream_read, protocol_read; static enum load_state_t { @@ -2044,14 +2044,6 @@ static HRESULT WINAPI DocumentSite_ActivateMe(IOleDocumentSite *iface, IOleDocum expect_status_text = (load_state == LD_COMPLETE ? (LPCOLESTR)0xdeadbeef : NULL); hres = IOleDocumentView_Show(view, TRUE); - if(FAILED(hres)) { - win_skip("Show failed\n"); - if(activeobj) - IOleInPlaceActiveObject_Release(activeobj); - IOleDocument_Release(document); - show_failed = TRUE; - return S_OK; - } ok(hres == S_OK, "Show failed: %08x\n", hres); CHECK_CALLED(CanInPlaceActivate); @@ -4769,10 +4761,6 @@ static void test_HTMLDocument_hlink(void) test_GetCurMoniker((IUnknown*)doc, NULL, NULL); test_Persist(doc, &Moniker); test_Navigate(doc); - if(show_failed) { - IUnknown_Release(doc); - return; - } test_download(DWL_CSS|DWL_TRYCSS); @@ -4874,11 +4862,6 @@ static void test_HTMLDocument_http(void) test_GetCurMoniker((IUnknown*)doc, NULL, NULL); test_Persist(doc, http_mon); test_Navigate(doc); - if(show_failed) { - IUnknown_Release(doc); - return; - } - test_download(DWL_HTTP); test_cookies(doc); test_IsDirty(doc, S_FALSE); @@ -5405,21 +5388,19 @@ START_TEST(htmldoc) register_protocol(); test_HTMLDocument_hlink(); - if(!show_failed) { - test_HTMLDocument(FALSE); - test_HTMLDocument(TRUE); - test_HTMLDocument_StreamLoad(); - test_HTMLDocument_StreamInitNew(); - test_editing_mode(FALSE); - test_editing_mode(TRUE); - test_HTMLDocument_http(); - test_UIActivate(FALSE, FALSE, FALSE); - test_UIActivate(FALSE, TRUE, FALSE); - test_UIActivate(FALSE, TRUE, TRUE); - test_UIActivate(TRUE, FALSE, FALSE); - test_UIActivate(TRUE, TRUE, FALSE); - test_UIActivate(TRUE, TRUE, TRUE); - } + test_HTMLDocument(FALSE); + test_HTMLDocument(TRUE); + test_HTMLDocument_StreamLoad(); + test_HTMLDocument_StreamInitNew(); + test_editing_mode(FALSE); + test_editing_mode(TRUE); + test_HTMLDocument_http(); + test_UIActivate(FALSE, FALSE, FALSE); + test_UIActivate(FALSE, TRUE, FALSE); + test_UIActivate(FALSE, TRUE, TRUE); + test_UIActivate(TRUE, FALSE, FALSE); + test_UIActivate(TRUE, TRUE, FALSE); + test_UIActivate(TRUE, TRUE, TRUE); test_HTMLDoc_ISupportErrorInfo(); test_IPersistHistory();
1
0
0
0
Andrew Eikum : mmdevapi: Prevent deadlock when releasing a stream that' s still playing.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: bd6f6bc2dd7ba366dddb186cebbc1b1f4fcb1015 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd6f6bc2dd7ba366dddb186ce…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon Jan 10 14:10:50 2011 -0600 mmdevapi: Prevent deadlock when releasing a stream that's still playing. --- dlls/mmdevapi/audio.c | 3 ++ dlls/mmdevapi/tests/render.c | 47 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 0 deletions(-) diff --git a/dlls/mmdevapi/audio.c b/dlls/mmdevapi/audio.c index 6217cba..56e6187 100644 --- a/dlls/mmdevapi/audio.c +++ b/dlls/mmdevapi/audio.c @@ -313,7 +313,10 @@ HRESULT AudioClient_Create(MMDevice *parent, IAudioClient **ppv) static void AudioClient_Destroy(ACImpl *This) { if (This->timer_id) + { DeleteTimerQueueTimer(NULL, This->timer_id, INVALID_HANDLE_VALUE); + This->timer_id = 0; + } if (This->render) AudioRenderClient_Destroy(This->render); if (This->capture) diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 22e8c9b..f7d7eb1 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -334,6 +334,52 @@ static void test_references(void) ok(ref == 0, "AudioClock_Release gave wrong refcount: %u\n", ref); } +static void test_event(void) +{ + HANDLE event; + HRESULT hr; + IAudioClient *ac; + WAVEFORMATEX *pwfx; + + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ac); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_GetMixFormat(ac, &pwfx); + ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, + AUDCLNT_STREAMFLAGS_EVENTCALLBACK, 5000000, + 0, pwfx, NULL); + ok(hr == S_OK, "Initialize failed: %08x\n", hr); + + event = CreateEventW(NULL, FALSE, FALSE, NULL); + ok(event != NULL, "CreateEvent failed\n"); + + hr = IAudioClient_Start(ac); + ok(hr == AUDCLNT_E_EVENTHANDLE_NOT_SET, "Start failed: %08x\n", hr); + + hr = IAudioClient_SetEventHandle(ac, event); + ok(hr == S_OK, "SetEventHandle failed: %08x\n", hr); + + hr = IAudioClient_Start(ac); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + hr = IAudioClient_Stop(ac); + ok(hr == S_OK, "Start failed: %08x\n", hr); + + /* test releasing a playing stream */ + hr = IAudioClient_Start(ac); + ok(hr == S_OK, "Start failed: %08x\n", hr); + IAudioClient_Release(ac); + + CloseHandle(event); +} + START_TEST(render) { HRESULT hr; @@ -360,6 +406,7 @@ START_TEST(render) test_audioclient(); test_references(); + test_event(); IMMDevice_Release(dev);
1
0
0
0
Andrew Eikum : mmdevapi: Children of IAudioClient should hold a reference to their parents.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 436d26f935f396de8c6daf2b871b503d6b487484 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=436d26f935f396de8c6daf2b8…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Mon Jan 10 14:10:44 2011 -0600 mmdevapi: Children of IAudioClient should hold a reference to their parents. --- dlls/mmdevapi/audio.c | 10 ++++ dlls/mmdevapi/tests/render.c | 122 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 121 insertions(+), 11 deletions(-) diff --git a/dlls/mmdevapi/audio.c b/dlls/mmdevapi/audio.c index b97dccb..6217cba 100644 --- a/dlls/mmdevapi/audio.c +++ b/dlls/mmdevapi/audio.c @@ -1115,12 +1115,14 @@ static HRESULT AudioRenderClient_Create(ACImpl *parent, ACRender **ppv) This->lpVtbl = &ACRender_Vtbl; This->ref = 0; This->parent = parent; + AC_AddRef((IAudioClient*)This->parent); return S_OK; } static void AudioRenderClient_Destroy(ACRender *This) { This->parent->render = NULL; + AC_Release((IAudioClient*)This->parent); HeapFree(GetProcessHeap(), 0, This); } @@ -1313,12 +1315,14 @@ static HRESULT AudioCaptureClient_Create(ACImpl *parent, ACCapture **ppv) This->lpVtbl = &ACCapture_Vtbl; This->ref = 0; This->parent = parent; + AC_AddRef((IAudioClient*)This->parent); return S_OK; } static void AudioCaptureClient_Destroy(ACCapture *This) { This->parent->capture = NULL; + AC_Release((IAudioClient*)This->parent); HeapFree(GetProcessHeap(), 0, This); } @@ -1444,12 +1448,14 @@ static HRESULT AudioSessionControl_Create(ACImpl *parent, ACSession **ppv) This->lpVtbl = &ACSession_Vtbl; This->ref = 0; This->parent = parent; + AC_AddRef((IAudioClient*)This->parent); return S_OK; } static void AudioSessionControl_Destroy(ACSession *This) { This->parent->session = NULL; + AC_Release((IAudioClient*)This->parent); HeapFree(GetProcessHeap(), 0, This); } @@ -1650,12 +1656,14 @@ static HRESULT AudioSimpleVolume_Create(ACImpl *parent, ASVolume **ppv) This->lpVtbl = &ASVolume_Vtbl; This->ref = 0; This->parent = parent; + AC_AddRef((IAudioClient*)This->parent); return S_OK; } static void AudioSimpleVolume_Destroy(ASVolume *This) { This->parent->svolume = NULL; + AC_Release((IAudioClient*)This->parent); HeapFree(GetProcessHeap(), 0, This); } @@ -1756,12 +1764,14 @@ static HRESULT AudioClock_Create(ACImpl *parent, AClock **ppv) This->lp2Vtbl = &AClock2_Vtbl; This->ref = 0; This->parent = parent; + AC_AddRef((IAudioClient*)This->parent); return S_OK; } static void AudioClock_Destroy(AClock *This) { This->parent->clock = NULL; + AC_Release((IAudioClient*)This->parent); HeapFree(GetProcessHeap(), 0, This); } diff --git a/dlls/mmdevapi/tests/render.c b/dlls/mmdevapi/tests/render.c index 9661dbd..22e8c9b 100644 --- a/dlls/mmdevapi/tests/render.c +++ b/dlls/mmdevapi/tests/render.c @@ -34,6 +34,8 @@ #include "mmdeviceapi.h" #include "audioclient.h" +static IMMDevice *dev = NULL; + static void test_uninitialized(IAudioClient *ac) { HRESULT hr; @@ -70,15 +72,23 @@ static void test_uninitialized(IAudioClient *ac) CloseHandle(handle); } -static void test_audioclient(IAudioClient *ac) +static void test_audioclient(void) { + IAudioClient *ac; IUnknown *unk; HRESULT hr; ULONG ref; WAVEFORMATEX *pwfx, *pwfx2; REFERENCE_TIME t1, t2; + HANDLE handle; - HANDLE handle = CreateEventW(NULL, FALSE, FALSE, NULL); + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ac); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + handle = CreateEventW(NULL, FALSE, FALSE, NULL); hr = IAudioClient_QueryInterface(ac, &IID_IUnknown, NULL); ok(hr == E_POINTER, "QueryInterface(NULL) returned %08x\n", hr); @@ -224,16 +234,110 @@ static void test_audioclient(IAudioClient *ac) hr = IAudioClient_Start(ac); ok(hr == S_OK, "Start on a stopped stream returns %08x\n", hr); + IAudioClient_Release(ac); + CloseHandle(handle); CoTaskMemFree(pwfx); } +static void test_references(void) +{ + IAudioClient *ac; + IAudioRenderClient *rc; + ISimpleAudioVolume *sav; + IAudioClock *acl; + WAVEFORMATEX *pwfx; + HRESULT hr; + ULONG ref; + + /* IAudioRenderClient */ + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ac); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_GetMixFormat(ac, &pwfx); + ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, + 0, pwfx, NULL); + ok(hr == S_OK, "Initialize failed: %08x\n", hr); + + hr = IAudioClient_GetService(ac, &IID_IAudioRenderClient, (void**)&rc); + ok(hr == S_OK, "GetService failed: %08x\n", hr); + + IAudioRenderClient_AddRef(rc); + ref = IAudioRenderClient_Release(rc); + ok(ref != 0, "RenderClient_Release gave wrong refcount: %u\n", ref); + + ref = IAudioClient_Release(ac); + ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref); + + ref = IAudioRenderClient_Release(rc); + ok(ref == 0, "RenderClient_Release gave wrong refcount: %u\n", ref); + + /* ISimpleAudioVolume */ + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ac); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_GetMixFormat(ac, &pwfx); + ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); + + hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, + 0, pwfx, NULL); + ok(hr == S_OK, "Initialize failed: %08x\n", hr); + + hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav); + ok(hr == S_OK, "GetService failed: %08x\n", hr); + + ISimpleAudioVolume_AddRef(sav); + ref = ISimpleAudioVolume_Release(sav); + ok(ref != 0, "SimpleAudioVolume_Release gave wrong refcount: %u\n", ref); + + ref = IAudioClient_Release(ac); + ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref); + + ref = ISimpleAudioVolume_Release(sav); + ok(ref == 0, "SimpleAudioVolume_Release gave wrong refcount: %u\n", ref); + + /* IAudioClock */ + hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, + NULL, (void**)&ac); + ok(hr == S_OK, "Activation failed with %08x\n", hr); + if(hr != S_OK) + return; + + hr = IAudioClient_GetMixFormat(ac, &pwfx); + ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); + + hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, + 0, pwfx, NULL); + ok(hr == S_OK, "Initialize failed: %08x\n", hr); + + hr = IAudioClient_GetService(ac, &IID_IAudioClock, (void**)&acl); + ok(hr == S_OK, "GetService failed: %08x\n", hr); + + IAudioClock_AddRef(acl); + ref = IAudioClock_Release(acl); + ok(ref != 0, "AudioClock_Release gave wrong refcount: %u\n", ref); + + ref = IAudioClient_Release(ac); + ok(ref != 0, "Client_Release gave wrong refcount: %u\n", ref); + + ref = IAudioClock_Release(acl); + ok(ref == 0, "AudioClock_Release gave wrong refcount: %u\n", ref); +} + START_TEST(render) { HRESULT hr; IMMDeviceEnumerator *mme = NULL; - IMMDevice *dev = NULL; - IAudioClient *ac = NULL; CoInitializeEx(NULL, COINIT_MULTITHREADED); hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); @@ -254,13 +358,9 @@ START_TEST(render) goto cleanup; } - hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac); - ok(hr == S_OK, "Activation failed with %08x\n", hr); - if (ac) - { - test_audioclient(ac); - IAudioClient_Release(ac); - } + test_audioclient(); + test_references(); + IMMDevice_Release(dev); cleanup:
1
0
0
0
André Hentschel : imagehlp: Use define instead of hardcoded value.
by Alexandre Julliard
11 Jan '11
11 Jan '11
Module: wine Branch: master Commit: 82efaae0a2aed93b6868a32d902953d0382fe77d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=82efaae0a2aed93b6868a32d9…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Mon Jan 10 19:20:15 2011 +0100 imagehlp: Use define instead of hardcoded value. --- dlls/imagehlp/integrity.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/imagehlp/integrity.c b/dlls/imagehlp/integrity.c index 878153a..2c72948 100644 --- a/dlls/imagehlp/integrity.c +++ b/dlls/imagehlp/integrity.c @@ -77,7 +77,7 @@ static int IMAGEHLP_GetNTHeaders(HANDLE handle, DWORD *pe_offset, IMAGE_NT_HEADE return HDR_FAIL; /* verify magic number of 'MZ' */ - if (dos_hdr.e_magic != 0x5A4D) + if (dos_hdr.e_magic != IMAGE_DOS_SIGNATURE) return HDR_FAIL; if (pe_offset != NULL)
1
0
0
0
← Newer
1
...
56
57
58
59
60
61
62
...
88
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
Results per page:
10
25
50
100
200