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
August 2009
----- 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
4 participants
1042 discussions
Start a n
N
ew thread
Vincent Povirk : windowscodecs: Implement CopyPixels for 32-bit ICO icons.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: 84dff04e3a7e1d3632346551c447ea7c26d5f492 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=84dff04e3a7e1d3632346551c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 15:10:10 2009 -0500 windowscodecs: Implement CopyPixels for 32-bit ICO icons. --- dlls/windowscodecs/icoformat.c | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index d499146..ab30ab0 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -406,6 +406,38 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) HeapFree(GetProcessHeap(), 0, tempdata); break; } + case 32: + { + UINT xorBytesPerRow = width*4; + UINT xorBytes = xorBytesPerRow * height; + + bits = HeapAlloc(GetProcessHeap(), 0, xorBytes); + if (!bits) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + /* read the rows backwards so we get a top-down DIB */ + UINT i; + BYTE *xorRow = bits + xorBytesPerRow * (height-1); + + for (i=0; i<height; i++) + { + hr = IStream_Read(This->parent->stream, xorRow, xorBytesPerRow, &bytesread); + if (FAILED(hr) || bytesread != xorBytesPerRow) goto fail; + xorRow -= xorBytesPerRow; + } + } + else /* top-down DIB */ + { + hr = IStream_Read(This->parent->stream, bits, xorBytes, &bytesread); + if (FAILED(hr) || bytesread != xorBytes) goto fail; + } + break; + } default: FIXME("unsupported bitcount: %u\n", This->entry.wBitCount); goto fail;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for 1-bit ICO icons.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: e743a7a8c59ac6199e81d4cb1bc6981fdb47cdb1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e743a7a8c59ac6199e81d4cb1…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 14:56:20 2009 -0500 windowscodecs: Implement CopyPixels for 1-bit ICO icons. --- dlls/windowscodecs/icoformat.c | 56 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 3e9ec5b..d499146 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -203,6 +203,62 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) /* read the XOR data */ switch (This->entry.wBitCount) { + case 1: + { + UINT xorBytesPerRow = (width+31)/32*4; + UINT xorBytes = xorBytesPerRow * height; + INT xorStride; + BYTE *xorRow; + BYTE *bitsRow; + UINT x, y; + + tempdata = HeapAlloc(GetProcessHeap(), 0, xorBytes); + if (!tempdata) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = IStream_Read(This->parent->stream, tempdata, xorBytes, &bytesread); + if (FAILED(hr) || bytesread != xorBytes) goto fail; + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + xorStride = -xorBytesPerRow; + xorRow = tempdata + (height-1)*xorBytesPerRow; + } + else /* top-down DIB */ + { + xorStride = xorBytesPerRow; + xorRow = tempdata; + } + + bits = HeapAlloc(GetProcessHeap(), 0, bitsSize); + + /* palette-map the 1-bit data */ + bitsRow = bits; + for (y=0; y<height; y++) { + BYTE *xorByte=xorRow; + DWORD *bitsPixel=(DWORD*)bitsRow; + for (x=0; x<width; x+=8) { + BYTE xorVal; + xorVal=*xorByte++; + *bitsPixel++ = colors[xorVal>>7]; + if (x+1 < width) *bitsPixel++ = colors[xorVal>>6&1]; + if (x+2 < width) *bitsPixel++ = colors[xorVal>>5&1]; + if (x+3 < width) *bitsPixel++ = colors[xorVal>>4&1]; + if (x+4 < width) *bitsPixel++ = colors[xorVal>>3&1]; + if (x+5 < width) *bitsPixel++ = colors[xorVal>>2&1]; + if (x+6 < width) *bitsPixel++ = colors[xorVal>>1&1]; + if (x+7 < width) *bitsPixel++ = colors[xorVal&1]; + } + xorRow += xorStride; + bitsRow += bitsStride; + } + + HeapFree(GetProcessHeap(), 0, tempdata); + break; + } case 4: { UINT xorBytesPerRow = (width+7)/8*4;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for 4-bit ICO icons.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: a65010aa19101dfb7a8f4bf6433bfbe980542987 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a65010aa19101dfb7a8f4bf64…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 14:38:51 2009 -0500 windowscodecs: Implement CopyPixels for 4-bit ICO icons. --- dlls/windowscodecs/icoformat.c | 50 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 50 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index a6c7af3..3e9ec5b 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -203,6 +203,56 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) /* read the XOR data */ switch (This->entry.wBitCount) { + case 4: + { + UINT xorBytesPerRow = (width+7)/8*4; + UINT xorBytes = xorBytesPerRow * height; + INT xorStride; + BYTE *xorRow; + BYTE *bitsRow; + UINT x, y; + + tempdata = HeapAlloc(GetProcessHeap(), 0, xorBytes); + if (!tempdata) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = IStream_Read(This->parent->stream, tempdata, xorBytes, &bytesread); + if (FAILED(hr) || bytesread != xorBytes) goto fail; + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + xorStride = -xorBytesPerRow; + xorRow = tempdata + (height-1)*xorBytesPerRow; + } + else /* top-down DIB */ + { + xorStride = xorBytesPerRow; + xorRow = tempdata; + } + + bits = HeapAlloc(GetProcessHeap(), 0, bitsSize); + + /* palette-map the 4-bit data */ + bitsRow = bits; + for (y=0; y<height; y++) { + BYTE *xorByte=xorRow; + DWORD *bitsPixel=(DWORD*)bitsRow; + for (x=0; x<width; x+=2) { + BYTE xorVal; + xorVal=*xorByte++; + *bitsPixel++ = colors[xorVal>>4]; + if (x+1 < width) *bitsPixel++ = colors[xorVal&0xf]; + } + xorRow += xorStride; + bitsRow += bitsStride; + } + + HeapFree(GetProcessHeap(), 0, tempdata); + break; + } case 8: { UINT xorBytesPerRow = (width+3)/4*4;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for 24-bit ICO icons.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: 5d7cd195566e2c5b489ed8650a8dcf7ec0a76c8c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d7cd195566e2c5b489ed8650…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 14:28:04 2009 -0500 windowscodecs: Implement CopyPixels for 24-bit ICO icons. --- dlls/windowscodecs/icoformat.c | 51 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 51 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index cb545a1..a6c7af3 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -249,6 +249,57 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) HeapFree(GetProcessHeap(), 0, tempdata); break; } + case 24: + { + UINT xorBytesPerRow = (width*3+3)/4*4; + UINT xorBytes = xorBytesPerRow * height; + INT xorStride; + BYTE *xorRow; + BYTE *bitsRow; + UINT x, y; + + tempdata = HeapAlloc(GetProcessHeap(), 0, xorBytes); + if (!tempdata) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = IStream_Read(This->parent->stream, tempdata, xorBytes, &bytesread); + if (FAILED(hr) || bytesread != xorBytes) goto fail; + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + xorStride = -xorBytesPerRow; + xorRow = tempdata + (height-1)*xorBytesPerRow; + } + else /* top-down DIB */ + { + xorStride = xorBytesPerRow; + xorRow = tempdata; + } + + bits = HeapAlloc(GetProcessHeap(), 0, bitsSize); + + /* copy BGR->BGRA */ + bitsRow = bits; + for (y=0; y<height; y++) { + BYTE *xorByte=xorRow; + BYTE *bitsByte=bitsRow; + for (x=0; x<width; x++) + { + *bitsByte++ = *xorByte++; /* blue */ + *bitsByte++ = *xorByte++; /* green */ + *bitsByte++ = *xorByte++; /* red */ + bitsByte++; /* alpha */ + } + xorRow += xorStride; + bitsRow += bitsStride; + } + + HeapFree(GetProcessHeap(), 0, tempdata); + break; + } default: FIXME("unsupported bitcount: %u\n", This->entry.wBitCount); goto fail;
1
0
0
0
Vincent Povirk : windowscodecs: Implement CopyPixels for 8-bit ICO icons.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: 1c25ee8ce7b8d506a606d2313cd66843b6d631d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1c25ee8ce7b8d506a606d2313…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 11:58:49 2009 -0500 windowscodecs: Implement CopyPixels for 8-bit ICO icons. --- dlls/windowscodecs/icoformat.c | 185 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 183 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index dfdf94b..cb545a1 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -24,6 +24,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "objbase.h" #include "wincodec.h" @@ -68,6 +69,7 @@ typedef struct { LONG ref; ICONDIRENTRY entry; IcoDecoder *parent; + BYTE *bits; } IcoFrameDecode; static HRESULT WINAPI IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, @@ -114,6 +116,7 @@ static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface) if (ref == 0) { IUnknown_Release((IUnknown*)This->parent); + HeapFree(GetProcessHeap(), 0, This->bits); HeapFree(GetProcessHeap(), 0, This); } @@ -154,11 +157,188 @@ static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, return WINCODEC_ERR_PALETTEUNAVAILABLE; } +static inline void pixel_set_trans(DWORD* pixel, BOOL transparent) +{ + if (transparent) *pixel = 0; + else *pixel |= 0xff000000; +} + +static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) +{ + BITMAPINFOHEADER bih; + DWORD colors[256]; + UINT colorcount=0; + LARGE_INTEGER seek; + ULONG bytesread; + HRESULT hr; + BYTE *tempdata = NULL; + BYTE *bits = NULL; + UINT bitsStride; + UINT bitsSize; + UINT width, height; + + width = This->entry.bWidth ? This->entry.bWidth : 256; + height = This->entry.bHeight ? This->entry.bHeight : 256; + + /* read the BITMAPINFOHEADER */ + seek.QuadPart = This->entry.dwDIBOffset; + hr = IStream_Seek(This->parent->stream, seek, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) goto fail; + + hr = IStream_Read(This->parent->stream, &bih, sizeof(BITMAPINFOHEADER), &bytesread); + if (FAILED(hr) || bytesread != sizeof(BITMAPINFOHEADER)) goto fail; + + if (This->entry.wBitCount <= 8) + { + /* read the palette */ + colorcount = This->entry.bColorCount ? This->entry.bColorCount : 256; + + hr = IStream_Read(This->parent->stream, colors, sizeof(RGBQUAD)*colorcount, &bytesread); + if (FAILED(hr) || bytesread != sizeof(RGBQUAD)*colorcount) goto fail; + } + + bitsStride = width * 4; + bitsSize = bitsStride * height; + + /* read the XOR data */ + switch (This->entry.wBitCount) + { + case 8: + { + UINT xorBytesPerRow = (width+3)/4*4; + UINT xorBytes = xorBytesPerRow * height; + INT xorStride; + BYTE *xorRow; + BYTE *bitsRow; + UINT x, y; + + tempdata = HeapAlloc(GetProcessHeap(), 0, xorBytes); + if (!tempdata) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = IStream_Read(This->parent->stream, tempdata, xorBytes, &bytesread); + if (FAILED(hr) || bytesread != xorBytes) goto fail; + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + xorStride = -xorBytesPerRow; + xorRow = tempdata + (height-1)*xorBytesPerRow; + } + else /* top-down DIB */ + { + xorStride = xorBytesPerRow; + xorRow = tempdata; + } + + bits = HeapAlloc(GetProcessHeap(), 0, bitsSize); + + /* palette-map the 8-bit data */ + bitsRow = bits; + for (y=0; y<height; y++) { + BYTE *xorByte=xorRow; + DWORD *bitsPixel=(DWORD*)bitsRow; + for (x=0; x<width; x++) + *bitsPixel++ = colors[*xorByte++]; + xorRow += xorStride; + bitsRow += bitsStride; + } + + HeapFree(GetProcessHeap(), 0, tempdata); + break; + } + default: + FIXME("unsupported bitcount: %u\n", This->entry.wBitCount); + goto fail; + } + + if (This->entry.wBitCount < 32) + { + /* set alpha data based on the AND mask */ + UINT andBytesPerRow = (width+31)/32*4; + UINT andBytes = andBytesPerRow * height; + INT andStride; + BYTE *andRow; + BYTE *bitsRow; + UINT x, y; + + tempdata = HeapAlloc(GetProcessHeap(), 0, andBytes); + if (!tempdata) + { + hr = E_OUTOFMEMORY; + goto fail; + } + + hr = IStream_Read(This->parent->stream, tempdata, andBytes, &bytesread); + if (FAILED(hr) || bytesread != andBytes) goto fail; + + if (bih.biHeight > 0) /* bottom-up DIB */ + { + andStride = -andBytesPerRow; + andRow = tempdata + (height-1)*andBytesPerRow; + } + else /* top-down DIB */ + { + andStride = andBytesPerRow; + andRow = tempdata; + } + + bitsRow = bits; + for (y=0; y<height; y++) { + BYTE *andByte=andRow; + DWORD *bitsPixel=(DWORD*)bitsRow; + for (x=0; x<width; x+=8) { + BYTE andVal=*andByte++; + pixel_set_trans(bitsPixel++, andVal>>7&1); + if (x+1 < width) pixel_set_trans(bitsPixel++, andVal>>6&1); + if (x+2 < width) pixel_set_trans(bitsPixel++, andVal>>5&1); + if (x+3 < width) pixel_set_trans(bitsPixel++, andVal>>4&1); + if (x+4 < width) pixel_set_trans(bitsPixel++, andVal>>3&1); + if (x+5 < width) pixel_set_trans(bitsPixel++, andVal>>2&1); + if (x+6 < width) pixel_set_trans(bitsPixel++, andVal>>1&1); + if (x+7 < width) pixel_set_trans(bitsPixel++, andVal&1); + } + andRow += andStride; + bitsRow += bitsStride; + } + + HeapFree(GetProcessHeap(), 0, tempdata); + } + + This->bits = bits; + + return S_OK; + +fail: + HeapFree(GetProcessHeap(), 0, tempdata); + HeapFree(GetProcessHeap(), 0, bits); + if (SUCCEEDED(hr)) hr = E_FAIL; + TRACE("<-- %x\n", hr); + return hr; +} + static HRESULT WINAPI IcoFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) { - FIXME("(%p,%p,%u,%u,%p): stub\n", iface, prc, cbStride, cbBufferSize, pbBuffer); - return E_NOTIMPL; + IcoFrameDecode *This = (IcoFrameDecode*)iface; + HRESULT hr; + UINT width, height, stride; + TRACE("(%p,%p,%u,%u,%p)\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + + if (!This->bits) + { + hr = IcoFrameDecode_ReadPixels(This); + if (FAILED(hr)) return hr; + } + + width = This->entry.bWidth ? This->entry.bWidth : 256; + height = This->entry.bHeight ? This->entry.bHeight : 256; + stride = width * 4; + + return copy_pixels(32, This->bits, width, height, stride, + prc, cbStride, cbBufferSize, pbBuffer); } static HRESULT WINAPI IcoFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, @@ -362,6 +542,7 @@ static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, result->lpVtbl = &IcoFrameDecode_Vtbl; result->ref = 1; result->parent = This; + result->bits = NULL; /* read the icon entry */ seek.QuadPart = sizeof(ICONHEADER) + sizeof(ICONDIRENTRY) * index;
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetSize for the ICO decoder.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: ccc4c2d5d227c81f7dc197c671f4f0b6478dcaa3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ccc4c2d5d227c81f7dc197c67…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 10:23:00 2009 -0500 windowscodecs: Implement GetSize for the ICO decoder. --- dlls/windowscodecs/icoformat.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 6f91137..dfdf94b 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -123,8 +123,14 @@ static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface) static HRESULT WINAPI IcoFrameDecode_GetSize(IWICBitmapFrameDecode *iface, UINT *puiWidth, UINT *puiHeight) { - FIXME("(%p,%p,%p): stub\n", iface, puiWidth, puiHeight); - return E_NOTIMPL; + IcoFrameDecode *This = (IcoFrameDecode*)iface; + + *puiWidth = This->entry.bWidth ? This->entry.bWidth : 256; + *puiHeight = This->entry.bHeight ? This->entry.bHeight : 256; + + TRACE("(%p) -> (%i,%i)\n", iface, *puiWidth, *puiHeight); + + return S_OK; } static HRESULT WINAPI IcoFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface,
1
0
0
0
Vincent Povirk : windowscodecs: Implement GetFrameCount and GetFrame for the ICO decoder.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: c49b36ea31c718d6a3e345bf117601a344c43b95 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c49b36ea31c718d6a3e345bf1…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 10:06:01 2009 -0500 windowscodecs: Implement GetFrameCount and GetFrame for the ICO decoder. --- dlls/windowscodecs/icoformat.c | 177 +++++++++++++++++++++++++++++++++++++++- 1 files changed, 173 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index e26de5f..6f91137 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -63,6 +63,133 @@ typedef struct { ICONHEADER header; } IcoDecoder; +typedef struct { + const IWICBitmapFrameDecodeVtbl *lpVtbl; + LONG ref; + ICONDIRENTRY entry; + IcoDecoder *parent; +} IcoFrameDecode; + +static HRESULT WINAPI IcoFrameDecode_QueryInterface(IWICBitmapFrameDecode *iface, REFIID iid, + void **ppv) +{ + IcoFrameDecode *This = (IcoFrameDecode*)iface; + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || + IsEqualIID(&IID_IWICBitmapSource, iid) || + IsEqualIID(&IID_IWICBitmapFrameDecode, iid)) + { + *ppv = This; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI IcoFrameDecode_AddRef(IWICBitmapFrameDecode *iface) +{ + IcoFrameDecode *This = (IcoFrameDecode*)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IcoFrameDecode_Release(IWICBitmapFrameDecode *iface) +{ + IcoFrameDecode *This = (IcoFrameDecode*)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + IUnknown_Release((IUnknown*)This->parent); + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI IcoFrameDecode_GetSize(IWICBitmapFrameDecode *iface, + UINT *puiWidth, UINT *puiHeight) +{ + FIXME("(%p,%p,%p): stub\n", iface, puiWidth, puiHeight); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoFrameDecode_GetPixelFormat(IWICBitmapFrameDecode *iface, + WICPixelFormatGUID *pPixelFormat) +{ + memcpy(pPixelFormat, &GUID_WICPixelFormat32bppBGRA, sizeof(GUID)); + return S_OK; +} + +static HRESULT WINAPI IcoFrameDecode_GetResolution(IWICBitmapFrameDecode *iface, + double *pDpiX, double *pDpiY) +{ + FIXME("(%p,%p,%p): stub\n", iface, pDpiX, pDpiY); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, + IWICPalette *pIPalette) +{ + TRACE("(%p,%p)\n", iface, pIPalette); + return WINCODEC_ERR_PALETTEUNAVAILABLE; +} + +static HRESULT WINAPI IcoFrameDecode_CopyPixels(IWICBitmapFrameDecode *iface, + const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer) +{ + FIXME("(%p,%p,%u,%u,%p): stub\n", iface, prc, cbStride, cbBufferSize, pbBuffer); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoFrameDecode_GetMetadataQueryReader(IWICBitmapFrameDecode *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI IcoFrameDecode_GetColorContexts(IWICBitmapFrameDecode *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI IcoFrameDecode_GetThumbnail(IWICBitmapFrameDecode *iface, + IWICBitmapSource **ppIThumbnail) +{ + TRACE("(%p,%p)\n", iface, ppIThumbnail); + return WINCODEC_ERR_CODECNOTHUMBNAIL; +} + +static const IWICBitmapFrameDecodeVtbl IcoFrameDecode_Vtbl = { + IcoFrameDecode_QueryInterface, + IcoFrameDecode_AddRef, + IcoFrameDecode_Release, + IcoFrameDecode_GetSize, + IcoFrameDecode_GetPixelFormat, + IcoFrameDecode_GetResolution, + IcoFrameDecode_CopyPalette, + IcoFrameDecode_CopyPixels, + IcoFrameDecode_GetMetadataQueryReader, + IcoFrameDecode_GetColorContexts, + IcoFrameDecode_GetThumbnail +}; + static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, void **ppv) { @@ -198,15 +325,57 @@ static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface, static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface, UINT *pCount) { - FIXME("(%p,%p): stub\n", iface, pCount); - return E_NOTIMPL; + IcoDecoder *This = (IcoDecoder*)iface; + TRACE("(%p,%p)\n", iface, pCount); + + if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + + *pCount = This->header.idCount; + TRACE("<-- %u\n", *pCount); + + return S_OK; } static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) { - FIXME("(%p,%u,%p): stub\n", iface, index, ppIBitmapFrame); - return E_NOTIMPL; + IcoDecoder *This = (IcoDecoder*)iface; + IcoFrameDecode *result; + LARGE_INTEGER seek; + HRESULT hr; + ULONG bytesread; + TRACE("(%p,%u,%p)\n", iface, index, ppIBitmapFrame); + + if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; + + if (This->header.idCount < index) return E_INVALIDARG; + + result = HeapAlloc(GetProcessHeap(), 0, sizeof(IcoFrameDecode)); + if (!result) return E_OUTOFMEMORY; + + result->lpVtbl = &IcoFrameDecode_Vtbl; + result->ref = 1; + result->parent = This; + + /* read the icon entry */ + seek.QuadPart = sizeof(ICONHEADER) + sizeof(ICONDIRENTRY) * index; + hr = IStream_Seek(This->stream, seek, STREAM_SEEK_SET, 0); + if (FAILED(hr)) goto fail; + + hr = IStream_Read(This->stream, &result->entry, sizeof(ICONDIRENTRY), &bytesread); + if (FAILED(hr) || bytesread != sizeof(ICONDIRENTRY)) goto fail; + + IWICBitmapDecoder_AddRef(iface); + + *ppIBitmapFrame = (IWICBitmapFrameDecode*)result; + + return S_OK; + +fail: + HeapFree(GetProcessHeap(), 0, result); + if (SUCCEEDED(hr)) hr = E_FAIL; + TRACE("<-- %x\n", hr); + return hr; } static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl = {
1
0
0
0
Vincent Povirk : windowscodecs: Implement Initialize for the ICO decoder.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: dd5c5b82777217d5a713f4c3da3b93d14346386b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd5c5b82777217d5a713f4c3d…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 09:50:06 2009 -0500 windowscodecs: Implement Initialize for the ICO decoder. --- dlls/windowscodecs/icoformat.c | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index f61ae01..e26de5f 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -58,6 +58,9 @@ typedef struct typedef struct { const IWICBitmapDecoderVtbl *lpVtbl; LONG ref; + BOOL initialized; + IStream *stream; + ICONHEADER header; } IcoDecoder; static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, @@ -101,6 +104,7 @@ static ULONG WINAPI IcoDecoder_Release(IWICBitmapDecoder *iface) if (ref == 0) { + if (This->stream) IStream_Release(This->stream); HeapFree(GetProcessHeap(), 0, This); } @@ -117,8 +121,29 @@ static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStre static HRESULT WINAPI IcoDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, WICDecodeOptions cacheOptions) { - FIXME("(%p,%p,%x): stub\n", iface, pIStream, cacheOptions); - return E_NOTIMPL; + IcoDecoder *This = (IcoDecoder*)iface; + LARGE_INTEGER seek; + HRESULT hr; + ULONG bytesread; + TRACE("(%p,%p,%x)\n", iface, pIStream, cacheOptions); + + if (This->initialized) return WINCODEC_ERR_WRONGSTATE; + + seek.QuadPart = 0; + hr = IStream_Seek(pIStream, seek, STREAM_SEEK_SET, NULL); + if (FAILED(hr)) return hr; + + hr = IStream_Read(pIStream, &This->header, sizeof(ICONHEADER), &bytesread); + if (FAILED(hr)) return hr; + if (bytesread != sizeof(ICONHEADER) || + This->header.idReserved != 0 || + This->header.idType != 1) return E_FAIL; + + This->initialized = TRUE; + This->stream = pIStream; + IStream_AddRef(pIStream); + + return S_OK; } static HRESULT WINAPI IcoDecoder_GetContainerFormat(IWICBitmapDecoder *iface, @@ -217,6 +242,8 @@ HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->lpVtbl = &IcoDecoder_Vtbl; This->ref = 1; + This->stream = NULL; + This->initialized = FALSE; ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); IUnknown_Release((IUnknown*)This);
1
0
0
0
Vincent Povirk : windowscodecs: Add stub ICO decoder.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: 2ca8b9fd8d0ac9b721be2cd72002d343dcc78d2d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2ca8b9fd8d0ac9b721be2cd72…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Aug 20 09:22:16 2009 -0500 windowscodecs: Add stub ICO decoder. --- dlls/windowscodecs/Makefile.in | 1 + dlls/windowscodecs/clsfactory.c | 1 + dlls/windowscodecs/icoformat.c | 225 ++++++++++++++++++++++++++++++++ dlls/windowscodecs/regsvr.c | 28 ++++ dlls/windowscodecs/wincodecs_private.h | 1 + 5 files changed, 256 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/Makefile.in b/dlls/windowscodecs/Makefile.in index 1e478f6..a85618e 100644 --- a/dlls/windowscodecs/Makefile.in +++ b/dlls/windowscodecs/Makefile.in @@ -12,6 +12,7 @@ C_SRCS = \ clsfactory.c \ converter.c \ gifformat.c \ + icoformat.c \ imgfactory.c \ info.c \ main.c \ diff --git a/dlls/windowscodecs/clsfactory.c b/dlls/windowscodecs/clsfactory.c index 876cbbb..0ce08b3 100644 --- a/dlls/windowscodecs/clsfactory.c +++ b/dlls/windowscodecs/clsfactory.c @@ -46,6 +46,7 @@ static classinfo wic_classes[] = { {&CLSID_WICBmpDecoder, BmpDecoder_CreateInstance}, {&CLSID_WICBmpEncoder, BmpEncoder_CreateInstance}, {&CLSID_WICGifDecoder, GifDecoder_CreateInstance}, + {&CLSID_WICIcoDecoder, IcoDecoder_CreateInstance}, {&CLSID_WICDefaultFormatConverter, FormatConverter_CreateInstance}, {0}}; diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c new file mode 100644 index 0000000..f61ae01 --- /dev/null +++ b/dlls/windowscodecs/icoformat.c @@ -0,0 +1,225 @@ +/* + * Copyright 2009 Vincent Povirk for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include <stdarg.h> + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "objbase.h" +#include "wincodec.h" + +#include "wincodecs_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); + +#include "pshpack1.h" + +typedef struct { + BYTE bWidth; + BYTE bHeight; + BYTE bColorCount; + BYTE bReserved; + WORD wPlanes; + WORD wBitCount; + DWORD dwDIBSize; + DWORD dwDIBOffset; +} ICONDIRENTRY; + +typedef struct +{ + WORD idReserved; + WORD idType; + WORD idCount; +} ICONHEADER; + +#include "poppack.h" + +typedef struct { + const IWICBitmapDecoderVtbl *lpVtbl; + LONG ref; +} IcoDecoder; + +static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid, + void **ppv) +{ + IcoDecoder *This = (IcoDecoder*)iface; + TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv); + + if (!ppv) return E_INVALIDARG; + + if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapDecoder, iid)) + { + *ppv = This; + } + else + { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI IcoDecoder_AddRef(IWICBitmapDecoder *iface) +{ + IcoDecoder *This = (IcoDecoder*)iface; + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + return ref; +} + +static ULONG WINAPI IcoDecoder_Release(IWICBitmapDecoder *iface) +{ + IcoDecoder *This = (IcoDecoder*)iface; + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) refcount=%u\n", iface, ref); + + if (ref == 0) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *pIStream, + DWORD *pdwCapability) +{ + FIXME("(%p,%p,%p): stub\n", iface, pIStream, pdwCapability); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream, + WICDecodeOptions cacheOptions) +{ + FIXME("(%p,%p,%x): stub\n", iface, pIStream, cacheOptions); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoDecoder_GetContainerFormat(IWICBitmapDecoder *iface, + GUID *pguidContainerFormat) +{ + FIXME("(%p,%p): stub\n", iface, pguidContainerFormat); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, + IWICBitmapDecoderInfo **ppIDecoderInfo) +{ + FIXME("(%p,%p): stub\n", iface, ppIDecoderInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoDecoder_CopyPalette(IWICBitmapDecoder *iface, + IWICPalette *pIPalette) +{ + TRACE("(%p,%p)\n", iface, pIPalette); + return WINCODEC_ERR_PALETTEUNAVAILABLE; +} + +static HRESULT WINAPI IcoDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI IcoDecoder_GetPreview(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIBitmapSource) +{ + TRACE("(%p,%p)\n", iface, ppIBitmapSource); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI IcoDecoder_GetColorContexts(IWICBitmapDecoder *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount); + return WINCODEC_ERR_UNSUPPORTEDOPERATION; +} + +static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIThumbnail) +{ + TRACE("(%p,%p)\n", iface, ppIThumbnail); + return WINCODEC_ERR_CODECNOTHUMBNAIL; +} + +static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface, + UINT *pCount) +{ + FIXME("(%p,%p): stub\n", iface, pCount); + return E_NOTIMPL; +} + +static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface, + UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) +{ + FIXME("(%p,%u,%p): stub\n", iface, index, ppIBitmapFrame); + return E_NOTIMPL; +} + +static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl = { + IcoDecoder_QueryInterface, + IcoDecoder_AddRef, + IcoDecoder_Release, + IcoDecoder_QueryCapability, + IcoDecoder_Initialize, + IcoDecoder_GetContainerFormat, + IcoDecoder_GetDecoderInfo, + IcoDecoder_CopyPalette, + IcoDecoder_GetMetadataQueryReader, + IcoDecoder_GetPreview, + IcoDecoder_GetColorContexts, + IcoDecoder_GetThumbnail, + IcoDecoder_GetFrameCount, + IcoDecoder_GetFrame +}; + +HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) +{ + IcoDecoder *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(IcoDecoder)); + if (!This) return E_OUTOFMEMORY; + + This->lpVtbl = &IcoDecoder_Vtbl; + This->ref = 1; + + ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv); + IUnknown_Release((IUnknown*)This); + + return ret; +} diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 5860a82..b931b19 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -747,6 +747,12 @@ static struct regsvr_coclass const coclass_list[] = { "windowscodecs.dll", "Apartment" }, + { &CLSID_WICIcoDecoder, + "WIC ICO Decoder", + NULL, + "windowscodecs.dll", + "Apartment" + }, { &CLSID_WICDefaultFormatConverter, "WIC Default Format Converter", NULL, @@ -795,6 +801,18 @@ static struct decoder_pattern const gif_patterns[] = { {0} }; +static const BYTE ico_magic[] = {00,00,01,00}; + +static GUID const * const ico_formats[] = { + &GUID_WICPixelFormat32bppBGRA, + NULL +}; + +static struct decoder_pattern const ico_patterns[] = { + {4,0,ico_magic,mask_all,0}, + {0} +}; + static struct regsvr_decoder const decoder_list[] = { { &CLSID_WICBmpDecoder, "The Wine Project", @@ -816,6 +834,16 @@ static struct regsvr_decoder const decoder_list[] = { gif_formats, gif_patterns }, + { &CLSID_WICIcoDecoder, + "The Wine Project", + "ICO Decoder", + "1.0.0.0", + &GUID_VendorMicrosoft, + "image/vnd.microsoft.icon", + ".ico", + ico_formats, + ico_patterns + }, { NULL } /* list terminator */ }; diff --git a/dlls/windowscodecs/wincodecs_private.h b/dlls/windowscodecs/wincodecs_private.h index da6f374..d4441d0 100644 --- a/dlls/windowscodecs/wincodecs_private.h +++ b/dlls/windowscodecs/wincodecs_private.h @@ -24,6 +24,7 @@ extern HRESULT ImagingFactory_CreateInstance(IUnknown *pUnkOuter, REFIID riid, v extern HRESULT BmpDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID riid, void** ppv); extern HRESULT BmpEncoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID riid, void** ppv); +extern HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv); extern HRESULT PaletteImpl_Create(IWICPalette **palette); extern HRESULT StreamImpl_Create(IWICStream **stream);
1
0
0
0
Rico Schüller : d3d10: Implement GetConstantBufferByIndex.
by Alexandre Julliard
21 Aug '09
21 Aug '09
Module: wine Branch: master Commit: 48f66efbfe506fdbccaa9a127c61e14e46d70a00 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=48f66efbfe506fdbccaa9a127…
Author: Rico Schüller <kgbricola(a)web.de> Date: Thu Aug 20 19:06:49 2009 +0200 d3d10: Implement GetConstantBufferByIndex. --- dlls/d3d10/effect.c | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dlls/d3d10/effect.c b/dlls/d3d10/effect.c index f40d5fd..a5a32e1 100644 --- a/dlls/d3d10/effect.c +++ b/dlls/d3d10/effect.c @@ -831,9 +831,22 @@ static HRESULT STDMETHODCALLTYPE d3d10_effect_GetDesc(ID3D10Effect *iface, D3D10 static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByIndex(ID3D10Effect *iface, UINT index) { - FIXME("iface %p, index %u stub!\n", iface, index); + struct d3d10_effect *This = (struct d3d10_effect *)iface; + struct d3d10_effect_local_buffer *l; - return NULL; + TRACE("iface %p, index %u\n", iface, index); + + if (index >= This->local_buffer_count) + { + WARN("Invalid index specified\n"); + return NULL; + } + + l = &This->local_buffers[index]; + + TRACE("Returning buffer %p, \"%s\"\n", l, l->name); + + return (ID3D10EffectConstantBuffer *)l; } static struct ID3D10EffectConstantBuffer * STDMETHODCALLTYPE d3d10_effect_GetConstantBufferByName(ID3D10Effect *iface,
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
105
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
Results per page:
10
25
50
100
200