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
July
June
May
April
March
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
November 2011
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
852 discussions
Start a n
N
ew thread
Nikolay Sivov : msxml3: Properly return node prefix from get_prefix().
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 588f27dae9b90ed7e735f73498face3ea68b9fd7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=588f27dae9b90ed7e735f7349…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Nov 16 00:19:28 2011 +0300 msxml3: Properly return node prefix from get_prefix(). --- dlls/msxml3/entityref.c | 4 +- dlls/msxml3/node.c | 9 +--- dlls/msxml3/tests/domdoc.c | 99 ++++++++++++++++++++++++++++++++------------ 3 files changed, 77 insertions(+), 35 deletions(-) diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index 79b53be..091b3d7 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -531,8 +531,8 @@ static HRESULT WINAPI entityref_get_prefix( BSTR* prefix) { entityref *This = impl_from_IXMLDOMEntityReference( iface ); - TRACE("(%p)->(%p)\n", This, prefix); - return node_get_prefix( &This->node, prefix ); + FIXME("(%p)->(%p): stub\n", This, prefix); + return return_null_bstr( prefix ); } static HRESULT WINAPI entityref_get_baseName( diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 3a104cd..923a0c2 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -1074,17 +1074,14 @@ HRESULT node_get_namespaceURI(xmlnode *This, BSTR *namespaceURI) HRESULT node_get_prefix(xmlnode *This, BSTR *prefix) { - xmlNsPtr *ns; + xmlNsPtr ns = This->node->ns; if (!prefix) return E_INVALIDARG; *prefix = NULL; - if ((ns = xmlGetNsList(This->node->doc, This->node))) - { - if (ns[0]->prefix) *prefix = bstr_from_xmlChar( ns[0]->prefix ); - xmlFree(ns); - } + if (ns && ns->prefix) + *prefix = bstr_from_xmlChar(ns->prefix); TRACE("prefix: %s\n", debugstr_w(*prefix)); diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index eb1270d..bad088f 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -6960,21 +6960,21 @@ static void test_testTransforms(void) free_bstrs(); } -static void test_Namespaces(void) +static void test_namespaces(void) { - static const CHAR szNamespacesXML[] = + static const CHAR namespaces_xmlA[] = "<?xml version=\"1.0\"?>\n" "<XMI xmi.version=\"1.1\" xmlns:Model=\"
http://omg.org/mof.Model/1.3\
">" " <XMI.content>" - " <Model:Package name=\"WinePackage\" />" + " <Model:Package name=\"WinePackage\" Model:name2=\"name2 attr\" />" " </XMI.content>" "</XMI>"; IXMLDOMDocument *doc; IXMLDOMElement *elem; IXMLDOMNode *node; - IXMLDOMNode *pNode2 = NULL; - VARIANT_BOOL bSucc; + + VARIANT_BOOL b; VARIANT var; HRESULT hr; BSTR str; @@ -6982,44 +6982,66 @@ static void test_Namespaces(void) doc = create_document(&IID_IXMLDOMDocument); if (!doc) return; - hr = IXMLDOMDocument_loadXML(doc, _bstr_(szNamespacesXML), &bSucc); - ok(hr == S_OK, "ret %08x\n", hr ); - ok(bSucc == VARIANT_TRUE, "Expected VARIANT_TRUE got VARIANT_FALSE\n"); + hr = IXMLDOMDocument_loadXML(doc, _bstr_(namespaces_xmlA), &b); + EXPECT_HR(hr, S_OK); + ok(b == VARIANT_TRUE, "got %d\n", b); hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("//XMI.content"), &node ); - ok(hr == S_OK, "ret %08x\n", hr ); + EXPECT_HR(hr, S_OK); if(hr == S_OK) { - hr = IXMLDOMNode_get_firstChild( node, &pNode2 ); - ok( hr == S_OK, "ret %08x\n", hr ); - ok( pNode2 != NULL, "pNode2 == NULL\n"); + IXMLDOMAttribute *attr; + IXMLDOMNode *node2; + + hr = IXMLDOMNode_get_firstChild(node, &node2); + EXPECT_HR(hr, S_OK); + ok(node2 != NULL, "got %p\n", node2); /* Test get_prefix */ - hr = IXMLDOMNode_get_prefix(pNode2, NULL); - ok( hr == E_INVALIDARG, "ret %08x\n", hr ); + hr = IXMLDOMNode_get_prefix(node2, NULL); + EXPECT_HR(hr, E_INVALIDARG); /* NOTE: Need to test that arg2 gets cleared on Error. */ - hr = IXMLDOMNode_get_prefix(pNode2, &str); - ok( hr == S_OK, "ret %08x\n", hr ); - ok( !lstrcmpW( str, _bstr_("Model")), "incorrect prefix string\n"); + hr = IXMLDOMNode_get_prefix(node2, &str); + EXPECT_HR(hr, S_OK); + ok( !lstrcmpW( str, _bstr_("Model")), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); - hr = IXMLDOMNode_get_nodeName(pNode2, &str); - ok( hr == S_OK, "ret %08x\n", hr ); - todo_wine ok( !lstrcmpW( str, _bstr_("Model:Package")), "incorrect nodeName string\n"); + hr = IXMLDOMNode_get_nodeName(node2, &str); + EXPECT_HR(hr, S_OK); + todo_wine ok(!lstrcmpW( str, _bstr_("Model:Package")), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); /* Test get_namespaceURI */ - hr = IXMLDOMNode_get_namespaceURI(pNode2, NULL); - ok( hr == E_INVALIDARG, "ret %08x\n", hr ); + hr = IXMLDOMNode_get_namespaceURI(node2, NULL); + EXPECT_HR(hr, E_INVALIDARG); /* NOTE: Need to test that arg2 gets cleared on Error. */ - hr = IXMLDOMNode_get_namespaceURI(pNode2, &str); - ok( hr == S_OK, "ret %08x\n", hr ); - ok( !lstrcmpW( str, _bstr_("
http://omg.org/mof.Model/1.3
")), "incorrect namespaceURI string\n"); + hr = IXMLDOMNode_get_namespaceURI(node2, &str); + EXPECT_HR(hr, S_OK); + ok(!lstrcmpW( str, _bstr_("
http://omg.org/mof.Model/1.3
")), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + hr = IXMLDOMNode_QueryInterface(node2, &IID_IXMLDOMElement, (void**)&elem); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMElement_getAttributeNode(elem, _bstr_("Model:name2"), &attr); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMAttribute_get_nodeName(attr, &str); + EXPECT_HR(hr, S_OK); + todo_wine ok(!lstrcmpW( str, _bstr_("Model:name2")), "got %s\n", wine_dbgstr_w(str)); SysFreeString(str); - IXMLDOMNode_Release(pNode2); + hr = IXMLDOMAttribute_get_prefix(attr, &str); + EXPECT_HR(hr, S_OK); + ok(!lstrcmpW( str, _bstr_("Model")), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + IXMLDOMAttribute_Release(attr); + IXMLDOMElement_Release(elem); + + IXMLDOMNode_Release(node2); IXMLDOMNode_Release(node); } @@ -8579,6 +8601,10 @@ todo_wine { free_bstrs(); } +static const char get_prefix_doc[] = + "<?xml version=\"1.0\" ?>" + "<a xmlns:ns1=\"ns1 href\" />"; + static void test_get_prefix(void) { IXMLDOMDocumentFragment *fragment; @@ -8586,6 +8612,7 @@ static void test_get_prefix(void) IXMLDOMElement *element; IXMLDOMComment *comment; IXMLDOMDocument *doc; + VARIANT_BOOL b; HRESULT hr; BSTR str; @@ -8672,6 +8699,24 @@ static void test_get_prefix(void) IXMLDOMElement_Release(element); + hr = IXMLDOMDocument_loadXML(doc, _bstr_(get_prefix_doc), &b); + EXPECT_HR(hr, S_OK); + + hr = IXMLDOMDocument_get_documentElement(doc, &element); + EXPECT_HR(hr, S_OK); + + str = (void*)0xdeadbeef; + hr = IXMLDOMElement_get_prefix(element, &str); + EXPECT_HR(hr, S_FALSE); + ok(str == NULL, "got %p\n", str); + + str = (void*)0xdeadbeef; + hr = IXMLDOMElement_get_namespaceURI(element, &str); +todo_wine { + EXPECT_HR(hr, S_FALSE); + ok(str == NULL, "got %s\n", wine_dbgstr_w(str)); +} + IXMLDOMDocument_Release(doc); free_bstrs(); } @@ -10741,7 +10786,7 @@ START_TEST(domdoc) test_nodeTypeTests(); test_save(); test_testTransforms(); - test_Namespaces(); + test_namespaces(); test_FormattingXML(); test_nodeTypedValue(); test_TransformWithLoadingLocalFile();
1
0
0
0
Henri Verbeet : wined3d: Pass a wined3d_color struct to wined3d_device_clear().
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: e0a0d611af86e3320dd305c7af0abe14065cd8ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e0a0d611af86e3320dd305c7a…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Nov 15 21:18:28 2011 +0100 wined3d: Pass a wined3d_color struct to wined3d_device_clear(). --- dlls/d3d8/device.c | 15 +++++++++++---- dlls/d3d9/device.c | 16 +++++++++++----- dlls/ddraw/device.c | 21 +++++++++++---------- dlls/wined3d/device.c | 12 ++++++------ dlls/wined3d/swapchain.c | 4 +++- include/wine/wined3d.h | 4 +--- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 1ead518..4ba3bbd 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -1200,17 +1200,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice8Impl_EndScene(IDirect3DD return hr; } -static HRESULT WINAPI IDirect3DDevice8Impl_Clear(IDirect3DDevice8 *iface, DWORD Count, - const D3DRECT *pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) +static HRESULT WINAPI IDirect3DDevice8Impl_Clear(IDirect3DDevice8 *iface, DWORD rect_count, + const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil) { + const struct wined3d_color c = + { + ((color >> 16) & 0xff) / 255.0f, + ((color >> 8) & 0xff) / 255.0f, + (color & 0xff) / 255.0f, + ((color >> 24) & 0xff) / 255.0f, + }; IDirect3DDevice8Impl *This = impl_from_IDirect3DDevice8(iface); HRESULT hr; TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n", - iface, Count, pRects, Flags, Color, Z, Stencil); + iface, rect_count, rects, flags, color, z, stencil); wined3d_mutex_lock(); - hr = wined3d_device_clear(This->wined3d_device, Count, (const RECT *)pRects, Flags, Color, Z, Stencil); + hr = wined3d_device_clear(This->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil); wined3d_mutex_unlock(); return hr; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4e8eee1..9dea7fb 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1218,18 +1218,24 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH IDirect3DDevice9Impl_EndScene(IDirect3DD return hr; } -static HRESULT WINAPI IDirect3DDevice9Impl_Clear(IDirect3DDevice9Ex *iface, DWORD Count, - const D3DRECT *pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) +static HRESULT WINAPI IDirect3DDevice9Impl_Clear(IDirect3DDevice9Ex *iface, DWORD rect_count, + const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil) { + const struct wined3d_color c = + { + ((color >> 16) & 0xff) / 255.0f, + ((color >> 8) & 0xff) / 255.0f, + (color & 0xff) / 255.0f, + ((color >> 24) & 0xff) / 255.0f, + }; IDirect3DDevice9Impl *This = impl_from_IDirect3DDevice9Ex(iface); HRESULT hr; TRACE("iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n", - iface, Count, pRects, Flags, Color, Z, Stencil); + iface, rect_count, rects, flags, color, z, stencil); - /* Note: D3DRECT is compatible with WINED3DRECT */ wined3d_mutex_lock(); - hr = wined3d_device_clear(This->wined3d_device, Count, (const RECT *)pRects, Flags, Color, Z, Stencil); + hr = wined3d_device_clear(This->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil); wined3d_mutex_unlock(); return hr; diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 2c4de3b..ecff7fa 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5065,23 +5065,24 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_ValidateDevice(IDirect3DDevice3 *ifa * For details, see IWineD3DDevice::Clear * *****************************************************************************/ -static HRESULT -IDirect3DDeviceImpl_7_Clear(IDirect3DDevice7 *iface, - DWORD Count, - D3DRECT *Rects, - DWORD Flags, - D3DCOLOR Color, - D3DVALUE Z, - DWORD Stencil) +static HRESULT IDirect3DDeviceImpl_7_Clear(IDirect3DDevice7 *iface, DWORD count, + D3DRECT *rects, DWORD flags, D3DCOLOR color, D3DVALUE z, DWORD stencil) { + const struct wined3d_color c = + { + ((color >> 16) & 0xff) / 255.0f, + ((color >> 8) & 0xff) / 255.0f, + (color & 0xff) / 255.0f, + ((color >> 24) & 0xff) / 255.0f, + }; IDirect3DDeviceImpl *This = impl_from_IDirect3DDevice7(iface); HRESULT hr; TRACE("iface %p, count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %#x.\n", - iface, Count, Rects, Flags, Color, Z, Stencil); + iface, count, rects, flags, color, z, stencil); wined3d_mutex_lock(); - hr = wined3d_device_clear(This->wined3d_device, Count, (RECT *)Rects, Flags, Color, Z, Stencil); + hr = wined3d_device_clear(This->wined3d_device, count, (RECT *)rects, flags, &c, z, stencil); wined3d_mutex_unlock(); return hr; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index fb51b39..177f41a 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1199,6 +1199,7 @@ void CDECL wined3d_device_release_focus_window(struct wined3d_device *device) HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, WINED3DPRESENT_PARAMETERS *present_parameters) { + static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f}; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct wined3d_swapchain *swapchain = NULL; struct wined3d_context *context; @@ -1345,7 +1346,7 @@ HRESULT CDECL wined3d_device_init_3d(struct wined3d_device *device, /* Clear the screen */ wined3d_device_clear(device, 0, NULL, WINED3DCLEAR_TARGET | (present_parameters->EnableAutoDepthStencil ? WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL : 0), - 0x00, 1.0f, 0); + &black, 1.0f, 0); device->d3d_initialized = TRUE; @@ -4025,13 +4026,12 @@ HRESULT CDECL wined3d_device_present(const struct wined3d_device *device, const /* Do not call while under the GL lock. */ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, - const RECT *rects, DWORD flags, WINED3DCOLOR color, float depth, DWORD stencil) + const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) { - const struct wined3d_color c = {D3DCOLOR_R(color), D3DCOLOR_G(color), D3DCOLOR_B(color), D3DCOLOR_A(color)}; RECT draw_rect; - TRACE("device %p, rect_count %u, rects %p, flags %#x, color 0x%08x, depth %.8e, stencil %u.\n", - device, rect_count, rects, flags, color, depth, stencil); + TRACE("device %p, rect_count %u, rects %p, flags %#x, color {%.8e, %.8e, %.8e, %.8e}, depth %.8e, stencil %u.\n", + device, rect_count, rects, flags, color->r, color->g, color->b, color->a, depth, stencil); if (flags & (WINED3DCLEAR_ZBUFFER | WINED3DCLEAR_STENCIL)) { @@ -4057,7 +4057,7 @@ HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, DWORD rect_cou return device_clear_render_targets(device, device->adapter->gl_info.limits.buffers, &device->fb, rect_count, rects, - &draw_rect, flags, &c, depth, stencil); + &draw_rect, flags, color, depth, stencil); } void CDECL wined3d_device_set_primitive_type(struct wined3d_device *device, diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index d04d9c1..321d8ea 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -591,10 +591,12 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R * (The Max Payne bug has been confirmed on Windows with the debug runtime) */ if (FALSE && swapchain->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD) { + static const struct wined3d_color cyan = {0.0f, 1.0f, 1.0f, 1.0f}; + TRACE("Clearing the color buffer with cyan color\n"); wined3d_device_clear(swapchain->device, 0, NULL, - WINED3DCLEAR_TARGET, 0xff00ffff, 1.0f, 0); + WINED3DCLEAR_TARGET, &cyan, 1.0f, 0); } if (!swapchain->render_to_fbo && ((swapchain->front_buffer->flags & SFLAG_INSYSMEM) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index c1dbaa3..4224c6c 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -65,8 +65,6 @@ #define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205) #define WINEDDERR_OVERLAYNOTVISIBLE MAKE_WINED3DHRESULT(577) -typedef DWORD WINED3DCOLOR; - typedef enum _WINED3DLIGHTTYPE { WINED3DLIGHT_POINT = 1, @@ -2168,7 +2166,7 @@ HRESULT __cdecl wined3d_device_acquire_focus_window(struct wined3d_device *devic HRESULT __cdecl wined3d_device_begin_scene(struct wined3d_device *device); HRESULT __cdecl wined3d_device_begin_stateblock(struct wined3d_device *device); HRESULT __cdecl wined3d_device_clear(struct wined3d_device *device, DWORD rect_count, const RECT *rects, DWORD flags, - WINED3DCOLOR color, float z, DWORD stencil); + const struct wined3d_color *color, float z, DWORD stencil); void __cdecl wined3d_device_clear_rendertarget_view(struct wined3d_device *device, struct wined3d_rendertarget_view *rendertarget_view, const struct wined3d_color *color); HRESULT __cdecl wined3d_device_color_fill(struct wined3d_device *device, struct wined3d_surface *surface,
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DCOLORVALUE typedef.
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 7459180a51135fb4194a8524f7c70f2e513e5485 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7459180a51135fb4194a8524f…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Nov 15 21:18:27 2011 +0100 wined3d: Get rid of the WINED3DCOLORVALUE typedef. --- dlls/d3d10core/device.c | 2 +- dlls/d3d9/device.c | 2 +- dlls/wined3d/arb_program_shader.c | 2 +- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/surface.c | 10 +++++----- dlls/wined3d/utils.c | 2 +- dlls/wined3d/wined3d_private.h | 9 +++++---- include/wine/wined3d.h | 22 +++++++++++----------- 8 files changed, 30 insertions(+), 29 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=7459180a51135fb4194a8…
1
0
0
0
Henri Verbeet : d3d10: Implement D3D10StateBlockMaskEnableAll().
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: be7122034fa1d9a0e58fce9f468ec97b14f28c13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=be7122034fa1d9a0e58fce9f4…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Nov 15 21:18:26 2011 +0100 d3d10: Implement D3D10StateBlockMaskEnableAll(). --- dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/stateblock.c | 12 ++++++++++++ dlls/d3d10/tests/device.c | 8 ++++++++ include/d3d10effect.h | 1 + 4 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index 49733de..865ded5 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -22,7 +22,7 @@ @ stdcall D3D10StateBlockMaskDifference(ptr ptr ptr) @ stdcall D3D10StateBlockMaskDisableAll(ptr) @ stdcall D3D10StateBlockMaskDisableCapture(ptr long long long) -@ stub D3D10StateBlockMaskEnableAll +@ stdcall D3D10StateBlockMaskEnableAll(ptr) @ stub D3D10StateBlockMaskEnableCapture @ stub D3D10StateBlockMaskGetSetting @ stub D3D10StateBlockMaskIntersect diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c index bf3d64c..7fd2aa2 100644 --- a/dlls/d3d10/stateblock.c +++ b/dlls/d3d10/stateblock.c @@ -284,3 +284,15 @@ HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *mask, return E_INVALIDARG; } } + +HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *mask) +{ + TRACE("mask %p.\n", mask); + + if (!mask) + return E_INVALIDARG; + + memset(mask, 0xff, sizeof(*mask)); + + return S_OK; +} diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index c29f65b..894fd1d 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -123,6 +123,14 @@ static void test_stateblock_mask(void) hr = D3D10StateBlockMaskDisableAll(NULL); ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); + memset(&result, 0, sizeof(result)); + hr = D3D10StateBlockMaskEnableAll(&result); + ok(SUCCEEDED(hr), "D3D10StateBlockMaskEnableAll failed, hr %#x.\n", hr); + ok(result.VS == 0xff, "Got unexpected result.VS %#x.\n", result.VS); + ok(result.Predication == 0xff, "Got unexpected result.Predication %#x.\n", result.Predication); + hr = D3D10StateBlockMaskEnableAll(NULL); + ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); + result.VS = 0xff; hr = D3D10StateBlockMaskDisableCapture(&result, D3D10_DST_VS, 0, 1); ok(SUCCEEDED(hr), "D3D10StateBlockMaskDisableCapture failed, hr %#x.\n", hr); diff --git a/include/d3d10effect.h b/include/d3d10effect.h index b195dff..697d1c4 100644 --- a/include/d3d10effect.h +++ b/include/d3d10effect.h @@ -837,6 +837,7 @@ HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x, HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *mask); HRESULT WINAPI D3D10StateBlockMaskDisableCapture(D3D10_STATE_BLOCK_MASK *mask, D3D10_DEVICE_STATE_TYPES state_type, UINT start_idx, UINT count); +HRESULT WINAPI D3D10StateBlockMaskEnableAll(D3D10_STATE_BLOCK_MASK *mask); #ifdef __cplusplus }
1
0
0
0
Henri Verbeet : d3d10: Implement D3D10StateBlockMaskDisableCapture().
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 5ffa2aba23fc67160c81e2f51fc276d072d303a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5ffa2aba23fc67160c81e2f51…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Nov 14 20:45:25 2011 +0100 d3d10: Implement D3D10StateBlockMaskDisableCapture(). --- dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/d3d10_private.h | 1 + dlls/d3d10/stateblock.c | 106 ++++++++++++++++++++++++++++++++++++++++++++ dlls/d3d10/tests/device.c | 50 +++++++++++++++++++++ dlls/d3d10/utils.c | 34 ++++++++++++++ include/d3d10effect.h | 30 ++++++++++++ 6 files changed, 222 insertions(+), 1 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=5ffa2aba23fc67160c81e…
1
0
0
0
Henri Verbeet : d3d10: Implement D3D10StateBlockMaskDisableAll().
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 88a55a04a3cd149f6fa3e4402c236c590c4c1836 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=88a55a04a3cd149f6fa3e4402…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Tue Nov 15 21:18:24 2011 +0100 d3d10: Implement D3D10StateBlockMaskDisableAll(). --- dlls/d3d10/d3d10.spec | 2 +- dlls/d3d10/stateblock.c | 12 ++++++++++++ dlls/d3d10/tests/device.c | 8 ++++++++ include/d3d10effect.h | 1 + 4 files changed, 22 insertions(+), 1 deletions(-) diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index baa0c10..1a09f4a 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -20,7 +20,7 @@ @ stdcall D3D10ReflectShader(ptr long ptr) @ stub D3D10RegisterLayers @ stdcall D3D10StateBlockMaskDifference(ptr ptr ptr) -@ stub D3D10StateBlockMaskDisableAll +@ stdcall D3D10StateBlockMaskDisableAll(ptr) @ stub D3D10StateBlockMaskDisableCapture @ stub D3D10StateBlockMaskEnableAll @ stub D3D10StateBlockMaskEnableCapture diff --git a/dlls/d3d10/stateblock.c b/dlls/d3d10/stateblock.c index f121a5c..76a27f9 100644 --- a/dlls/d3d10/stateblock.c +++ b/dlls/d3d10/stateblock.c @@ -166,3 +166,15 @@ HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x, return S_OK; } + +HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *mask) +{ + TRACE("mask %p.\n", mask); + + if (!mask) + return E_INVALIDARG; + + memset(mask, 0, sizeof(*mask)); + + return S_OK; +} diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index 1fc3a3b..2197002 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -88,6 +88,14 @@ static void test_stateblock_mask(void) ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); hr = D3D10StateBlockMaskDifference(&mask_x, &mask_y, NULL); ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); + + memset(&result, 0xff, sizeof(result)); + hr = D3D10StateBlockMaskDisableAll(&result); + ok(SUCCEEDED(hr), "D3D10StateBlockMaskDisableAll failed, hr %#x.\n", hr); + ok(!result.VS, "Got unexpected result.VS %#x.\n", result.VS); + ok(!result.Predication, "Got unexpected result.Predication %#x.\n", result.Predication); + hr = D3D10StateBlockMaskDisableAll(NULL); + ok(hr == E_INVALIDARG, "Got unexpect hr %#x.\n", hr); } START_TEST(device) diff --git a/include/d3d10effect.h b/include/d3d10effect.h index d36c3da..e293d3b 100644 --- a/include/d3d10effect.h +++ b/include/d3d10effect.h @@ -806,6 +806,7 @@ HRESULT WINAPI D3D10CreateStateBlock(ID3D10Device *device, HRESULT WINAPI D3D10StateBlockMaskDifference(D3D10_STATE_BLOCK_MASK *mask_x, D3D10_STATE_BLOCK_MASK *mask_y, D3D10_STATE_BLOCK_MASK *result); +HRESULT WINAPI D3D10StateBlockMaskDisableAll(D3D10_STATE_BLOCK_MASK *mask); #ifdef __cplusplus }
1
0
0
0
Alexandre Julliard : comctl32: Setup the alpha channel also when reading an imagelist from a stream.
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 73b9dc98eb9ab371f92d8c0a054c71f3d9b194ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=73b9dc98eb9ab371f92d8c0a0…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 15 22:11:15 2011 +0100 comctl32: Setup the alpha channel also when reading an imagelist from a stream. --- dlls/comctl32/imagelist.c | 83 +++++++++++++++++++++++++++++++------------- 1 files changed, 58 insertions(+), 25 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 9d2b6f9..c32cb0b 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -2090,26 +2090,23 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, /* helper for ImageList_Read, see comments below */ -static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm) +static void *read_bitmap(LPSTREAM pstm, BITMAPINFO *bmi) { BITMAPFILEHEADER bmfh; int bitsperpixel, palspace; - char bmi_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; - LPBITMAPINFO bmi = (LPBITMAPINFO)bmi_buf; - int result = FALSE; - LPBYTE bits = NULL; + void *bits; if (FAILED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL))) - return FALSE; + return NULL; if (bmfh.bfType != (('M'<<8)|'B')) - return FALSE; + return NULL; if (FAILED(IStream_Read ( pstm, &bmi->bmiHeader, sizeof(bmi->bmiHeader), NULL))) - return FALSE; + return NULL; if ((bmi->bmiHeader.biSize != sizeof(bmi->bmiHeader))) - return FALSE; + return NULL; TRACE("width %u, height %u, planes %u, bpp %u\n", bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, @@ -2125,23 +2122,17 @@ static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm) /* read the palette right after the end of the bitmapinfoheader */ if (palspace && FAILED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL))) - goto error; + return NULL; bits = Alloc(bmi->bmiHeader.biSizeImage); - if (!bits) - goto error; - if (FAILED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL))) - goto error; - - if (!StretchDIBits(hdcIml, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, - 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, - bits, bmi, DIB_RGB_COLORS, SRCCOPY)) - goto error; - result = TRUE; + if (!bits) return NULL; -error: - Free(bits); - return result; + if (FAILED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL))) + { + Free(bits); + return NULL; + } + return bits; } /************************************************************************* @@ -2177,6 +2168,11 @@ error: */ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) { + char image_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; + char mask_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256]; + BITMAPINFO *image_info = (BITMAPINFO *)image_buf; + BITMAPINFO *mask_info = (BITMAPINFO *)mask_buf; + void *image_bits, *mask_bits = NULL; ILHEAD ilHead; HIMAGELIST himl; int i; @@ -2197,19 +2193,56 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm) if (!himl) return NULL; - if (!_read_bitmap(himl->hdcImage, pstm)) + if (!(image_bits = read_bitmap(pstm, image_info))) { WARN("failed to read bitmap from stream\n"); return NULL; } if (ilHead.flags & ILC_MASK) { - if (!_read_bitmap(himl->hdcMask, pstm)) + if (!(mask_bits = read_bitmap(pstm, mask_info))) { WARN("failed to read mask bitmap from stream\n"); return NULL; } } + else mask_info = NULL; + + if (himl->has_alpha && image_info->bmiHeader.biBitCount == 32) + { + DWORD *ptr = image_bits; + BYTE *mask_ptr = mask_bits; + int stride = himl->cy * image_info->bmiHeader.biWidth; + + if (image_info->bmiHeader.biHeight > 0) /* bottom-up */ + { + ptr += (imagelist_height( ilHead.cCurImage ) - 1) * stride; + mask_ptr += (imagelist_height( ilHead.cCurImage ) - 1) * stride / 8; + stride = -stride; + image_info->bmiHeader.biHeight = himl->cy; + } + else image_info->bmiHeader.biHeight = -himl->cy; + + for (i = 0; i < ilHead.cCurImage; i += TILE_COUNT) + { + add_dib_bits( himl, i, min( ilHead.cCurImage - i, TILE_COUNT ), + himl->cx, himl->cy, image_info, mask_info, ptr, mask_ptr ); + ptr += stride; + mask_ptr += stride / 8; + } + } + else + { + StretchDIBits( himl->hdcImage, 0, 0, image_info->bmiHeader.biWidth, image_info->bmiHeader.biHeight, + 0, 0, image_info->bmiHeader.biWidth, image_info->bmiHeader.biHeight, + image_bits, image_info, DIB_RGB_COLORS, SRCCOPY); + if (mask_info) + StretchDIBits( himl->hdcMask, 0, 0, mask_info->bmiHeader.biWidth, mask_info->bmiHeader.biHeight, + 0, 0, mask_info->bmiHeader.biWidth, mask_info->bmiHeader.biHeight, + mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY); + } + Free( image_bits ); + Free( mask_bits ); himl->cCurImage = ilHead.cCurImage; himl->cMaxImage = ilHead.cMaxImage;
1
0
0
0
Alexandre Julliard : comctl32: Add a couple of DIB helper functions for imagelists.
by Alexandre Julliard
16 Nov '11
16 Nov '11
Module: wine Branch: master Commit: 4c785235d024883e9c97cef060a0ed808665306f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c785235d024883e9c97cef06…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Nov 15 22:10:45 2011 +0100 comctl32: Add a couple of DIB helper functions for imagelists. --- dlls/comctl32/imagelist.c | 119 ++++++++++++++++++++++++--------------------- 1 files changed, 64 insertions(+), 55 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index accbf58..9d2b6f9 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -114,6 +114,17 @@ static inline void imagelist_get_bitmap_size( HIMAGELIST himl, UINT count, SIZE sz->cy = imagelist_height( count ) * himl->cy; } +static inline int get_dib_stride( int width, int bpp ) +{ + return ((width * bpp + 31) >> 3) & ~3; +} + +static inline int get_dib_image_size( const BITMAPINFO *info ) +{ + return get_dib_stride( info->bmiHeader.biWidth, info->bmiHeader.biBitCount ) + * abs( info->bmiHeader.biHeight ); +} + /* * imagelist_copy_images() * @@ -139,6 +150,56 @@ static inline void imagelist_copy_images( HIMAGELIST himl, HDC hdcSrc, HDC hdcDe } } +static void add_dib_bits( HIMAGELIST himl, int pos, int count, int width, int height, + BITMAPINFO *info, BITMAPINFO *mask_info, DWORD *bits, BYTE *mask_bits ) +{ + int i, j, n; + POINT pt; + int stride = info->bmiHeader.biWidth; + int mask_stride = (info->bmiHeader.biWidth + 31) / 32 * 4; + + for (n = 0; n < count; n++) + { + int has_alpha = 0; + + imagelist_point_from_index( himl, pos + n, &pt ); + + /* check if bitmap has an alpha channel */ + for (i = 0; i < height && !has_alpha; i++) + for (j = n * width; j < (n + 1) * width; j++) + if ((has_alpha = ((bits[i * stride + j] & 0xff000000) != 0))) break; + + if (!has_alpha) /* generate alpha channel from the mask */ + { + for (i = 0; i < height; i++) + for (j = n * width; j < (n + 1) * width; j++) + if (!mask_info || !((mask_bits[i * mask_stride + j / 8] << (j % 8)) & 0x80)) + bits[i * stride + j] |= 0xff000000; + else + bits[i * stride + j] = 0; + } + else + { + himl->has_alpha[pos + n] = 1; + + if (mask_info && himl->hbmMask) /* generate the mask from the alpha channel */ + { + for (i = 0; i < height; i++) + for (j = n * width; j < (n + 1) * width; j++) + if ((bits[i * stride + j] >> 24) > 25) /* more than 10% alpha */ + mask_bits[i * mask_stride + j / 8] &= ~(0x80 >> (j % 8)); + else + mask_bits[i * mask_stride + j / 8] |= 0x80 >> (j % 8); + } + } + StretchDIBits( himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, + n * width, 0, width, height, bits, info, DIB_RGB_COLORS, SRCCOPY ); + if (mask_info) + StretchDIBits( himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, + n * width, 0, width, height, mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY ); + } +} + /* add images with an alpha channel when the image list is 32 bpp */ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count, int width, int height, HBITMAP hbmImage, HBITMAP hbmMask ) @@ -148,8 +209,6 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count, BITMAPINFO *info, *mask_info = NULL; DWORD *bits = NULL; BYTE *mask_bits = NULL; - int i, j, n; - POINT pt; DWORD mask_width; if (!GetObjectW( hbmImage, sizeof(bm), &bm )) return FALSE; @@ -188,46 +247,7 @@ static BOOL add_with_alpha( HIMAGELIST himl, HDC hdc, int pos, int count, if (!GetDIBits( hdc, hbmMask, 0, height, mask_bits, mask_info, DIB_RGB_COLORS )) goto done; } - for (n = 0; n < count; n++) - { - int has_alpha = 0; - - imagelist_point_from_index( himl, pos + n, &pt ); - - /* check if bitmap has an alpha channel */ - for (i = 0; i < height && !has_alpha; i++) - for (j = n * width; j < (n + 1) * width; j++) - if ((has_alpha = ((bits[i * bm.bmWidth + j] & 0xff000000) != 0))) break; - - if (!has_alpha) /* generate alpha channel from the mask */ - { - for (i = 0; i < height; i++) - for (j = n * width; j < (n + 1) * width; j++) - if (!mask_bits || !((mask_bits[i * mask_width + j / 8] << (j % 8)) & 0x80)) - bits[i * bm.bmWidth + j] |= 0xff000000; - else - bits[i * bm.bmWidth + j] = 0; - } - else - { - himl->has_alpha[pos + n] = 1; - - if (mask_info && himl->hbmMask) /* generate the mask from the alpha channel */ - { - for (i = 0; i < height; i++) - for (j = n * width; j < (n + 1) * width; j++) - if ((bits[i * bm.bmWidth + j] >> 24) > 25) /* more than 10% alpha */ - mask_bits[i * mask_width + j / 8] &= ~(0x80 >> (j % 8)); - else - mask_bits[i * mask_width + j / 8] |= 0x80 >> (j % 8); - } - } - StretchDIBits( himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, - n * width, 0, width, height, bits, info, DIB_RGB_COLORS, SRCCOPY ); - if (mask_info) - StretchDIBits( himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, - n * width, 0, width, height, mask_bits, mask_info, DIB_RGB_COLORS, SRCCOPY ); - } + add_dib_bits( himl, pos, count, width, height, info, mask_info, bits, mask_bits ); ret = TRUE; done: @@ -2069,17 +2089,6 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, } -/*********************************************************************** - * DIB_GetDIBImageBytes - * - * Return the number of bytes used to hold the image in a DIB bitmap. - */ -static int DIB_GetDIBImageBytes( int width, int height, int depth ) -{ - return (((width * depth + 31) / 8) & ~3) * abs( height ); -} - - /* helper for ImageList_Read, see comments below */ static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm) { @@ -2112,7 +2121,7 @@ static BOOL _read_bitmap(HDC hdcIml, LPSTREAM pstm) else palspace = 0; - bmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bitsperpixel); + bmi->bmiHeader.biSizeImage = get_dib_image_size( bmi ); /* read the palette right after the end of the bitmapinfoheader */ if (palspace && FAILED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL))) @@ -2902,7 +2911,7 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm) return FALSE; bitCount = bm.bmBitsPixel == 1 ? 1 : 24; - sizeImage = DIB_GetDIBImageBytes(bm.bmWidth, bm.bmHeight, bitCount); + sizeImage = get_dib_stride(bm.bmWidth, bitCount) * bm.bmHeight; totalSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER); if(bitCount != 24)
1
0
0
0
Jacek Caban : mshtml: Fixed script tests on IE9.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: e7bbb4ef1e95396b72a58f813b4346d9abccb699 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7bbb4ef1e95396b72a58f813…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Nov 15 19:58:27 2011 +0100 mshtml: Fixed script tests on IE9. --- dlls/mshtml/tests/script.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c index 5cac14a..d1a4d4a 100644 --- a/dlls/mshtml/tests/script.c +++ b/dlls/mshtml/tests/script.c @@ -2115,7 +2115,6 @@ static HRESULT WINAPI ActiveScriptParse_ParseScriptText(IActiveScriptParse *ifac LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLine, DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo) { - ok(!punkContext, "punkContext = %p\n", punkContext); ok(pvarResult != NULL, "pvarResult == NULL\n"); ok(pexcepinfo != NULL, "pexcepinfo == NULL\n"); @@ -2185,7 +2184,7 @@ static HRESULT WINAPI ActiveScript_QueryInterface(IActiveScript *iface, REFIID r if(IsEqualGUID(&IID_IActiveScriptDebug, riid)) return E_NOINTERFACE; - ok(0, "unexpected riid %s\n", debugstr_guid(riid)); + trace("QI(%s)\n", debugstr_guid(riid)); return E_NOINTERFACE; }
1
0
0
0
Jacek Caban : urlmon: Fixed protocol tests on IE9.
by Alexandre Julliard
15 Nov '11
15 Nov '11
Module: wine Branch: master Commit: 9c464ca3cbff96e0f4339c2cb4ae2678c1f0b6b2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9c464ca3cbff96e0f4339c2cb…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Nov 15 19:20:54 2011 +0100 urlmon: Fixed protocol tests on IE9. --- dlls/urlmon/bindprot.c | 1 + dlls/urlmon/tests/protocol.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dlls/urlmon/bindprot.c b/dlls/urlmon/bindprot.c index cfb5cec..7c2aca6 100644 --- a/dlls/urlmon/bindprot.c +++ b/dlls/urlmon/bindprot.c @@ -203,6 +203,7 @@ static HRESULT handle_mime_filter(BindProtocol *This, IInternetProtocol *mime_fi return hres; } + /* NOTE: IE9 calls it on the new protocol_sink. It doesn't make sense to is seems to be a bug there. */ IInternetProtocolSink_ReportProgress(old_sink, BINDSTATUS_LOADINGMIMEHANDLER, NULL); IInternetProtocolSink_Release(old_sink); diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c index 52da99b..87be3fe 100644 --- a/dlls/urlmon/tests/protocol.c +++ b/dlls/urlmon/tests/protocol.c @@ -112,7 +112,6 @@ DEFINE_EXPECT(UnlockRequest); DEFINE_EXPECT(Abort); DEFINE_EXPECT(MimeFilter_CreateInstance); DEFINE_EXPECT(MimeFilter_Start); -DEFINE_EXPECT(MimeFilter_ReportProgress); DEFINE_EXPECT(MimeFilter_ReportData); DEFINE_EXPECT(MimeFilter_ReportResult); DEFINE_EXPECT(MimeFilter_Terminate); @@ -1043,7 +1042,20 @@ static HRESULT WINAPI MimeProtocolSink_Switch(IInternetProtocolSink *iface, PROT static HRESULT WINAPI MimeProtocolSink_ReportProgress(IInternetProtocolSink *iface, ULONG ulStatusCode, LPCWSTR szStatusText) { - CHECK_EXPECT(MimeFilter_ReportProgress); + switch(ulStatusCode) { + case BINDSTATUS_LOADINGMIMEHANDLER: + /* + * IE9 for some reason (bug?) calls this on mime handler's protocol sink instead of the + * main protocol sink. We check ReportProgress_LOADINGMIMEHANDLER both here and in + * ProtocolSink_ReportProgress to workaround it. + */ + CHECK_EXPECT(ReportProgress_LOADINGMIMEHANDLER); + ok(!szStatusText, "szStatusText = %s\n", wine_dbgstr_w(szStatusText)); + break; + default: + ok(0, "Unexpected status code %d\n", ulStatusCode); + } + return S_OK; } @@ -1742,6 +1754,7 @@ static HRESULT WINAPI ProtocolEmul_Continue(IInternetProtocolEx *iface, if(pr == 200) { if(!mimefilter_test) SET_EXPECT(Read); /* checked in BINDSTATUS_MIMETYPEAVAILABLE or ReportData */ + SET_EXPECT(GetBindInfo); SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); } if(pr >= 200) @@ -1759,6 +1772,7 @@ static HRESULT WINAPI ProtocolEmul_Continue(IInternetProtocolEx *iface, if(!short_read && pr < 200) CHECK_CALLED(Read); if(pr == 200) { + CLEAR_CALLED(GetBindInfo); /* IE9 */ CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); } }else { @@ -1816,6 +1830,7 @@ static HRESULT WINAPI ProtocolEmul_Read(IInternetProtocolEx *iface, void *pv, prot_state = 4; if(short_read) { SET_EXPECT(Read2); /* checked in BINDSTATUS_MIMETYPEAVAILABLE */ + SET_EXPECT(GetBindInfo); SET_EXPECT(ReportProgress_MIMETYPEAVAILABLE); } if(mimefilter_test) @@ -1827,8 +1842,10 @@ static HRESULT WINAPI ProtocolEmul_Read(IInternetProtocolEx *iface, void *pv, BSCF_LASTDATANOTIFICATION|BSCF_INTERMEDIATEDATANOTIFICATION, 0, 0); read_report_data--; ok(hres == S_OK, "ReportData failed: %08x\n", hres); - if(short_read) + if(short_read) { + CLEAR_CALLED(GetBindInfo); /* IE9 */ CHECK_CALLED(ReportProgress_MIMETYPEAVAILABLE); + } if(mimefilter_test) CHECK_CALLED(MimeFilter_ReportData); else if(direct_read)
1
0
0
0
← Newer
1
...
41
42
43
44
45
46
47
...
86
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
Results per page:
10
25
50
100
200