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
July 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
712 discussions
Start a n
N
ew thread
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray16 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 179ed52bd39df7436688a8b7db9150e3b4d99ca6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=179ed52bd39df7436688a8b7d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:55:53 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray16 palette. --- dlls/windowscodecs/palette.c | 22 ++++++++++++++++++++++ dlls/windowscodecs/tests/palette.c | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index ffd5877..03f5774a 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -98,6 +98,23 @@ static ULONG WINAPI PaletteImpl_Release(IWICPalette *iface) return ref; } +static WICColor *generate_gray16_palette(UINT *count) +{ + WICColor *entries; + UINT i; + + *count = 16; + entries = HeapAlloc(GetProcessHeap(), 0, 16 * sizeof(WICColor)); + if (!entries) return NULL; + + for (i = 0; i < 16; i++) + { + entries[i] = 0xff000000; + entries[i] |= (i<<20) | (i<<16) | (i<<12) | (i<<8) | (i<<4) | i; + } + return entries; +} + static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, WICBitmapPaletteType type, BOOL add_transparent) { @@ -127,6 +144,11 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, colors[3] = 0xffffffff; break; + case WICBitmapPaletteTypeFixedGray16: + colors = generate_gray16_palette(&count); + if (!colors) return E_OUTOFMEMORY; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index 1768e1a..aba8168 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -17,6 +17,7 @@ */ #include <stdarg.h> +#include <assert.h> #define COBJMACROS @@ -148,6 +149,19 @@ static void test_custom_palette(void) IWICImagingFactory_Release(factory); } +static void generate_gray16_palette(DWORD *entries, UINT count) +{ + UINT i; + + assert(count == 16); + + for (i = 0; i < 16; i++) + { + entries[i] = 0xff000000; + entries[i] |= (i << 20) | (i << 16) | (i << 12) | (i << 8) | (i << 4) | i; + } +} + static void test_predefined_palette(void) { static struct test_data @@ -161,6 +175,7 @@ static void test_predefined_palette(void) { WICBitmapPaletteTypeFixedBW, 1, 1, 2, { 0xff000000, 0xffffffff } }, { WICBitmapPaletteTypeFixedGray4, 0, 1, 4, { 0xff000000, 0xff555555, 0xffaaaaaa, 0xffffffff } }, + { WICBitmapPaletteTypeFixedGray16, 0, 1, 16, { 0 } }, }; IWICImagingFactory *factory; IWICPalette *palette; @@ -210,6 +225,10 @@ static void test_predefined_palette(void) if (ret == td[i].count) { UINT j; + + if (td[i].type == WICBitmapPaletteTypeFixedGray16) + generate_gray16_palette(td[i].color, td[i].count); + for (j = 0; j < count; j++) { ok(color[j] == td[i].color[j], "%u:[%u]: expected %#x, got %#x\n",
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray4 palette.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: d5cc4021b6ffd4116138eff84eb1d81241b66c82 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d5cc4021b6ffd4116138eff84…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:55:45 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedGray4 palette. --- dlls/windowscodecs/palette.c | 10 ++++++++++ dlls/windowscodecs/tests/palette.c | 2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index 8941fb5..ffd5877 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -117,6 +117,16 @@ static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, colors[1] = 0xffffffff; break; + case WICBitmapPaletteTypeFixedGray4: + count = 4; + colors = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WICColor)); + if (!colors) return E_OUTOFMEMORY; + colors[0] = 0xff000000; + colors[1] = 0xff555555; + colors[2] = 0xffaaaaaa; + colors[3] = 0xffffffff; + break; + default: FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); return E_NOTIMPL; diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index 7a34be7..1768e1a 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -159,6 +159,8 @@ static void test_predefined_palette(void) } td[] = { { WICBitmapPaletteTypeFixedBW, 1, 1, 2, { 0xff000000, 0xffffffff } }, + { WICBitmapPaletteTypeFixedGray4, 0, 1, 4, + { 0xff000000, 0xff555555, 0xffaaaaaa, 0xffffffff } }, }; IWICImagingFactory *factory; IWICPalette *palette;
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for generating WICBitmapPaletteTypeFixedBW palette. Resend.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: ca9d128ecaaa07ce057af709039e25fcf92ab4bf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ca9d128ecaaa07ce057af7090…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 16:06:29 2012 +0900 windowscodecs: Add support for generating WICBitmapPaletteTypeFixedBW palette. Resend. --- dlls/windowscodecs/palette.c | 33 ++++++++++++++- dlls/windowscodecs/tests/palette.c | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/palette.c b/dlls/windowscodecs/palette.c index ec74d13..8941fb5 100644 --- a/dlls/windowscodecs/palette.c +++ b/dlls/windowscodecs/palette.c @@ -99,10 +99,37 @@ static ULONG WINAPI PaletteImpl_Release(IWICPalette *iface) } static HRESULT WINAPI PaletteImpl_InitializePredefined(IWICPalette *iface, - WICBitmapPaletteType ePaletteType, BOOL fAddTransparentColor) + WICBitmapPaletteType type, BOOL add_transparent) { - FIXME("(%p,%u,%i): stub\n", iface, ePaletteType, fAddTransparentColor); - return E_NOTIMPL; + PaletteImpl *This = impl_from_IWICPalette(iface); + WICColor *colors; + UINT count; + + TRACE("(%p,%u,%d)\n", iface, type, add_transparent); + + switch (type) + { + case WICBitmapPaletteTypeFixedBW: + count = 2; + colors = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WICColor)); + if (!colors) return E_OUTOFMEMORY; + colors[0] = 0xff000000; + colors[1] = 0xffffffff; + break; + + default: + FIXME("(%p,%u,%d): stub\n", iface, type, add_transparent); + return E_NOTIMPL; + } + + EnterCriticalSection(&This->lock); + HeapFree(GetProcessHeap(), 0, This->colors); + This->colors = colors; + This->count = count; + This->type = type; + LeaveCriticalSection(&This->lock); + + return S_OK; } static HRESULT WINAPI PaletteImpl_InitializeCustom(IWICPalette *iface, diff --git a/dlls/windowscodecs/tests/palette.c b/dlls/windowscodecs/tests/palette.c index ee9dfbc..7a34be7 100644 --- a/dlls/windowscodecs/tests/palette.c +++ b/dlls/windowscodecs/tests/palette.c @@ -148,11 +148,85 @@ static void test_custom_palette(void) IWICImagingFactory_Release(factory); } +static void test_predefined_palette(void) +{ + static struct test_data + { + WICBitmapPaletteType type; + BOOL is_bw, is_gray; + UINT count; + WICColor color[256]; + } td[] = + { + { WICBitmapPaletteTypeFixedBW, 1, 1, 2, { 0xff000000, 0xffffffff } }, + }; + IWICImagingFactory *factory; + IWICPalette *palette; + HRESULT hr; + WICBitmapPaletteType type; + UINT count, i, ret; + BOOL bret; + WICColor color[256]; + + hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, + &IID_IWICImagingFactory, (void **)&factory); + ok(hr == S_OK, "CoCreateInstance error %#x\n", hr); + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + hr = IWICImagingFactory_CreatePalette(factory, &palette); + ok(hr == S_OK, "%u: CreatePalette error %#x\n", i, hr); + + hr = IWICPalette_InitializePredefined(palette, td[i].type, FALSE); + ok(hr == S_OK, "%u: InitializePredefined error %#x\n", i, hr); + + bret = -1; + hr = IWICPalette_IsBlackWhite(palette, &bret); + ok(hr == S_OK, "%u: IsBlackWhite error %#x\n", i, hr); + ok(bret == td[i].is_bw || + broken(td[i].type == WICBitmapPaletteTypeFixedBW && bret != td[i].is_bw), /* XP */ + "%u: expected %d, got %d\n",i, td[i].is_bw, bret); + + bret = -1; + hr = IWICPalette_IsGrayscale(palette, &bret); + ok(hr == S_OK, "%u: IsGrayscale error %#x\n", i, hr); + ok(bret == td[i].is_gray, "%u: expected %d, got %d\n", i, td[i].is_gray, bret); + + type = -1; + hr = IWICPalette_GetType(palette, &type); + ok(hr == S_OK, "%u: GetType error %#x\n", i, hr); + ok(type == td[i].type, "%u: expected %#x, got %#x\n", i, td[i].type, type); + + count = 0xdeadbeef; + hr = IWICPalette_GetColorCount(palette, &count); + ok(hr == S_OK, "%u: GetColorCount error %#x\n", i, hr); + ok(count == td[i].count, "%u: expected %u, got %u\n", i, td[i].count, count); + + hr = IWICPalette_GetColors(palette, count, color, &ret); + ok(hr == S_OK, "%u: GetColors error %#x\n", i, hr); + ok(ret == count, "%u: expected %u, got %u\n", i, count, ret); + if (ret == td[i].count) + { + UINT j; + for (j = 0; j < count; j++) + { + ok(color[j] == td[i].color[j], "%u:[%u]: expected %#x, got %#x\n", + i, j, td[i].color[j], color[j]); + } + } + + IWICPalette_Release(palette); + } + + IWICImagingFactory_Release(factory); +} + START_TEST(palette) { CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); test_custom_palette(); + test_predefined_palette(); CoUninitialize(); }
1
0
0
0
Alexandre Julliard : winex11: Get rid of the no longer needed drawable rect in the X11 device.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 4b0f27f664ea3fcbfd2c0c0b2fec872895aec76b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b0f27f664ea3fcbfd2c0c0b2…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Jul 12 14:19:58 2012 -0500 winex11: Get rid of the no longer needed drawable rect in the X11 device. --- dlls/winex11.drv/init.c | 10 +++------- dlls/winex11.drv/opengl.c | 3 +-- dlls/winex11.drv/window.c | 5 +---- dlls/winex11.drv/x11drv.h | 2 -- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index e582bda..7dcf8da 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -144,7 +144,6 @@ static BOOL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR driver, LPCWSTR device, physDev->depth = screen_depth; physDev->color_shifts = &X11DRV_PALETTE_default_shifts; - physDev->drawable_rect = virtual_screen_rect; SetRect( &physDev->dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left, virtual_screen_rect.bottom - virtual_screen_rect.top ); push_dc_driver( pdev, &physDev->dev, &x11drv_funcs ); @@ -165,8 +164,7 @@ static BOOL X11DRV_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev ) if (!physDev) return FALSE; physDev->depth = 1; - SetRect( &physDev->drawable_rect, 0, 0, 1, 1 ); - physDev->dc_rect = physDev->drawable_rect; + SetRect( &physDev->dc_rect, 0, 0, 1, 1 ); push_dc_driver( pdev, &physDev->dev, &x11drv_funcs ); if (orig) return TRUE; /* we already went through Xrender if we have an orig device */ if (xrender_funcs && !xrender_funcs->pCreateCompatibleDC( NULL, pdev )) return FALSE; @@ -352,13 +350,11 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d const struct x11drv_escape_set_drawable *data = in_data; physDev->dc_rect = data->dc_rect; physDev->drawable = data->drawable; - physDev->drawable_rect = data->drawable_rect; wine_tsx11_lock(); XSetSubwindowMode( gdi_display, physDev->gc, data->mode ); wine_tsx11_unlock(); - TRACE( "SET_DRAWABLE hdc %p drawable %lx dc_rect %s drawable_rect %s\n", - dev->hdc, physDev->drawable, wine_dbgstr_rect(&physDev->dc_rect), - wine_dbgstr_rect(&physDev->drawable_rect) ); + TRACE( "SET_DRAWABLE hdc %p drawable %lx dc_rect %s\n", + dev->hdc, physDev->drawable, wine_dbgstr_rect(&physDev->dc_rect) ); return TRUE; } break; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 44882cb..b32fe95 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2224,8 +2224,7 @@ static HDC WINAPI X11DRV_wglGetPbufferDCARB(HPBUFFERARB hPbuffer) escape.code = X11DRV_SET_DRAWABLE; escape.drawable = object->drawable; escape.mode = IncludeInferiors; - SetRect( &escape.drawable_rect, 0, 0, object->width, object->height ); - escape.dc_rect = escape.drawable_rect; + SetRect( &escape.dc_rect, 0, 0, object->width, object->height ); escape.fbconfig_id = object->fmt->fmt_id; escape.gl_drawable = object->drawable; escape.pixmap = 0; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 29317aa..b202586 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2324,7 +2324,6 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, escape.dc_rect.top = win_rect->top - top_rect->top; escape.dc_rect.right = win_rect->right - top_rect->left; escape.dc_rect.bottom = win_rect->bottom - top_rect->top; - escape.drawable_rect = *top_rect; if (top == hwnd) { @@ -2355,7 +2354,6 @@ void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, POINT pt = { 0, 0 }; MapWindowPoints( top, parent, &pt, 1 ); OffsetRect( &escape.dc_rect, pt.x, pt.y ); - OffsetRect( &escape.drawable_rect, -pt.x, -pt.y ); } else escape.drawable = X11DRV_get_client_window( top ); @@ -2380,10 +2378,9 @@ void CDECL X11DRV_ReleaseDC( HWND hwnd, HDC hdc ) escape.code = X11DRV_SET_DRAWABLE; escape.drawable = root_window; escape.mode = IncludeInferiors; - escape.drawable_rect = virtual_screen_rect; SetRect( &escape.dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left, virtual_screen_rect.bottom - virtual_screen_rect.top ); - OffsetRect( &escape.dc_rect, -escape.drawable_rect.left, -escape.drawable_rect.top ); + OffsetRect( &escape.dc_rect, -virtual_screen_rect.left, -virtual_screen_rect.top ); escape.fbconfig_id = 0; escape.gl_drawable = 0; escape.pixmap = 0; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 9ce0bbd..0c4154b 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -118,7 +118,6 @@ typedef struct GC gc; /* X Window GC */ Drawable drawable; RECT dc_rect; /* DC rectangle relative to drawable */ - RECT drawable_rect; /* Drawable rectangle relative to screen */ RECT *bounds; /* Graphics bounds */ HRGN region; /* Device region (visible region & clip region) */ X_PHYSPEN pen; @@ -298,7 +297,6 @@ struct x11drv_escape_set_drawable Drawable drawable; /* X drawable */ int mode; /* ClipByChildren or IncludeInferiors */ RECT dc_rect; /* DC rectangle relative to drawable */ - RECT drawable_rect;/* Drawable rectangle relative to screen */ XID fbconfig_id; /* fbconfig id used by the GL drawable */ Drawable gl_drawable; /* GL drawable */ Pixmap pixmap; /* Pixmap for a GLXPixmap gl_drawable */
1
0
0
0
Vincent Povirk : gdiplus: Accept a transformation matrix in GdipFlattenPath .
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 12f1ed2b3e89ad6fe0fe2dc7c2a0e20caa7a275b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=12f1ed2b3e89ad6fe0fe2dc7c…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Jul 11 16:10:31 2012 -0500 gdiplus: Accept a transformation matrix in GdipFlattenPath. --- dlls/gdiplus/graphicspath.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index ac17cc1..98d3fe9 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1189,20 +1189,22 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes GpPointF pt; INT i = 1; INT startidx = 0; + GpStatus stat; TRACE("(%p, %p, %.2f)\n", path, matrix, flatness); if(!path) return InvalidParameter; - if(matrix){ - WARN("transformation not supported yet!\n"); - return NotImplemented; - } - if(path->pathdata.Count == 0) return Ok; + if(matrix){ + stat = GdipTransformPath(path, matrix); + if (stat != Ok) + return stat; + } + pt = path->pathdata.Points[0]; if(!init_path_list(&list, pt.X, pt.Y)) return OutOfMemory;
1
0
0
0
Vincent Povirk : gdiplus: Implement LineJoinMiterClipped and partially implement LineJoinMiter.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: cbfc79aae574e8c162268c50ee501e880d3f60bc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cbfc79aae574e8c162268c50e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jun 28 09:06:44 2012 -0500 gdiplus: Implement LineJoinMiterClipped and partially implement LineJoinMiter. --- dlls/gdiplus/graphicspath.c | 33 ++++++++++++++++++++++++++++++++- 1 files changed, 32 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 370bb1f..ac17cc1 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1704,6 +1704,37 @@ static void widen_joint(const GpPointF *p1, const GpPointF *p2, const GpPointF * { switch (pen->join) { + case LineJoinMiter: + case LineJoinMiterClipped: + { + if ((p2->X - p1->X) * (p3->Y - p1->Y) > (p2->Y - p1->Y) * (p3->X - p1->X)) + { + float distance = pen->width/2.0; + float length_0 = sqrtf((p2->X-p1->X)*(p2->X-p1->X)+(p2->Y-p1->Y)*(p2->Y-p1->Y)); + float length_1 = sqrtf((p3->X-p2->X)*(p3->X-p2->X)+(p3->Y-p2->Y)*(p3->Y-p2->Y)); + float dx0 = distance * (p2->X - p1->X) / length_0; + float dy0 = distance * (p2->Y - p1->Y) / length_0; + float dx1 = distance * (p3->X - p2->X) / length_1; + float dy1 = distance * (p3->Y - p2->Y) / length_1; + float det = (dy0*dx1 - dx0*dy1); + float dx = (dx0*dx1*(dx0-dx1) + dy0*dy0*dx1 - dy1*dy1*dx0)/det; + float dy = (dy0*dy1*(dy0-dy1) + dx0*dx0*dy1 - dx1*dx1*dy0)/det; + if (dx*dx + dy*dy < pen->miterlimit*pen->miterlimit * distance*distance) + { + *last_point = add_path_list_node(*last_point, p2->X + dx, + p2->Y + dy, PathPointTypeLine); + break; + } + else if (pen->join == LineJoinMiter) + { + static int once; + if (!once++) + FIXME("should add a clipped corner\n"); + } + /* else fall-through */ + } + /* else fall-through */ + } default: case LineJoinBevel: add_bevel_point(p2, p1, pen, 1, last_point); @@ -1838,7 +1869,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, if (pen->dashcap != DashCapFlat) FIXME("unimplemented dash cap %d\n", pen->dashcap); - if (pen->join != LineJoinBevel) + if (pen->join == LineJoinRound) FIXME("unimplemented line join %d\n", pen->join); if (pen->dash != DashStyleSolid)
1
0
0
0
Vincent Povirk : gdiplus: Fix memory leak in GdipImageRotateFlip.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 198fb25d17248b23d084b843baff8b0fcb7d5d6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=198fb25d17248b23d084b843b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jul 12 09:17:56 2012 -0500 gdiplus: Fix memory leak in GdipImageRotateFlip. --- dlls/gdiplus/image.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 233a9eac..9b36280 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1973,6 +1973,7 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) assert(dst->image.type == ImageTypeBitmap); GdipFree(dst->bitmapbits); + GdipFree(dst->own_bits); DeleteDC(dst->hdc); DeleteObject(dst->hbitmap);
1
0
0
0
Vincent Povirk : gdiplus: Fix GdipImageRotateFlip for images from streams.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: 577740f0d79522da15232cf03de38df9e2c7945a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=577740f0d79522da15232cf03…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Jul 12 09:17:09 2012 -0500 gdiplus: Fix GdipImageRotateFlip for images from streams. --- dlls/gdiplus/image.c | 8 ++++++-- dlls/gdiplus/tests/image.c | 11 +++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index db79eca..233a9eac 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1971,8 +1971,6 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) { assert(src->image.type == ImageTypeBitmap); assert(dst->image.type == ImageTypeBitmap); - assert(src->image.stream == NULL); - assert(dst->image.stream == NULL); GdipFree(dst->bitmapbits); DeleteDC(dst->hdc); @@ -2001,6 +1999,12 @@ static void move_bitmap(GpBitmap *dst, GpBitmap *src, BOOL clobber_palette) if (dst->metadata_reader) IWICMetadataReader_Release(dst->metadata_reader); dst->metadata_reader = src->metadata_reader; + if (dst->image.stream) + IStream_Release(dst->image.stream); + dst->image.stream = src->image.stream; + dst->image.frame_count = src->image.frame_count; + dst->image.current_frame = src->image.current_frame; + dst->image.format = src->image.format; src->image.type = ~0; GdipFree(src); diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 29182aa..750b084 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -2345,6 +2345,17 @@ static void test_multiframegif(void) expect(Ok, stat); expect(0xffffffff, color); + /* rotate/flip discards the information about other frames */ + stat = GdipImageRotateFlip((GpImage*)bmp, Rotate90FlipNone); + expect(Ok, stat); + + count = 12345; + stat = GdipImageGetFrameCount((GpImage*)bmp, &dimension, &count); + expect(Ok, stat); + expect(1, count); + + expect_rawformat(&ImageFormatMemoryBMP, (GpImage*)bmp, __LINE__, FALSE); + GdipDisposeImage((GpImage*)bmp); IStream_Release(stream);
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add a test for palette associated with black&white TIFF image.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: c5820b7910b89c993f94001c277d2734f24d9c5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c5820b7910b89c993f94001c2…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 19:13:22 2012 +0900 windowscodecs: Add a test for palette associated with black&white TIFF image. --- dlls/windowscodecs/tests/Makefile.in | 3 +- dlls/windowscodecs/tests/tiffformat.c | 163 +++++++++++++++++++++++++++++++++ dlls/windowscodecs/tiffformat.c | 2 +- 3 files changed, 166 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/tests/Makefile.in b/dlls/windowscodecs/tests/Makefile.in index 048fc29..e70af96 100644 --- a/dlls/windowscodecs/tests/Makefile.in +++ b/dlls/windowscodecs/tests/Makefile.in @@ -8,6 +8,7 @@ C_SRCS = \ info.c \ metadata.c \ palette.c \ - stream.c + stream.c \ + tiffformat.c @MAKE_TEST_RULES@ diff --git a/dlls/windowscodecs/tests/tiffformat.c b/dlls/windowscodecs/tests/tiffformat.c new file mode 100644 index 0000000..fb57b91 --- /dev/null +++ b/dlls/windowscodecs/tests/tiffformat.c @@ -0,0 +1,163 @@ +/* + * 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> + +#define COBJMACROS + +#include "windef.h" +#include "wincodec.h" +#include "wine/test.h" + +#define IFD_BYTE 1 +#define IFD_ASCII 2 +#define IFD_SHORT 3 +#define IFD_LONG 4 +#define IFD_RATIONAL 5 +#define IFD_SBYTE 6 +#define IFD_UNDEFINED 7 +#define IFD_SSHORT 8 +#define IFD_SLONG 9 +#define IFD_SRATIONAL 10 +#define IFD_FLOAT 11 +#define IFD_DOUBLE 12 + +#include "pshpack2.h" +struct IFD_entry +{ + SHORT id; + SHORT type; + ULONG count; + LONG value; +}; + +struct IFD_rational +{ + LONG numerator; + LONG denominator; +}; + +static const struct tiff_1bpp_data +{ + USHORT byte_order; + USHORT version; + ULONG dir_offset; + USHORT number_of_entries; + struct IFD_entry entry[13]; + ULONG next_IFD; + struct IFD_rational res; + BYTE pixel_data[4]; +} tiff_1bpp_data = +{ +#ifdef WORDS_BIGENDIAN + 'M' | 'M' << 8, +#else + 'I' | 'I' << 8, +#endif + 42, + FIELD_OFFSET(struct tiff_1bpp_data, number_of_entries), + 13, + { + { 0xff, IFD_SHORT, 1, 0 }, /* SUBFILETYPE */ + { 0x100, IFD_LONG, 1, 1 }, /* IMAGEWIDTH */ + { 0x101, IFD_LONG, 1, 1 }, /* IMAGELENGTH */ + { 0x102, IFD_SHORT, 1, 1 }, /* BITSPERSAMPLE */ + { 0x103, IFD_SHORT, 1, 1 }, /* COMPRESSION: XP doesn't accept IFD_LONG here */ + { 0x106, IFD_SHORT, 1, 1 }, /* PHOTOMETRIC */ + { 0x111, IFD_LONG, 1, FIELD_OFFSET(struct tiff_1bpp_data, pixel_data) }, /* STRIPOFFSETS */ + { 0x115, IFD_SHORT, 1, 1 }, /* SAMPLESPERPIXEL */ + { 0x116, IFD_LONG, 1, 1 }, /* ROWSPERSTRIP */ + { 0x117, IFD_LONG, 1, 1 }, /* STRIPBYTECOUNT */ + { 0x11a, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_1bpp_data, res) }, + { 0x11b, IFD_RATIONAL, 1, FIELD_OFFSET(struct tiff_1bpp_data, res) }, + { 0x128, IFD_SHORT, 1, 2 }, /* RESOLUTIONUNIT */ + }, + 0, + { 900, 3 }, + { 0x11, 0x22, 0x33, 0 } +}; +#include "poppack.h" + +static IWICBitmapDecoder *create_decoder(IWICImagingFactory *factory, + const void *image_data, UINT image_size) +{ + HGLOBAL hmem; + BYTE *data; + HRESULT hr; + IWICBitmapDecoder *decoder = NULL; + IStream *stream; + GUID guid; + + 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, &guid); + ok(hr == S_OK, "GetContainerFormat error %#x\n", hr); + ok(IsEqualGUID(&guid, &GUID_ContainerFormatTiff), "container format is not TIFF\n"); + + IStream_Release(stream); + + return decoder; +} + +static void test_tiff_palette(void) +{ + HRESULT hr; + IWICImagingFactory *factory; + IWICBitmapDecoder *decoder; + IWICBitmapFrameDecode *frame; + IWICPalette *palette; + + 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; + + decoder = create_decoder(factory, &tiff_1bpp_data, sizeof(tiff_1bpp_data)); + ok(decoder != 0, "Failed to load TIFF image data\n"); + 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); + hr = IWICBitmapFrameDecode_CopyPalette(frame, palette); + ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, + "expected WINCODEC_ERR_PALETTEUNAVAILABLE, got %#x\n", hr); + + IWICPalette_Release(palette); + IWICBitmapFrameDecode_Release(frame); + IWICBitmapDecoder_Release(decoder); + IWICImagingFactory_Release(factory); +} + +START_TEST(tiffformat) +{ + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + + test_tiff_palette(); + + CoUninitialize(); +} diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 232aa44..19aa441 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -878,7 +878,7 @@ static HRESULT WINAPI TiffFrameDecode_CopyPalette(IWICBitmapFrameDecode *iface, if (!ret) { WARN("Couldn't read color map\n"); - return E_FAIL; + return WINCODEC_ERR_PALETTEUNAVAILABLE; } for (i=0; i<color_count; i++)
1
0
0
0
Dmitry Timoshkov : gdiplus: Add a test for palette associated with black&white TIFF image.
by Alexandre Julliard
12 Jul '12
12 Jul '12
Module: wine Branch: master Commit: dfefd3a3b4eb489e2c9ded3e0ac6684b01f75408 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfefd3a3b4eb489e2c9ded3e0…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Jul 12 19:13:15 2012 +0900 gdiplus: Add a test for palette associated with black&white TIFF image. --- dlls/gdiplus/tests/image.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index c001a86..29182aa 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -3295,6 +3295,53 @@ static void test_GdipGetAllPropertyItems(void) GdipDisposeImage(image); } +static void test_tiff_palette(void) +{ + GpStatus status; + GpImage *image; + PixelFormat format; + INT size; + struct + { + ColorPalette pal; + ARGB entry[256]; + } palette; + + /* 1bpp TIFF without palette */ + image = load_image((const BYTE *)&TIFF_data, sizeof(TIFF_data)); + ok(image != 0, "Failed to load TIFF image data\n"); + if (!image) return; + + status = GdipGetImagePixelFormat(image, &format); + expect(Ok, status); +todo_wine + ok(format == PixelFormat1bppIndexed, "expected PixelFormat1bppIndexed, got %#x\n", format); + + status = GdipGetImagePaletteSize(image, &size); + ok(status == Ok || broken(status == GenericError), /* XP */ + "GdipGetImagePaletteSize error %d\n", status); + if (status == GenericError) + { + GdipDisposeImage(image); + return; + } +todo_wine + expect(sizeof(ColorPalette) + sizeof(ARGB), size); + + status = GdipGetImagePalette(image, &palette.pal, size); + expect(Ok, status); + expect(0, palette.pal.Flags); +todo_wine + expect(2, palette.pal.Count); + if (palette.pal.Count == 2) + { + ok(palette.pal.Entries[0] == 0xff000000, "expected 0xff000000, got %#x\n", palette.pal.Entries[0]); + ok(palette.pal.Entries[1] == 0xffffffff, "expected 0xffffffff, got %#x\n", palette.pal.Entries[1]); + } + + GdipDisposeImage(image); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -3307,6 +3354,7 @@ START_TEST(image) GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); + test_tiff_palette(); test_GdipGetAllPropertyItems(); test_tiff_properties(); test_image_properties();
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
72
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
Results per page:
10
25
50
100
200