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
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
September 2009
----- 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
3 participants
866 discussions
Start a n
N
ew thread
Aurimas Fišeras : jscript: Update Lithuanian translation.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 26ae9a64448f327ff61fc7950f6302df40943e79 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=26ae9a64448f327ff61fc7950…
Author: Aurimas Fišeras <aurimas(a)gmail.com> Date: Wed Sep 23 22:51:38 2009 +0300 jscript: Update Lithuanian translation. --- dlls/jscript/jscript_Lt.rc | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/jscript_Lt.rc b/dlls/jscript/jscript_Lt.rc index c49aec0..bb09228 100644 --- a/dlls/jscript/jscript_Lt.rc +++ b/dlls/jscript/jscript_Lt.rc @@ -41,5 +41,7 @@ STRINGTABLE DISCARDABLE IDS_ILLEGAL_ASSIGN "Neleistinas priskyrimas" IDS_UNDEFINED "„|“ yra neapibrėžtas" IDS_NOT_BOOL "Tikėtasi loginio objekto" + IDS_JSCRIPT_EXPECTED "Tikėtasi JScript objekto" + IDS_REGEXP_SYNTAX_ERROR "Sintaksės klaida reguliariajame reiškinyje" IDS_INVALID_LENGTH "Masyvo dydis turi būti teigiamas sveikasis skaičius" }
1
0
0
0
André Hentschel : winegcc: Add ARM support.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: e0dac25ba3f9e6eead8102a4f8f8525912e57448 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e0dac25ba3f9e6eead8102a4f…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Sep 23 20:15:26 2009 +0200 winegcc: Add ARM support. --- tools/winegcc/utils.h | 2 +- tools/winegcc/winegcc.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h index 08c9a0f..35afedd 100644 --- a/tools/winegcc/utils.h +++ b/tools/winegcc/utils.h @@ -33,7 +33,7 @@ enum target_cpu { - CPU_x86, CPU_x86_64, CPU_SPARC, CPU_ALPHA, CPU_POWERPC + CPU_x86, CPU_x86_64, CPU_SPARC, CPU_ALPHA, CPU_POWERPC, CPU_ARM }; enum target_platform diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index ad4aeb7..f81b7ea 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -159,7 +159,8 @@ static const struct { "x86_64", CPU_x86_64 }, { "sparc", CPU_SPARC }, { "alpha", CPU_ALPHA }, - { "powerpc", CPU_POWERPC } + { "powerpc", CPU_POWERPC }, + { "arm", CPU_ARM } }; static const struct @@ -216,6 +217,8 @@ static const enum target_cpu build_cpu = CPU_SPARC; static const enum target_cpu build_cpu = CPU_ALPHA; #elif defined(__powerpc__) static const enum target_cpu build_cpu = CPU_POWERPC; +#elif defined(__arm__) +static const enum target_cpu build_cpu = CPU_ARM; #else #error Unsupported CPU #endif
1
0
0
0
Alexandre Julliard : sti: StiCreateInstance doesn' t need its own implementation.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: cce3163c695120b2b847075a16fb1ab3f3c8d0f5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cce3163c695120b2b847075a1…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Sep 24 13:29:58 2009 +0200 sti: StiCreateInstance doesn't need its own implementation. --- dlls/sti/sti.spec | 2 +- dlls/sti/sti_main.c | 8 -------- 2 files changed, 1 insertions(+), 9 deletions(-) diff --git a/dlls/sti/sti.spec b/dlls/sti/sti.spec index 189af52..300e7fa 100644 --- a/dlls/sti/sti.spec +++ b/dlls/sti/sti.spec @@ -2,6 +2,6 @@ @ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() -@ stdcall StiCreateInstance(ptr long ptr ptr) +@ stdcall StiCreateInstance(ptr long ptr ptr) StiCreateInstanceW @ stdcall StiCreateInstanceA(ptr long ptr ptr) @ stdcall StiCreateInstanceW(ptr long ptr ptr) diff --git a/dlls/sti/sti_main.c b/dlls/sti/sti_main.c index c53d6bb..eed33bd 100644 --- a/dlls/sti/sti_main.c +++ b/dlls/sti/sti_main.c @@ -173,14 +173,6 @@ HRESULT WINAPI DllCanUnloadNow( void ) } /****************************************************************************** - * StiCreateInstance (STI.@) - */ -HRESULT WINAPI StiCreateInstance( HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter ) -{ - return STG_E_UNIMPLEMENTEDFUNCTION; -} - -/****************************************************************************** * StiCreateInstanceA (STI.@) */ HRESULT WINAPI StiCreateInstanceA( HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter )
1
0
0
0
Damjan Jovanovic : sti: Add sti class factory.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 2a28839ed8213ce3c3d4307372e3c98ff1c8d118 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2a28839ed8213ce3c3d430737…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed Sep 23 18:54:50 2009 +0200 sti: Add sti class factory. --- dlls/sti/Makefile.in | 2 +- dlls/sti/sti.spec | 4 +- dlls/sti/sti_main.c | 155 +++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 155 insertions(+), 6 deletions(-) diff --git a/dlls/sti/Makefile.in b/dlls/sti/Makefile.in index 3167261..8405693 100644 --- a/dlls/sti/Makefile.in +++ b/dlls/sti/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = sti.dll IMPORTLIB = sti -IMPORTS = ole32 advapi32 kernel32 +IMPORTS = uuid ole32 advapi32 kernel32 C_SRCS = \ regsvr.c \ diff --git a/dlls/sti/sti.spec b/dlls/sti/sti.spec index 186f382..189af52 100644 --- a/dlls/sti/sti.spec +++ b/dlls/sti/sti.spec @@ -1,5 +1,5 @@ -@ stub DllCanUnloadNow -@ stub DllGetClassObject +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) @ stdcall -private DllRegisterServer() @ stdcall -private DllUnregisterServer() @ stdcall StiCreateInstance(ptr long ptr ptr) diff --git a/dlls/sti/sti_main.c b/dlls/sti/sti_main.c index 1d4e6ad..c53d6bb 100644 --- a/dlls/sti/sti_main.c +++ b/dlls/sti/sti_main.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2002 Aric Stewart for CodeWeavers + * Copyright (C) 2009 Damjan Jovanovic * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,15 +19,163 @@ #include <stdarg.h> +#define COBJMACROS + #include "windef.h" #include "winbase.h" #include "winreg.h" #include "winerror.h" +#include "objbase.h" +#include "sti.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sti); + +typedef HRESULT (*fnCreateInstance)(REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj); + +typedef struct +{ + const struct IClassFactoryVtbl *vtbl; + fnCreateInstance pfnCreateInstance; +} sti_cf; + +static inline sti_cf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return (sti_cf *)((char *)iface - FIELD_OFFSET( sti_cf, vtbl )); +} + +static HRESULT sti_create( REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj ) +{ + if (pUnkOuter != NULL && !IsEqualIID(riid, &IID_IUnknown)) + return CLASS_E_NOAGGREGATION; + + if (IsEqualGUID(riid, &IID_IUnknown)) + return StiCreateInstanceW(GetCurrentProcess(), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, (PSTIW*) ppObj, pUnkOuter); + else if (IsEqualGUID(riid, &IID_IStillImageW)) + return StiCreateInstanceW(GetCurrentProcess(), STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE, (PSTIW*) ppObj, NULL); + else if (IsEqualGUID(riid, &IID_IStillImageA)) + return StiCreateInstanceA(GetCurrentProcess(), STI_VERSION_REAL, (PSTIA*) ppObj, NULL); + else + { + FIXME("no interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } +} + +static HRESULT WINAPI sti_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + FIXME("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI sti_cf_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI sti_cf_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI sti_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj ) +{ + sti_cf *This = impl_from_IClassFactory( iface ); + HRESULT r; + IUnknown *punk; + + TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + if (pOuter) + return CLASS_E_NOAGGREGATION; + + r = This->pfnCreateInstance( riid, pOuter, (LPVOID *)&punk ); + if (FAILED(r)) + return r; + + r = IUnknown_QueryInterface( punk, riid, ppobj ); + if (FAILED(r)) + return r; + + IUnknown_Release( punk ); + return r; +} + +static HRESULT WINAPI sti_cf_LockServer( IClassFactory *iface, BOOL dolock ) +{ + FIXME("(%p)->(%d)\n", iface, dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl sti_cf_vtbl = +{ + sti_cf_QueryInterface, + sti_cf_AddRef, + sti_cf_Release, + sti_cf_CreateInstance, + sti_cf_LockServer +}; + +static sti_cf the_sti_cf = { &sti_cf_vtbl, sti_create }; + +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("(0x%p, %d, %p)\n",hInstDLL,fdwReason,lpvReserved); + + switch(fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +/****************************************************************************** + * DllGetClassObject (STI.@) + */ +HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv ) +{ + IClassFactory *cf = NULL; + + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if (IsEqualGUID( rclsid, &CLSID_Sti )) + { + cf = (IClassFactory *)&the_sti_cf.vtbl; + } + + if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + return IClassFactory_QueryInterface( cf, iid, ppv ); +} + +/****************************************************************************** + * DllCanUnloadNow (STI.@) + */ +HRESULT WINAPI DllCanUnloadNow( void ) +{ + FIXME("\n"); + return S_FALSE; +} /****************************************************************************** * StiCreateInstance (STI.@) */ -HRESULT WINAPI StiCreateInstance( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +HRESULT WINAPI StiCreateInstance( HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter ) { return STG_E_UNIMPLEMENTEDFUNCTION; } @@ -34,7 +183,7 @@ HRESULT WINAPI StiCreateInstance( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) /****************************************************************************** * StiCreateInstanceA (STI.@) */ -HRESULT WINAPI StiCreateInstanceA( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +HRESULT WINAPI StiCreateInstanceA( HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter ) { return STG_E_UNIMPLEMENTEDFUNCTION; } @@ -42,7 +191,7 @@ HRESULT WINAPI StiCreateInstanceA( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) /****************************************************************************** * StiCreateInstanceW (STI.@) */ -HRESULT WINAPI StiCreateInstanceW( HINSTANCE a, DWORD b, LPVOID c, LPVOID d) +HRESULT WINAPI StiCreateInstanceW( HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter ) { return STG_E_UNIMPLEMENTEDFUNCTION; }
1
0
0
0
Damjan Jovanovic : sti.h: Add sti create function declarations.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: bac9f138c9b75747370dd1ae7cf1636801a0e157 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bac9f138c9b75747370dd1ae7…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed Sep 23 18:53:38 2009 +0200 sti.h: Add sti create function declarations. --- include/sti.h | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/include/sti.h b/include/sti.h index 56650f5..cafdc6e 100644 --- a/include/sti.h +++ b/include/sti.h @@ -31,6 +31,28 @@ extern "C" { DEFINE_GUID(CLSID_Sti, 0xB323F8E0L, 0x2E68, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); +DEFINE_GUID(IID_IStillImageW, 0x641BD880, 0x2DC8, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); + +DEFINE_GUID(IID_IStillImageA, 0xA7B1F740, 0x1D7F, 0x11D1, 0xAC, 0xA9, 0x00, 0xA0, 0x24, 0x38, 0xAD, 0x48); + +#define STI_VERSION_REAL 0x00000002 +#define STI_VERSION_FLAG_UNICODE 0x01000000 + +#ifndef WINE_NO_UNICODE_MACROS +# ifdef UNICODE +# define STI_VERSION (STI_VERSION_REAL | STI_VERSION_FLAG_UNICODE) +# else +# define STI_VERSION (STI_VERSION_REAL) +# endif +#endif + +typedef struct IStillImageA *PSTIA; +typedef struct IStillImageW *PSTIW; +DECL_WINELIB_TYPE_AW(PSTI) + +HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter); +HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter); + #ifdef __cplusplus }; #endif
1
0
0
0
Vincent Povirk : gdiplus: Implement GdipBitmapSetPixel.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 809f721aba2c2c5aa880eca5fba0d62771876872 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=809f721aba2c2c5aa880eca5f…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Sep 23 11:22:39 2009 -0500 gdiplus: Implement GdipBitmapSetPixel. --- dlls/gdiplus/image.c | 141 ++++++++++++++++++++++++++++++++++++++++++-- dlls/gdiplus/tests/image.c | 16 +++--- 2 files changed, 144 insertions(+), 13 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index dc9f954..da94ee2 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -265,19 +265,150 @@ GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y, return Ok; } +static inline void setpixel_16bppGrayScale(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((WORD*)(row)+x) = (r+g+b)*85; +} + +static inline void setpixel_16bppRGB555(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((WORD*)(row)+x) = (r<<7&0x7c00)| + (g<<2&0x03e0)| + (b>>3&0x001f); +} + +static inline void setpixel_16bppRGB565(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((WORD*)(row)+x) = (r<<8&0xf800)| + (g<<3&0x07e0)| + (b>>3&0x001f); +} + +static inline void setpixel_16bppARGB1555(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((WORD*)(row)+x) = (a<<8&0x8000)| + (r<<7&0x7c00)| + (g<<2&0x03e0)| + (b>>3&0x001f); +} + +static inline void setpixel_24bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + row[x*3+2] = r; + row[x*3+1] = g; + row[x*3] = b; +} + +static inline void setpixel_32bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((DWORD*)(row)+x) = (r<<16)|(g<<8)|b; +} + +static inline void setpixel_32bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + *((DWORD*)(row)+x) = (a<<24)|(r<<16)|(g<<8)|b; +} + +static inline void setpixel_32bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + r = r * a / 255; + g = g * a / 255; + b = b * a / 255; + *((DWORD*)(row)+x) = (a<<24)|(r<<16)|(g<<8)|b; +} + +static inline void setpixel_48bppRGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + row[x*6+5] = row[x*6+4] = r; + row[x*6+3] = row[x*6+2] = g; + row[x*6+1] = row[x*6] = b; +} + +static inline void setpixel_64bppARGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + UINT64 a64=a, r64=r, g64=g, b64=b; + *((UINT64*)(row)+x) = (a64<<56)|(a64<<48)|(r64<<40)|(r64<<32)|(g64<<24)|(g64<<16)|(b64<<8)|b64; +} + +static inline void setpixel_64bppPARGB(BYTE r, BYTE g, BYTE b, BYTE a, + BYTE *row, UINT x) +{ + UINT64 a64, r64, g64, b64; + a64 = a * 257; + r64 = r * a / 255; + g64 = g * a / 255; + b64 = b * a / 255; + *((UINT64*)(row)+x) = (a64<<48)|(r64<<32)|(g64<<16)|b64; +} + GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y, ARGB color) { - static int calls; + BYTE a, r, g, b; + BYTE *row; TRACE("bitmap:%p, x:%d, y:%d, color:%08x\n", bitmap, x, y, color); - if(!bitmap) + if(!bitmap || x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + a = color>>24; + r = color>>16; + g = color>>8; + b = color; - return NotImplemented; + row = bitmap->bits + bitmap->stride * y; + + switch (bitmap->format) + { + case PixelFormat16bppGrayScale: + setpixel_16bppGrayScale(r,g,b,a,row,x); + break; + case PixelFormat16bppRGB555: + setpixel_16bppRGB555(r,g,b,a,row,x); + break; + case PixelFormat16bppRGB565: + setpixel_16bppRGB565(r,g,b,a,row,x); + break; + case PixelFormat16bppARGB1555: + setpixel_16bppARGB1555(r,g,b,a,row,x); + break; + case PixelFormat24bppRGB: + setpixel_24bppRGB(r,g,b,a,row,x); + break; + case PixelFormat32bppRGB: + setpixel_32bppRGB(r,g,b,a,row,x); + break; + case PixelFormat32bppARGB: + setpixel_32bppARGB(r,g,b,a,row,x); + break; + case PixelFormat32bppPARGB: + setpixel_32bppPARGB(r,g,b,a,row,x); + break; + case PixelFormat48bppRGB: + setpixel_48bppRGB(r,g,b,a,row,x); + break; + case PixelFormat64bppARGB: + setpixel_64bppARGB(r,g,b,a,row,x); + break; + case PixelFormat64bppPARGB: + setpixel_64bppPARGB(r,g,b,a,row,x); + break; + default: + FIXME("not implemented for format 0x%x\n", bitmap->format); + return NotImplemented; + } + + return Ok; } /* This function returns a pointer to an array of pixels that represents the diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 3037f6c..e973186 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -825,25 +825,25 @@ static void test_getsetpixel(void) expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, -1, 1, 0); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 1, -1, &color); expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 1, -1, 0); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 2, 1, &color); expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 2, 1, 0); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 1, 2, &color); expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 1, 2, 0); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); /* valid use */ stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); @@ -855,18 +855,18 @@ static void test_getsetpixel(void) expect(0xff0000ff, color); stat = GdipBitmapSetPixel(bitmap, 1, 1, 0xff676869); - todo_wine expect(Ok, stat); + expect(Ok, stat); stat = GdipBitmapSetPixel(bitmap, 0, 0, 0xff474849); - todo_wine expect(Ok, stat); + expect(Ok, stat); stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); expect(Ok, stat); - todo_wine expect(0xff676869, color); + expect(0xff676869, color); stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); expect(Ok, stat); - todo_wine expect(0xff474849, color); + expect(0xff474849, color); stat = GdipDisposeImage((GpImage*)bitmap); expect(Ok, stat);
1
0
0
0
Vincent Povirk : gdiplus: Implement GdipBitmapGetPixel.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 41140a950bbfb69e56803d8598c391483ea55287 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=41140a950bbfb69e56803d859…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Sep 23 10:41:13 2009 -0500 gdiplus: Implement GdipBitmapGetPixel. --- dlls/gdiplus/image.c | 166 ++++++++++++++++++++++++++++++++++++++++++-- dlls/gdiplus/tests/image.c | 20 +++--- 2 files changed, 170 insertions(+), 16 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 3dc41b8..dc9f954 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -94,21 +94,175 @@ GpStatus WINGDIPAPI GdipBitmapCreateApplyEffect(GpBitmap** inputBitmaps, return NotImplemented; } +static inline void getpixel_16bppGrayScale(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = *g = *b = row[x*2+1]; + *a = 255; +} + +static inline void getpixel_16bppRGB555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + WORD pixel = *((WORD*)(row)+x); + *r = (pixel>>7&0xf8)|(pixel>>12&0x7); + *g = (pixel>>2&0xf8)|(pixel>>6&0x7); + *b = (pixel<<3&0xf8)|(pixel>>2&0x7); + *a = 255; +} + +static inline void getpixel_16bppRGB565(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + WORD pixel = *((WORD*)(row)+x); + *r = (pixel>>8&0xf8)|(pixel>>13&0x7); + *g = (pixel>>3&0xfc)|(pixel>>9&0x3); + *b = (pixel<<3&0xf8)|(pixel>>2&0x7); + *a = 255; +} + +static inline void getpixel_16bppARGB1555(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + WORD pixel = *((WORD*)(row)+x); + *r = (pixel>>7&0xf8)|(pixel>>12&0x7); + *g = (pixel>>2&0xf8)|(pixel>>6&0x7); + *b = (pixel<<3&0xf8)|(pixel>>2&0x7); + if ((pixel&0x8000) == 0x8000) + *a = 255; + else + *a = 0; +} + +static inline void getpixel_24bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = row[x*3+2]; + *g = row[x*3+1]; + *b = row[x*3]; + *a = 255; +} + +static inline void getpixel_32bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = row[x*4+2]; + *g = row[x*4+1]; + *b = row[x*4]; + *a = 255; +} + +static inline void getpixel_32bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = row[x*4+2]; + *g = row[x*4+1]; + *b = row[x*4]; + *a = row[x*4+3]; +} + +static inline void getpixel_32bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *a = row[x*4+3]; + if (*a == 0) + *r = *g = *b = 0; + else + { + *r = row[x*4+2] * 255 / *a; + *g = row[x*4+1] * 255 / *a; + *b = row[x*4] * 255 / *a; + } +} + +static inline void getpixel_48bppRGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = row[x*6+5]; + *g = row[x*6+3]; + *b = row[x*6+1]; + *a = 255; +} + +static inline void getpixel_64bppARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *r = row[x*8+5]; + *g = row[x*8+3]; + *b = row[x*8+1]; + *a = row[x*8+7]; +} + +static inline void getpixel_64bppPARGB(BYTE *r, BYTE *g, BYTE *b, BYTE *a, + const BYTE *row, UINT x) +{ + *a = row[x*8+7]; + if (*a == 0) + *r = *g = *b = 0; + else + { + *r = row[x*8+5] * 255 / *a; + *g = row[x*8+3] * 255 / *a; + *b = row[x*8+1] * 255 / *a; + } +} + GpStatus WINGDIPAPI GdipBitmapGetPixel(GpBitmap* bitmap, INT x, INT y, ARGB *color) { - static int calls; + BYTE r, g, b, a; + BYTE *row; TRACE("%p %d %d %p\n", bitmap, x, y, color); - if(!bitmap || !color) + if(!bitmap || !color || + x < 0 || y < 0 || x >= bitmap->width || y >= bitmap->height) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + row = bitmap->bits+bitmap->stride*y; + + switch (bitmap->format) + { + case PixelFormat16bppGrayScale: + getpixel_16bppGrayScale(&r,&g,&b,&a,row,x); + break; + case PixelFormat16bppRGB555: + getpixel_16bppRGB555(&r,&g,&b,&a,row,x); + break; + case PixelFormat16bppRGB565: + getpixel_16bppRGB565(&r,&g,&b,&a,row,x); + break; + case PixelFormat16bppARGB1555: + getpixel_16bppARGB1555(&r,&g,&b,&a,row,x); + break; + case PixelFormat24bppRGB: + getpixel_24bppRGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat32bppRGB: + getpixel_32bppRGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat32bppARGB: + getpixel_32bppARGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat32bppPARGB: + getpixel_32bppPARGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat48bppRGB: + getpixel_48bppRGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat64bppARGB: + getpixel_64bppARGB(&r,&g,&b,&a,row,x); + break; + case PixelFormat64bppPARGB: + getpixel_64bppPARGB(&r,&g,&b,&a,row,x); + break; + default: + FIXME("not implemented for format 0x%x\n", bitmap->format); + return NotImplemented; + } - *color = 0xdeadbeef; + *color = a<<24|r<<16|g<<8|b; - return NotImplemented; + return Ok; } GpStatus WINGDIPAPI GdipBitmapSetPixel(GpBitmap* bitmap, INT x, INT y, diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index d32b9f8..3037f6c 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -822,37 +822,37 @@ static void test_getsetpixel(void) /* out of bounds */ stat = GdipBitmapGetPixel(bitmap, -1, 1, &color); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, -1, 1, 0); todo_wine expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 1, -1, &color); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 1, -1, 0); todo_wine expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 2, 1, &color); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 2, 1, 0); todo_wine expect(InvalidParameter, stat); stat = GdipBitmapGetPixel(bitmap, 1, 2, &color); - todo_wine expect(InvalidParameter, stat); + expect(InvalidParameter, stat); stat = GdipBitmapSetPixel(bitmap, 1, 2, 0); todo_wine expect(InvalidParameter, stat); /* valid use */ stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); - todo_wine expect(Ok, stat); - todo_wine expect(0xffffffff, color); + expect(Ok, stat); + expect(0xffffffff, color); stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); - todo_wine expect(Ok, stat); - todo_wine expect(0xff0000ff, color); + expect(Ok, stat); + expect(0xff0000ff, color); stat = GdipBitmapSetPixel(bitmap, 1, 1, 0xff676869); todo_wine expect(Ok, stat); @@ -861,11 +861,11 @@ static void test_getsetpixel(void) todo_wine expect(Ok, stat); stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); - todo_wine expect(Ok, stat); + expect(Ok, stat); todo_wine expect(0xff676869, color); stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); - todo_wine expect(Ok, stat); + expect(Ok, stat); todo_wine expect(0xff474849, color); stat = GdipDisposeImage((GpImage*)bitmap);
1
0
0
0
Vincent Povirk : gdiplus: Add tests for GdipBitmap(Get|Set)Pixel.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: e1cb441781c79d9fedf8490ebfcb0fcfe1846086 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e1cb441781c79d9fedf8490eb…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Wed Sep 23 10:41:06 2009 -0500 gdiplus: Add tests for GdipBitmap(Get|Set)Pixel. --- dlls/gdiplus/tests/image.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 5378cb8..d32b9f8 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -799,6 +799,79 @@ static void test_createhbitmap(void) expect(Ok, stat); } +static void test_getsetpixel(void) +{ + GpStatus stat; + GpBitmap *bitmap; + ARGB color; + BYTE bits[16] = {0x00,0x00,0x00,0x00, 0x00,0xff,0xff,0x00, + 0xff,0x00,0x00,0x00, 0xff,0xff,0xff,0x00}; + + stat = GdipCreateBitmapFromScan0(2, 2, 8, PixelFormat32bppRGB, bits, &bitmap); + expect(Ok, stat); + + /* null parameters */ + stat = GdipBitmapGetPixel(NULL, 1, 1, &color); + expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 1, NULL); + expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(NULL, 1, 1, 0); + expect(InvalidParameter, stat); + + /* out of bounds */ + stat = GdipBitmapGetPixel(bitmap, -1, 1, &color); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, -1, 1, 0); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, -1, &color); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, 1, -1, 0); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 2, 1, &color); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, 2, 1, 0); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 2, &color); + todo_wine expect(InvalidParameter, stat); + + stat = GdipBitmapSetPixel(bitmap, 1, 2, 0); + todo_wine expect(InvalidParameter, stat); + + /* valid use */ + stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xffffffff, color); + + stat = GdipBitmapGetPixel(bitmap, 0, 1, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff0000ff, color); + + stat = GdipBitmapSetPixel(bitmap, 1, 1, 0xff676869); + todo_wine expect(Ok, stat); + + stat = GdipBitmapSetPixel(bitmap, 0, 0, 0xff474849); + todo_wine expect(Ok, stat); + + stat = GdipBitmapGetPixel(bitmap, 1, 1, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff676869, color); + + stat = GdipBitmapGetPixel(bitmap, 0, 0, &color); + todo_wine expect(Ok, stat); + todo_wine expect(0xff474849, color); + + stat = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, stat); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -825,6 +898,7 @@ START_TEST(image) test_fromhicon(); test_getrawformat(); test_createhbitmap(); + test_getsetpixel(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Henri Verbeet : wined3d: Don' t free D3D pixel shaders until the wined3d pixel shader is destroyed.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 789372afa82d0771196160dc538dd3d9791eb669 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=789372afa82d0771196160dc5…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Sep 23 18:42:13 2009 +0200 wined3d: Don't free D3D pixel shaders until the wined3d pixel shader is destroyed. --- dlls/d3d10core/shader.c | 23 +++++++++++++++++++---- dlls/d3d8/pixelshader.c | 22 +++++++++++++++++++--- dlls/d3d9/pixelshader.c | 25 +++++++++++++++++++++---- dlls/wined3d/device.c | 5 +++-- dlls/wined3d/pixelshader.c | 4 +++- dlls/wined3d/wined3d_private.h | 3 ++- include/wine/wined3d.idl | 3 ++- 7 files changed, 69 insertions(+), 16 deletions(-) diff --git a/dlls/d3d10core/shader.c b/dlls/d3d10core/shader.c index 14f8919..bf7a6ab 100644 --- a/dlls/d3d10core/shader.c +++ b/dlls/d3d10core/shader.c @@ -394,6 +394,11 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *ifac TRACE("%p increasing refcount to %u\n", This, refcount); + if (refcount == 1) + { + IWineD3DPixelShader_AddRef(This->wined3d_shader); + } + return refcount; } @@ -407,8 +412,6 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *ifa if (!refcount) { IWineD3DPixelShader_Release(This->wined3d_shader); - shader_free_signature(&This->output_signature); - HeapFree(GetProcessHeap(), 0, This); } return refcount; @@ -460,6 +463,18 @@ static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl = d3d10_pixel_shader_SetPrivateDataInterface, }; +static void STDMETHODCALLTYPE d3d10_pixel_shader_wined3d_object_destroyed(void *parent) +{ + struct d3d10_pixel_shader *shader = parent; + shader_free_signature(&shader->output_signature); + HeapFree(GetProcessHeap(), 0, shader); +} + +static const struct wined3d_parent_ops d3d10_pixel_shader_wined3d_parent_ops = +{ + d3d10_pixel_shader_wined3d_object_destroyed, +}; + HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_device *device, const void *byte_code, SIZE_T byte_code_length) { @@ -478,8 +493,8 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_ } hr = IWineD3DDevice_CreatePixelShader(device->wined3d_device, - shader_info.shader_code, &shader->output_signature, - &shader->wined3d_shader, (IUnknown *)shader); + shader_info.shader_code, &shader->output_signature, &shader->wined3d_shader, + (IUnknown *)shader, &d3d10_pixel_shader_wined3d_parent_ops); if (FAILED(hr)) { WARN("Failed to create wined3d pixel shader, hr %#x.\n", hr); diff --git a/dlls/d3d8/pixelshader.c b/dlls/d3d8/pixelshader.c index 3f5ed9e..f565495 100644 --- a/dlls/d3d8/pixelshader.c +++ b/dlls/d3d8/pixelshader.c @@ -46,6 +46,13 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_AddRef(IDirect3DPixelShader8 *ifac TRACE("(%p) : AddRef from %d\n", This, ref - 1); + if (ref == 1) + { + wined3d_mutex_lock(); + IWineD3DPixelShader_AddRef(This->wineD3DPixelShader); + wined3d_mutex_unlock(); + } + return ref; } @@ -59,8 +66,6 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_Release(IDirect3DPixelShader8 * if wined3d_mutex_lock(); IWineD3DPixelShader_Release(This->wineD3DPixelShader); wined3d_mutex_unlock(); - - HeapFree(GetProcessHeap(), 0, This); } return ref; } @@ -73,6 +78,16 @@ static const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl = IDirect3DPixelShader8Impl_Release, }; +static void STDMETHODCALLTYPE d3d8_pixelshader_wined3d_object_destroyed(void *parent) +{ + HeapFree(GetProcessHeap(), 0, parent); +} + +static const struct wined3d_parent_ops d3d8_pixelshader_wined3d_parent_ops = +{ + d3d8_pixelshader_wined3d_object_destroyed, +}; + HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device, const DWORD *byte_code, DWORD shader_handle) { @@ -84,7 +99,8 @@ HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl wined3d_mutex_lock(); hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, - NULL, &shader->wineD3DPixelShader, (IUnknown *)shader); + NULL, &shader->wineD3DPixelShader, (IUnknown *)shader, + &d3d8_pixelshader_wined3d_parent_ops); wined3d_mutex_unlock(); if (FAILED(hr)) { diff --git a/dlls/d3d9/pixelshader.c b/dlls/d3d9/pixelshader.c index 11f275d..547dc74 100644 --- a/dlls/d3d9/pixelshader.c +++ b/dlls/d3d9/pixelshader.c @@ -46,6 +46,14 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_AddRef(LPDIRECT3DPIXELSHADER9 ifac TRACE("(%p) : AddRef from %d\n", This, ref - 1); + if (ref == 1) + { + IDirect3DDevice9Ex_AddRef(This->parentDevice); + wined3d_mutex_lock(); + IWineD3DPixelShader_AddRef(This->wineD3DPixelShader); + wined3d_mutex_unlock(); + } + return ref; } @@ -56,12 +64,10 @@ static ULONG WINAPI IDirect3DPixelShader9Impl_Release(LPDIRECT3DPIXELSHADER9 ifa TRACE("(%p) : ReleaseRef to %d\n", This, ref); if (ref == 0) { + IDirect3DDevice9Ex_Release(This->parentDevice); wined3d_mutex_lock(); IWineD3DPixelShader_Release(This->wineD3DPixelShader); wined3d_mutex_unlock(); - - IDirect3DDevice9Ex_Release(This->parentDevice); - HeapFree(GetProcessHeap(), 0, This); } return ref; } @@ -107,6 +113,16 @@ static const IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl = IDirect3DPixelShader9Impl_GetFunction }; +static void STDMETHODCALLTYPE d3d9_pixelshader_wined3d_object_destroyed(void *parent) +{ + HeapFree(GetProcessHeap(), 0, parent); +} + +static const struct wined3d_parent_ops d3d9_pixelshader_wined3d_parent_ops = +{ + d3d9_pixelshader_wined3d_object_destroyed, +}; + HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, IDirect3DDevice9Impl *device, const DWORD *byte_code) { HRESULT hr; @@ -116,7 +132,8 @@ HRESULT pixelshader_init(IDirect3DPixelShader9Impl *shader, IDirect3DDevice9Impl wined3d_mutex_lock(); hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, - NULL, &shader->wineD3DPixelShader, (IUnknown *)shader); + NULL, &shader->wineD3DPixelShader, (IUnknown *)shader, + &d3d9_pixelshader_wined3d_parent_ops); wined3d_mutex_unlock(); if (FAILED(hr)) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 5a53899..bda39e1 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1792,7 +1792,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice *ifac static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface, const DWORD *pFunction, const struct wined3d_shader_signature *output_signature, - IWineD3DPixelShader **ppPixelShader, IUnknown *parent) + IWineD3DPixelShader **ppPixelShader, IUnknown *parent, + const struct wined3d_parent_ops *parent_ops) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DPixelShaderImpl *object; @@ -1805,7 +1806,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface return E_OUTOFMEMORY; } - hr = pixelshader_init(object, This, pFunction, output_signature, parent); + hr = pixelshader_init(object, This, pFunction, output_signature, parent, parent_ops); if (FAILED(hr)) { WARN("Failed to initialize pixel shader, hr %#x.\n", hr); diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index ba7be4b..89d7a13 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -71,6 +71,7 @@ static ULONG WINAPI IWineD3DPixelShaderImpl_Release(IWineD3DPixelShader *iface) if (!refcount) { shader_cleanup((IWineD3DBaseShader *)iface); + This->parent_ops->wined3d_object_destroyed(This->parent); HeapFree(GetProcessHeap(), 0, This); } @@ -424,7 +425,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device, const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, - IUnknown *parent) + IUnknown *parent, const struct wined3d_parent_ops *parent_ops) { HRESULT hr; @@ -432,6 +433,7 @@ HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *de shader->lpVtbl = &IWineD3DPixelShader_Vtbl; shader->parent = parent; + shader->parent_ops = parent_ops; shader_init(&shader->baseShader, (IWineD3DDevice *)device); list_add_head(&device->shaders, &shader->baseShader.shader_list_entry); diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index f4e1845..66a72b7 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2813,6 +2813,7 @@ typedef struct IWineD3DPixelShaderImpl { /* IWineD3DPixelShaderImpl */ IUnknown *parent; + const struct wined3d_parent_ops *parent_ops; /* Pixel shader input semantics */ struct wined3d_shader_signature_element input_signature[MAX_REG_INPUT]; @@ -2833,7 +2834,7 @@ typedef struct IWineD3DPixelShaderImpl { HRESULT pixelshader_init(IWineD3DPixelShaderImpl *shader, IWineD3DDeviceImpl *device, const DWORD *byte_code, const struct wined3d_shader_signature *output_signature, - IUnknown *parent) DECLSPEC_HIDDEN; + IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; void pixelshader_update_samplers(struct shader_reg_maps *reg_maps, IWineD3DBaseTexture * const *textures) DECLSPEC_HIDDEN; void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImpl *stateblock, diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl index e4d8144..e39a880 100644 --- a/include/wine/wined3d.idl +++ b/include/wine/wined3d.idl @@ -3013,7 +3013,8 @@ interface IWineD3DDevice : IWineD3DBase [in] const DWORD *function, [in] const struct wined3d_shader_signature *output_signature, [out] IWineD3DPixelShader **shader, - [in] IUnknown *parent + [in] IUnknown *parent, + [in] const struct wined3d_parent_ops *parent_ops ); HRESULT CreatePalette( [in] DWORD flags,
1
0
0
0
Henri Verbeet : d3d8: Add a separate function for pixel shader initialization.
by Alexandre Julliard
24 Sep '09
24 Sep '09
Module: wine Branch: master Commit: 717419da11fe3d61093193f43ef40f1ff9dde7fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=717419da11fe3d61093193f43…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Sep 23 18:42:12 2009 +0200 d3d8: Add a separate function for pixel shader initialization. --- dlls/d3d8/d3d8_private.h | 14 ++--------- dlls/d3d8/device.c | 52 ++++++++++++++++++++++++--------------------- dlls/d3d8/pixelshader.c | 24 ++++++++++++++++++++- 3 files changed, 54 insertions(+), 36 deletions(-) diff --git a/dlls/d3d8/d3d8_private.h b/dlls/d3d8/d3d8_private.h index 89d05c9..8adc9e3 100644 --- a/dlls/d3d8/d3d8_private.h +++ b/dlls/d3d8/d3d8_private.h @@ -603,17 +603,6 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im #define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256 - -/* ------------------------ */ -/* IDirect3DPixelShaderImpl */ -/* ------------------------ */ - - -/***************************************************************************** - * Predeclare the interface implementation structures - */ -extern const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl DECLSPEC_HIDDEN; - /***************************************************************************** * IDirect3DPixelShader implementation structure */ @@ -625,6 +614,9 @@ typedef struct IDirect3DPixelShader8Impl { IWineD3DPixelShader *wineD3DPixelShader; } IDirect3DPixelShader8Impl; +HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device, + const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN; + /** * Internals functions * diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 3bb329f..4686f9a 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2094,15 +2094,20 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I return rc; } -static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction, DWORD* ppShader) { + +static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(IDirect3DDevice8 *iface, + const DWORD *byte_code, DWORD *shader) +{ IDirect3DDevice8Impl *This = (IDirect3DDevice8Impl *)iface; IDirect3DPixelShader8Impl *object; + DWORD shader_handle; DWORD handle; HRESULT hr; - TRACE("(%p) : pFunction(%p), ppShader(%p)\n", This, pFunction, ppShader); + TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader); - if (NULL == ppShader) { + if (!shader) + { TRACE("(%p) Invalid call\n", This); return D3DERR_INVALIDCALL; } @@ -2110,39 +2115,38 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) { - ERR("Failed to allocate memmory.\n"); + ERR("Failed to allocate pixel shader memmory.\n"); return E_OUTOFMEMORY; } - object->ref = 1; - object->lpVtbl = &Direct3DPixelShader8_Vtbl; - wined3d_mutex_lock(); - hr = IWineD3DDevice_CreatePixelShader(This->WineD3DDevice, pFunction, - NULL, &object->wineD3DPixelShader, (IUnknown *)object); - if (FAILED(hr)) - { - wined3d_mutex_unlock(); - FIXME("(%p) call to IWineD3DDevice_CreatePixelShader failed\n", This); - HeapFree(GetProcessHeap(), 0 , object); - *ppShader = 0; - return hr; - } - handle = d3d8_allocate_handle(&This->handle_table, object, D3D8_HANDLE_PS); wined3d_mutex_unlock(); - if (handle == D3D8_INVALID_HANDLE) { - ERR("Failed to allocate shader handle\n"); - IDirect3DVertexShader8_Release((IUnknown *)object); + ERR("Failed to allocate pixel shader handle.\n"); + HeapFree(GetProcessHeap(), 0, object); return E_OUTOFMEMORY; } - *ppShader = object->handle = handle + VS_HIGHESTFIXEDFXF + 1; - TRACE("(%p) : returning %p (handle %#x)\n", This, object, *ppShader); + shader_handle = handle + VS_HIGHESTFIXEDFXF + 1; - return hr; + hr = pixelshader_init(object, This, byte_code, shader_handle); + if (FAILED(hr)) + { + WARN("Failed to initialize pixel shader, hr %#x.\n", hr); + wined3d_mutex_lock(); + d3d8_free_handle(&This->handle_table, handle, D3D8_HANDLE_PS); + wined3d_mutex_unlock(); + HeapFree(GetProcessHeap(), 0, object); + *shader = 0; + return hr; + } + + TRACE("Created pixel shader %p (handle %#x).\n", object, shader_handle); + *shader = shader_handle; + + return D3D_OK; } static HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD pShader) { diff --git a/dlls/d3d8/pixelshader.c b/dlls/d3d8/pixelshader.c index 2f0fb1c..3f5ed9e 100644 --- a/dlls/d3d8/pixelshader.c +++ b/dlls/d3d8/pixelshader.c @@ -65,10 +65,32 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_Release(IDirect3DPixelShader8 * if return ref; } -const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl = +static const IDirect3DPixelShader8Vtbl Direct3DPixelShader8_Vtbl = { /* IUnknown */ IDirect3DPixelShader8Impl_QueryInterface, IDirect3DPixelShader8Impl_AddRef, IDirect3DPixelShader8Impl_Release, }; + +HRESULT pixelshader_init(IDirect3DPixelShader8Impl *shader, IDirect3DDevice8Impl *device, + const DWORD *byte_code, DWORD shader_handle) +{ + HRESULT hr; + + shader->ref = 1; + shader->lpVtbl = &Direct3DPixelShader8_Vtbl; + shader->handle = shader_handle; + + wined3d_mutex_lock(); + hr = IWineD3DDevice_CreatePixelShader(device->WineD3DDevice, byte_code, + NULL, &shader->wineD3DPixelShader, (IUnknown *)shader); + wined3d_mutex_unlock(); + if (FAILED(hr)) + { + WARN("Failed to create wined3d pixel shader, hr %#x.\n", hr); + return hr; + } + + return D3D_OK; +}
1
0
0
0
← Newer
1
...
21
22
23
24
25
26
27
...
87
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Results per page:
10
25
50
100
200