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
September 2012
----- 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
828 discussions
Start a n
N
ew thread
Francois Gouget : windowscodecs: Fix compilation on systems that don' t support nameless unions.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: fe6451e2ababbe6b4a7ee9c6fbd0f41b45c2e103 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fe6451e2ababbe6b4a7ee9c6f…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Sep 24 08:03:10 2012 +0200 windowscodecs: Fix compilation on systems that don't support nameless unions. --- dlls/windowscodecs/pngformat.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c index 3eae4b7..d0977b4 100644 --- a/dlls/windowscodecs/pngformat.c +++ b/dlls/windowscodecs/pngformat.c @@ -25,6 +25,7 @@ #include <png.h> #endif +#define NONAMELESSUNION #define COBJMACROS #include "windef.h" @@ -129,9 +130,9 @@ static HRESULT LoadTextMetadata(IStream *stream, const GUID *preferred_vendor, value[value_len] = 0; result[0].id.vt = VT_LPSTR; - result[0].id.pszVal = name; + result[0].id.u.pszVal = name; result[0].value.vt = VT_LPSTR; - result[0].value.pszVal = value; + result[0].value.u.pszVal = value; *items = result; *item_count = 1;
1
0
0
0
Francois Gouget : d3dx9_36/tests: Fix compilation on systems that don' t support nameless structs or unions.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: ae3a919ba00cb9a13835a557533b931f4533addc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ae3a919ba00cb9a13835a5575…
Author: Francois Gouget <fgouget(a)free.fr> Date: Mon Sep 24 08:02:31 2012 +0200 d3dx9_36/tests: Fix compilation on systems that don't support nameless structs or unions. --- dlls/d3dx9_36/tests/shader.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/d3dx9_36/tests/shader.c b/dlls/d3dx9_36/tests/shader.c index ad092ab..32fab94 100644 --- a/dlls/d3dx9_36/tests/shader.c +++ b/dlls/d3dx9_36/tests/shader.c @@ -643,9 +643,9 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) ok(res == D3D_OK, "ID3DXConstantTable_SetMatrix failed on variable f: 0x%08x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, + ok(out[0] == S(U(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, "The variable f was not set correctly by ID3DXConstantTable_SetMatrix, got %f, should be %f\n", - out[0], U(S(mvp))._11); + out[0], S(U(mvp))._11); /* Clear registers */ memset(out, 0, sizeof(out)); @@ -699,9 +699,9 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable f: 0x%08x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, + ok(out[0] == S(U(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, "The variable f was not set correctly by ID3DXConstantTable_SetMatrixTranspose, got %f, should be %f\n", - out[0], U(S(mvp))._11); + out[0], S(U(mvp))._11); res = ID3DXConstantTable_SetMatrixTranspose(ctable, device, "f4", &mvp); ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTranspose failed on variable f4: 0x%08x\n", res); @@ -719,20 +719,20 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixPointerArray failed on variable f: got %#x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, + ok(out[0] == S(U(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, "The variable f was not set correctly by ID3DXConstantTable_SetMatrixPointerArray, " "got %f, should be %f\n", - out[0], U(S(mvp))._11); + out[0], S(U(mvp))._11); res = ID3DXConstantTable_SetMatrixPointerArray(ctable, device, "f4", matrix_pointer, 1); ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixPointerArray failed on variable f4: got %#x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == U(S(mvp))._12 && out[2] == U(S(mvp))._13 && out[3] == U(S(mvp))._14, + ok(out[0] == S(U(mvp))._11 && out[1] == S(U(mvp))._12 && out[2] == S(U(mvp))._13 && out[3] == S(U(mvp))._14, "The variable f4 was not set correctly by ID3DXConstantTable_SetMatrixPointerArray, " "got {%f, %f, %f, %f}, should be {%f, %f, %f, %f}\n", out[0], out[1], out[2], out[3], - U(S(mvp))._11, U(S(mvp))._12, U(S(mvp))._13, U(S(mvp))._14); + S(U(mvp))._11, S(U(mvp))._12, S(U(mvp))._13, S(U(mvp))._14); memset(out, 0, sizeof(out)); IDirect3DDevice9_SetVertexShaderConstantF(device, 6, out, 1); @@ -740,20 +740,20 @@ static void test_setting_basic_table(IDirect3DDevice9 *device) ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTransposePointerArray failed on variable f: got %#x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 6, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, + ok(out[0] == S(U(mvp))._11 && out[1] == 0.0f && out[2] == 0.0f && out[3] == 0.0f, "The variable f was not set correctly by ID3DXConstantTable_SetMatrixTransposePointerArray, " "got %f, should be %f\n", - out[0], U(S(mvp))._11); + out[0], S(U(mvp))._11); res = ID3DXConstantTable_SetMatrixTransposePointerArray(ctable, device, "f4", matrix_pointer, 1); ok(res == D3D_OK, "ID3DXConstantTable_SetMatrixTransposePointerArray failed on variable f4: got %#x\n", res); IDirect3DDevice9_GetVertexShaderConstantF(device, 7, out, 1); - ok(out[0] == U(S(mvp))._11 && out[1] == U(S(mvp))._21 && out[2] == U(S(mvp))._31 && out[3] == U(S(mvp))._41, + ok(out[0] == S(U(mvp))._11 && out[1] == S(U(mvp))._21 && out[2] == S(U(mvp))._31 && out[3] == S(U(mvp))._41, "The variable f4 was not set correctly by ID3DXConstantTable_SetMatrixTransposePointerArray, " "got {%f, %f, %f, %f}, should be {%f, %f, %f, %f}\n", out[0], out[1], out[2], out[3], - U(S(mvp))._11, U(S(mvp))._21, U(S(mvp))._31, U(S(mvp))._41); + S(U(mvp))._11, S(U(mvp))._21, S(U(mvp))._31, S(U(mvp))._41); refcnt = ID3DXConstantTable_Release(ctable); ok(refcnt == 0, "The constant table reference count was %u, should be 0\n", refcnt);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Take into account return value of IWICPalette_InitializeCustom().
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 36560f462bb5233ae798df83c70ec8cf1d9247c4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=36560f462bb5233ae798df83c…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:23:32 2012 +0900 windowscodecs: Take into account return value of IWICPalette_InitializeCustom(). --- dlls/windowscodecs/gifformat.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index 0594a86..78371b0 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -739,9 +739,7 @@ static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, } } - IWICPalette_InitializeCustom(pIPalette, colors, cm->ColorCount); - - return S_OK; + return IWICPalette_InitializeCustom(pIPalette, colors, cm->ColorCount); } static HRESULT copy_interlaced_pixels(const BYTE *srcbuffer,
1
0
0
0
Dmitry Timoshkov : windowscodecs: Calculate transparent color index for global GIF palette.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: a457978489dc1bc31321aceb75385c92a265e052 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a457978489dc1bc31321aceb7…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:23:18 2012 +0900 windowscodecs: Calculate transparent color index for global GIF palette. --- dlls/windowscodecs/gifformat.c | 22 ++++++++++++++++++++-- dlls/windowscodecs/tests/gifformat.c | 3 --- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index b27b3ad..0594a86 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -582,6 +582,7 @@ typedef struct { LONG ref; BOOL initialized; GifFileType *gif; + UINT current_frame; CRITICAL_SECTION lock; } GifDecoder; @@ -1170,7 +1171,8 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet GifDecoder *This = impl_from_IWICBitmapDecoder(iface); WICColor colors[256]; ColorMapObject *cm; - int i; + int i, trans; + ExtensionBlock *eb; TRACE("(%p,%p)\n", iface, palette); @@ -1191,7 +1193,21 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalet cm->Colors[i].Blue; } - /* FIXME: transparent color? */ + /* look for the transparent color extension */ + for (i = 0; i < This->gif->SavedImages[This->current_frame].Extensions.ExtensionBlockCount; i++) + { + eb = This->gif->SavedImages[This->current_frame].Extensions.ExtensionBlocks + i; + if (eb->Function == GRAPHICS_EXT_FUNC_CODE && eb->ByteCount == 8) + { + if (eb->Bytes[3] & 1) + { + trans = (unsigned char)eb->Bytes[6]; + colors[trans] &= 0xffffff; /* set alpha to 0 */ + break; + } + } + } + return IWICPalette_InitializeCustom(palette, colors, cm->ColorCount); } @@ -1258,6 +1274,7 @@ static HRESULT WINAPI GifDecoder_GetFrame(IWICBitmapDecoder *iface, result->frame = &This->gif->SavedImages[index]; IWICBitmapDecoder_AddRef(iface); result->parent = This; + This->current_frame = index; *ppIBitmapFrame = &result->IWICBitmapFrameDecode_iface; @@ -1396,6 +1413,7 @@ HRESULT GifDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv) This->ref = 1; This->initialized = FALSE; This->gif = NULL; + This->current_frame = 0; InitializeCriticalSection(&This->lock); This->lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": GifDecoder.lock"); diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index 549cf2b..9ff1d90 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -127,7 +127,6 @@ static void test_global_gif_palette(void) ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); -todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); @@ -193,7 +192,6 @@ static void test_global_gif_palette_2frames(void) ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); -todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); @@ -238,7 +236,6 @@ todo_wine ok(ret == count, "expected %u, got %u\n", count, ret); ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); ok(color[1] == 0xff040506 || broken(color[1] == 0x00040506) /* XP */, "expected 0xff040506, got %#x\n", color[1]); -todo_wine ok(color[2] == 0x00070809 || broken(color[2] == 0xff070809) /* XP */, "expected 0x00070809, got %#x\n", color[2]); ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add some tests for palette in a multiframe GIF image.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 3eb499556e34f74e6afe4bff143e7f46201b584a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3eb499556e34f74e6afe4bff1…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:23:10 2012 +0900 windowscodecs: Add some tests for palette in a multiframe GIF image. --- dlls/windowscodecs/tests/gifformat.c | 122 ++++++++++++++++++++++++++++++++++ 1 files changed, 122 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index 4a5ea5c..549cf2b 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -33,6 +33,20 @@ static const char gif_global_palette[] = { 0x02,0x02,0x44,0x01,0x00,0x3b }; +/* frame 0, GCE transparent index 1 + * frame 1, GCE transparent index 2 + */ +static const char gif_global_palette_2frames[] = { +/* LSD */'G','I','F','8','9','a',0x01,0x00,0x01,0x00,0xa1,0x02,0x00, +/* palette */0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c, +/* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x01,0x00, /* index 1 */ +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +0x02,0x02,0x44,0x01,0x00, +/* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x02,0x00, /* index 2 */ +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +0x02,0x02,0x44,0x01,0x00,0x3b +}; + static const char gif_local_palette[] = { /* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x27,0x02,0x00, /* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x01,0x00, /* index 1 */ @@ -147,6 +161,113 @@ todo_wine IWICBitmapDecoder_Release(decoder); } +static void test_global_gif_palette_2frames(void) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + IWICPalette *palette; + GUID format; + UINT count, ret; + WICColor color[256]; + + decoder = create_decoder(gif_global_palette_2frames, sizeof(gif_global_palette_2frames)); + ok(decoder != 0, "Failed to load GIF image data\n"); + + /* active frame 0, GCE transparent index 1 */ + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "CreatePalette error %#x\n", hr); + + /* global palette */ + hr = IWICBitmapDecoder_CopyPalette(decoder, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); +todo_wine + ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); + ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + /* frame 0 palette */ + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), + "wrong pixel format %s\n", debugstr_guid(&format)); + + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); + ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); + ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + IWICBitmapFrameDecode_Release(frame); + + /* active frame 1, GCE transparent index 2 */ + hr = IWICBitmapDecoder_GetFrame(decoder, 1, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + /* global palette */ + hr = IWICBitmapDecoder_CopyPalette(decoder, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); + ok(color[1] == 0xff040506 || broken(color[1] == 0x00040506) /* XP */, "expected 0xff040506, got %#x\n", color[1]); +todo_wine + ok(color[2] == 0x00070809 || broken(color[2] == 0xff070809) /* XP */, "expected 0x00070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + /* frame 1 palette */ + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), + "wrong pixel format %s\n", debugstr_guid(&format)); + + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); + ok(color[1] == 0xff040506, "expected 0xff040506, got %#x\n", color[1]); + ok(color[2] == 0x00070809, "expected 0x00070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + IWICPalette_Release(palette); + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); +} + static void test_local_gif_palette(void) { HRESULT hr; @@ -208,6 +329,7 @@ START_TEST(gifformat) if (FAILED(hr)) return; test_global_gif_palette(); + test_global_gif_palette_2frames(); test_local_gif_palette(); IWICImagingFactory_Release(factory);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Implement IWICBitmapDecoder_CopyPalette for the GIF decoder.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 54800a80744768cef06c2f6d8b273950dfd11b1a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=54800a80744768cef06c2f6d8…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:23:04 2012 +0900 windowscodecs: Implement IWICBitmapDecoder_CopyPalette for the GIF decoder. --- dlls/windowscodecs/gifformat.c | 31 +++++++++++++++++++++++++++---- dlls/windowscodecs/tests/gifformat.c | 6 ++---- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index fc6909b..b27b3ad 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -1165,11 +1165,34 @@ static HRESULT WINAPI GifDecoder_GetDecoderInfo(IWICBitmapDecoder *iface, return hr; } -static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, - IWICPalette *pIPalette) +static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalette *palette) { - TRACE("(%p,%p)\n", iface, pIPalette); - return WINCODEC_ERR_FRAMEMISSING; + GifDecoder *This = impl_from_IWICBitmapDecoder(iface); + WICColor colors[256]; + ColorMapObject *cm; + int i; + + TRACE("(%p,%p)\n", iface, palette); + + cm = This->gif->SColorMap; + if (!cm) return WINCODEC_ERR_FRAMEMISSING; + + if (cm->ColorCount > 256) + { + ERR("GIF contains invalid number of colors: %d\n", cm->ColorCount); + return E_FAIL; + } + + for (i = 0; i < cm->ColorCount; i++) + { + colors[i] = 0xff000000 | /* alpha */ + cm->Colors[i].Red << 16 | + cm->Colors[i].Green << 8 | + cm->Colors[i].Blue; + } + + /* FIXME: transparent color? */ + return IWICPalette_InitializeCustom(palette, colors, cm->ColorCount); } static HRESULT WINAPI GifDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index b633ad0..4a5ea5c 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -103,23 +103,21 @@ static void test_global_gif_palette(void) /* global palette */ hr = IWICBitmapDecoder_CopyPalette(decoder, palette); -todo_wine ok(hr == S_OK, "CopyPalette error %#x\n", hr); hr = IWICPalette_GetColorCount(palette, &count); ok(hr == S_OK, "GetColorCount error %#x\n", hr); -todo_wine ok(count == 4, "expected 4, got %u\n", count); hr = IWICPalette_GetColors(palette, count, color, &ret); ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); -todo_wine { ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); +todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); -} + /* frame palette */ hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); ok(hr == S_OK, "GetFrame error %#x\n", hr);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add some tests for GIF global palette.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: af8b90c1062544f398409ce61fa24917cb554623 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=af8b90c1062544f398409ce61…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:22:57 2012 +0900 windowscodecs: Add some tests for GIF global palette. --- dlls/windowscodecs/tests/gifformat.c | 73 ++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index b9c1059..b633ad0 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -25,6 +25,14 @@ #include "wincodec.h" #include "wine/test.h" +static const char gif_global_palette[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0xa1,0x02,0x00, +/* palette */0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c, +/* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x01,0x00, /* index 1 */ +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00, +0x02,0x02,0x44,0x01,0x00,0x3b +}; + static const char gif_local_palette[] = { /* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x27,0x02,0x00, /* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x01,0x00, /* index 1 */ @@ -77,6 +85,70 @@ static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size return decoder; } +static void test_global_gif_palette(void) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + IWICPalette *palette; + GUID format; + UINT count, ret; + WICColor color[256]; + + decoder = create_decoder(gif_global_palette, sizeof(gif_global_palette)); + ok(decoder != 0, "Failed to load GIF image data\n"); + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "CreatePalette error %#x\n", hr); + + /* global palette */ + hr = IWICBitmapDecoder_CopyPalette(decoder, palette); +todo_wine + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); +todo_wine + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); +todo_wine { + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); + ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); + ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); +} + /* frame palette */ + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), + "wrong pixel format %s\n", debugstr_guid(&format)); + + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); + ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); + ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + IWICPalette_Release(palette); + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); +} + static void test_local_gif_palette(void) { HRESULT hr; @@ -137,6 +209,7 @@ START_TEST(gifformat) ok(hr == S_OK, "CoCreateInstance error %#x\n", hr); if (FAILED(hr)) return; + test_global_gif_palette(); test_local_gif_palette(); IWICImagingFactory_Release(factory);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Fix calculation of transparent GIF color index.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 507abc41ca0fb9fe82cef393d77d021a14596867 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=507abc41ca0fb9fe82cef393d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:22:49 2012 +0900 windowscodecs: Fix calculation of transparent GIF color index. --- dlls/windowscodecs/gifformat.c | 6 +++--- dlls/windowscodecs/tests/gifformat.c | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index c378348..fc6909b 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -729,9 +729,9 @@ static HRESULT WINAPI GifFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, /* look for the transparent color extension */ for (i = 0; i < This->frame->Extensions.ExtensionBlockCount; ++i) { eb = This->frame->Extensions.ExtensionBlocks + i; - if (eb->Function == 0xF9 && eb->ByteCount == 4) { - if ((eb->Bytes[0] & 1) == 1) { - trans = (unsigned char)eb->Bytes[3]; + if (eb->Function == GRAPHICS_EXT_FUNC_CODE && eb->ByteCount == 8) { + if (eb->Bytes[3] & 1) { + trans = (unsigned char)eb->Bytes[6]; colors[trans] &= 0xffffff; /* set alpha to 0 */ break; } diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index 8788696..b9c1059 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -118,7 +118,6 @@ static void test_local_gif_palette(void) ok(hr == S_OK, "GetColors error %#x\n", hr); ok(ret == count, "expected %u, got %u\n", count, ret); ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); -todo_wine ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Return WINCODEC_ERR_FRAMEMISSING if there is no global GIF palette.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 56f37637b8dd5a9a8096c2711cd1d680c12d95d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=56f37637b8dd5a9a8096c2711…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:22:42 2012 +0900 windowscodecs: Return WINCODEC_ERR_FRAMEMISSING if there is no global GIF palette. --- dlls/windowscodecs/gifformat.c | 2 +- dlls/windowscodecs/tests/gifformat.c | 1 - 2 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/gifformat.c b/dlls/windowscodecs/gifformat.c index 81bde20..c378348 100644 --- a/dlls/windowscodecs/gifformat.c +++ b/dlls/windowscodecs/gifformat.c @@ -1169,7 +1169,7 @@ static HRESULT WINAPI GifDecoder_CopyPalette(IWICBitmapDecoder *iface, IWICPalette *pIPalette) { TRACE("(%p,%p)\n", iface, pIPalette); - return WINCODEC_ERR_PALETTEUNAVAILABLE; + return WINCODEC_ERR_FRAMEMISSING; } static HRESULT WINAPI GifDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface, diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c index 4c78ebb..8788696 100644 --- a/dlls/windowscodecs/tests/gifformat.c +++ b/dlls/windowscodecs/tests/gifformat.c @@ -95,7 +95,6 @@ static void test_local_gif_palette(void) /* global palette */ hr = IWICBitmapDecoder_CopyPalette(decoder, palette); -todo_wine ok(hr == WINCODEC_ERR_FRAMEMISSING, "expected WINCODEC_ERR_FRAMEMISSING, got %#x\n", hr);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add some tests for GIF palette.
by Alexandre Julliard
24 Sep '12
24 Sep '12
Module: wine Branch: master Commit: 51242a3f18ddf75a8da241d2098e5f1cd70e6da6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=51242a3f18ddf75a8da241d20…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Sep 24 13:22:33 2012 +0900 windowscodecs: Add some tests for GIF palette. --- dlls/windowscodecs/tests/Makefile.in | 1 + dlls/windowscodecs/tests/gifformat.c | 146 ++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/tests/Makefile.in b/dlls/windowscodecs/tests/Makefile.in index 325c28e..d4b75ae 100644 --- a/dlls/windowscodecs/tests/Makefile.in +++ b/dlls/windowscodecs/tests/Makefile.in @@ -5,6 +5,7 @@ C_SRCS = \ bitmap.c \ bmpformat.c \ converter.c \ + gifformat.c \ icoformat.c \ info.c \ metadata.c \ diff --git a/dlls/windowscodecs/tests/gifformat.c b/dlls/windowscodecs/tests/gifformat.c new file mode 100644 index 0000000..4c78ebb --- /dev/null +++ b/dlls/windowscodecs/tests/gifformat.c @@ -0,0 +1,146 @@ +/* + * Copyright 2012 Dmitry Timoshkov + * + * 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 <stdarg.h> +#include <stdio.h> + +#define COBJMACROS + +#include "windef.h" +#include "wincodec.h" +#include "wine/test.h" + +static const char gif_local_palette[] = { +/* LSD */'G','I','F','8','7','a',0x01,0x00,0x01,0x00,0x27,0x02,0x00, +/* GCE */0x21,0xf9,0x04,0x01,0x05,0x00,0x01,0x00, /* index 1 */ +/* IMD */0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x81, +/* palette */0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c, +0x02,0x02,0x44,0x01,0x00,0x3b +}; + +static IWICImagingFactory *factory; + +static const char *debugstr_guid(const GUID *guid) +{ + static char buf[50]; + + if (!guid) return "(null)"; + sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], + guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], + guid->Data4[5], guid->Data4[6], guid->Data4[7]); + return buf; +} + +static IWICBitmapDecoder *create_decoder(const void *image_data, UINT image_size) +{ + HGLOBAL hmem; + BYTE *data; + HRESULT hr; + IWICBitmapDecoder *decoder = NULL; + IStream *stream; + GUID format; + + hmem = GlobalAlloc(0, image_size); + data = GlobalLock(hmem); + memcpy(data, image_data, image_size); + GlobalUnlock(hmem); + + hr = CreateStreamOnHGlobal(hmem, TRUE, &stream); + ok(hr == S_OK, "CreateStreamOnHGlobal error %#x\n", hr); + + hr = IWICImagingFactory_CreateDecoderFromStream(factory, stream, NULL, 0, &decoder); + ok(hr == S_OK, "CreateDecoderFromStream error %#x\n", hr); + + hr = IWICBitmapDecoder_GetContainerFormat(decoder, &format); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_ContainerFormatGif), + "wrong container format %s\n", debugstr_guid(&format)); + + IStream_Release(stream); + + return decoder; +} + +static void test_local_gif_palette(void) +{ + HRESULT hr; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + IWICPalette *palette; + GUID format; + UINT count, ret; + WICColor color[256]; + + decoder = create_decoder(gif_local_palette, sizeof(gif_local_palette)); + ok(decoder != 0, "Failed to load GIF image data\n"); + + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "CreatePalette error %#x\n", hr); + + /* global palette */ + hr = IWICBitmapDecoder_CopyPalette(decoder, palette); +todo_wine + ok(hr == WINCODEC_ERR_FRAMEMISSING, + "expected WINCODEC_ERR_FRAMEMISSING, got %#x\n", hr); + + /* frame palette */ + hr = IWICBitmapDecoder_GetFrame(decoder, 0, &frame); + ok(hr == S_OK, "GetFrame error %#x\n", hr); + + hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &format); + ok(hr == S_OK, "GetPixelFormat error %#x\n", hr); + ok(IsEqualGUID(&format, &GUID_WICPixelFormat8bppIndexed), + "wrong pixel format %s\n", debugstr_guid(&format)); + + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == S_OK, "CopyPalette error %#x\n", hr); + + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "GetColorCount error %#x\n", hr); + ok(count == 4, "expected 4, got %u\n", count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "GetColors error %#x\n", hr); + ok(ret == count, "expected %u, got %u\n", count, ret); + ok(color[0] == 0xff010203, "expected 0xff010203, got %#x\n", color[0]); +todo_wine + ok(color[1] == 0x00040506, "expected 0x00040506, got %#x\n", color[1]); + ok(color[2] == 0xff070809, "expected 0xff070809, got %#x\n", color[2]); + ok(color[3] == 0xff0a0b0c, "expected 0xff0a0b0c, got %#x\n", color[3]); + + IWICPalette_Release(palette); + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); +} + +START_TEST(gifformat) +{ + HRESULT hr; + + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&factory); + ok(hr == S_OK, "CoCreateInstance error %#x\n", hr); + if (FAILED(hr)) return; + + test_local_gif_palette(); + + IWICImagingFactory_Release(factory); + CoUninitialize(); +}
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
83
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
Results per page:
10
25
50
100
200