winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2014
----- 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
500 discussions
Start a n
N
ew thread
Huw Davies : ntdll: For Android look in /proc/ mounts for mounted file systems.
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: ac79e160e7a11ad6b822e4b3d1854138190de488 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ac79e160e7a11ad6b822e4b3d…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Apr 7 13:22:11 2014 +0100 ntdll: For Android look in /proc/mounts for mounted file systems. --- dlls/ntdll/directory.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 641f642..890fb71 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -685,6 +685,13 @@ static char *get_default_drive_device( const char *root ) RtlEnterCriticalSection( &dir_section ); +#ifdef __ANDROID__ + if ((f = fopen( "/proc/mounts", "r" ))) + { + device = parse_mount_entries( f, st.st_dev, st.st_ino ); + fclose( f ); + } +#else if ((f = fopen( "/etc/mtab", "r" ))) { device = parse_mount_entries( f, st.st_dev, st.st_ino ); @@ -696,6 +703,7 @@ static char *get_default_drive_device( const char *root ) device = parse_mount_entries( f, st.st_dev, st.st_ino ); fclose( f ); } +#endif if (device) { ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(device) + 1 ); @@ -827,7 +835,11 @@ static char *get_device_mount_point( dev_t dev ) RtlEnterCriticalSection( &dir_section ); +#ifdef __ANDROID__ + if ((f = fopen( "/proc/mounts", "r" ))) +#else if ((f = fopen( "/etc/mtab", "r" ))) +#endif { struct mntent *entry; struct stat st;
1
0
0
0
Huw Davies : ntdll: Add a replacement getmntent for Android.
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 2139df003f8c33fc5306345efbbcea7f54bfa907 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2139df003f8c33fc5306345ef…
Author: Huw Davies <huw(a)codeweavers.com> Date: Mon Apr 7 13:22:10 2014 +0100 ntdll: Add a replacement getmntent for Android. Bionic has a stub function named getmntent which outputs an unimplemented message. --- dlls/ntdll/directory.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 78b3ea7..641f642 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -365,6 +365,107 @@ static char *get_default_lpt_device( int num ) return ret; } +#ifdef __ANDROID__ + +static char *unescape_field( char *str ) +{ + char *in, *out; + + for (in = out = str; *in; in++, out++) + { + *out = *in; + if (in[0] == '\\') + { + if (in[1] == '\\') + { + out[0] = '\\'; + in++; + } + else if (in[1] == '0' && in[2] == '4' && in[3] == '0') + { + out[0] = ' '; + in += 3; + } + else if (in[1] == '0' && in[2] == '1' && in[3] == '1') + { + out[0] = '\t'; + in += 3; + } + else if (in[1] == '0' && in[2] == '1' && in[3] == '2') + { + out[0] = '\n'; + in += 3; + } + else if (in[1] == '1' && in[2] == '3' && in[3] == '4') + { + out[0] = '\\'; + in += 3; + } + } + } + *out = '\0'; + + return str; +} + +static inline char *get_field( char **str ) +{ + char *ret; + + ret = strsep( str, " \t" ); + if (*str) *str += strspn( *str, " \t" ); + + return ret; +} +/************************************************************************ + * getmntent_replacement + * + * getmntent replacement for Android. + * + * NB returned static buffer is not thread safe; protect with dir_section. + */ +static struct mntent *getmntent_replacement( FILE *f ) +{ + static struct mntent entry; + static char buf[4096]; + char *p, *start; + + do + { + if (!fgets( buf, sizeof(buf), f )) return NULL; + p = strchr( buf, '\n' ); + if (p) *p = '\0'; + else /* Partially unread line, move file ptr to end */ + { + char tmp[1024]; + while (fgets( tmp, sizeof(tmp), f )) + if (strchr( tmp, '\n' )) break; + } + start = buf + strspn( buf, " \t" ); + } while (start[0] == '\0' || start[0] == '#'); + + p = get_field( &start ); + entry.mnt_fsname = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_dir = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_type = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_opts = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_freq = p ? atoi(p) : 0; + + p = get_field( &start ); + entry.mnt_passno = p ? atoi(p) : 0; + + return &entry; +} +#define getmntent getmntent_replacement +#endif /*********************************************************************** * DIR_get_drives_info
1
0
0
0
Henri Verbeet : d3d9/tests: Use a separate device for autogen_mipmap_test( ).
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: f4f066ca286faea26e6d325f6e69614735a98f7e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4f066ca286faea26e6d325f6…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 7 10:01:08 2014 +0200 d3d9/tests: Use a separate device for autogen_mipmap_test(). --- dlls/d3d9/tests/visual.c | 89 +++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index bc07268..f50ee55 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -5335,31 +5335,50 @@ done: DestroyWindow(window); } -static void autogen_mipmap_test(IDirect3DDevice9 *device) +static void autogen_mipmap_test(void) { - HRESULT hr; - IDirect3D9 *d3d; IDirect3DTexture9 *texture = NULL; IDirect3DSurface9 *surface; - DWORD color; - const RECT r1 = {256, 256, 512, 512}; - const RECT r2 = {512, 256, 768, 512}; - const RECT r3 = {256, 512, 512, 768}; - const RECT r4 = {512, 512, 768, 768}; + IDirect3DDevice9 *device; unsigned int x, y; D3DLOCKED_RECT lr; - memset(&lr, 0, sizeof(lr)); + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, D3DFMT_X8R8G8B8) != D3D_OK) { - skip("No autogenmipmap support\n"); - IDirect3D9_Release(d3d); - return; + static const RECT r1 = {256, 256, 512, 512}; + static const RECT r2 = {512, 256, 768, 512}; + static const RECT r3 = {256, 512, 512, 768}; + static const RECT r4 = {512, 512, 768, 768}; + static const float quad[] = + { + -0.5f, -0.5f, 0.1f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.1f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.1f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.1f, 1.0f, 1.0f, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } - IDirect3D9_Release(d3d); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0, 0); + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, D3DFMT_X8R8G8B8) != D3D_OK) + { + skip("No autogenmipmap support.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffff00, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* Make the mipmap big, so that a smaller mipmap is used @@ -5370,6 +5389,7 @@ static void autogen_mipmap_test(IDirect3DDevice9 *device) hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel returned %08x\n", hr); + memset(&lr, 0, sizeof(lr)); hr = IDirect3DSurface9_LockRect(surface, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DSurface9_LockRect returned %08x\n", hr); for(y = 0; y < 1024; y++) { @@ -5400,28 +5420,17 @@ static void autogen_mipmap_test(IDirect3DDevice9 *device) ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) { - const float quad[] = { - -0.5, -0.5, 0.1, 0.0, 0.0, - -0.5, 0.5, 0.1, 0.0, 1.0, - 0.5, -0.5, 0.1, 1.0, 0.0, - 0.5, 0.5, 0.1, 1.0, 1.0 - }; - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); IDirect3DTexture9_Release(texture); color = getPixelColor(device, 200, 200); @@ -5442,6 +5451,12 @@ static void autogen_mipmap_test(IDirect3DDevice9 *device) ok(color == 0x00ffffff, "pixel 440/200 has color %08x, expected 0x00ffffff\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void test_constant_clamp_vs(void) @@ -16561,11 +16576,11 @@ START_TEST(visual) g16r16_texture_test(device_ptr); pixelshader_blending_test(device_ptr); texture_transform_flags_test(device_ptr); - autogen_mipmap_test(device_ptr); cleanup_device(device_ptr); device_ptr = NULL; + autogen_mipmap_test(); fixed_function_decl_test(); conditional_np2_repeat_test(); fixed_function_bumpmap_test();
1
0
0
0
Henri Verbeet : d3d9/tests: Use a separate device for fixed_function_decl_test().
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 93a37ed548fa353a60cce6cfa8f6ef0827159a5b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93a37ed548fa353a60cce6cfa…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 7 10:01:07 2014 +0200 d3d9/tests: Use a separate device for fixed_function_decl_test(). --- dlls/d3d9/tests/visual.c | 95 ++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 37 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 18a11a1..bc07268 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -7971,12 +7971,21 @@ struct vertex_floatcolor { float r, g, b, a; }; -static void fixed_function_decl_test(IDirect3DDevice9 *device) +static void fixed_function_decl_test(void) { - HRESULT hr; + IDirect3DVertexDeclaration9 *dcl_float = NULL, *dcl_short = NULL, *dcl_ubyte = NULL, *dcl_color = NULL; + IDirect3DVertexDeclaration9 *dcl_color_2 = NULL, *dcl_ubyte_2 = NULL, *dcl_positiont; + IDirect3DVertexBuffer9 *vb, *vb2; + IDirect3DDevice9 *device; BOOL s_ok, ub_ok, f_ok; DWORD color, size, i; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; void *data; + HRESULT hr; + static const D3DVERTEXELEMENT9 decl_elements_d3dcolor[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, @@ -8012,38 +8021,36 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device) {0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - IDirect3DVertexDeclaration9 *dcl_float = NULL, *dcl_short = NULL, *dcl_ubyte = NULL, *dcl_color = NULL; - IDirect3DVertexDeclaration9 *dcl_color_2 = NULL, *dcl_ubyte_2 = NULL, *dcl_positiont; - IDirect3DVertexBuffer9 *vb, *vb2; - struct vertex quad1[] = /* D3DCOLOR */ + static const struct vertex quad1[] = /* D3DCOLOR */ { {-1.0f, -1.0f, 0.1f, 0x00ffff00}, {-1.0f, 0.0f, 0.1f, 0x00ffff00}, { 0.0f, -1.0f, 0.1f, 0x00ffff00}, { 0.0f, 0.0f, 0.1f, 0x00ffff00}, }; - struct vertex quad2[] = /* UBYTE4N */ + static const struct vertex quad2[] = /* UBYTE4N */ { {-1.0f, 0.0f, 0.1f, 0x00ffff00}, {-1.0f, 1.0f, 0.1f, 0x00ffff00}, { 0.0f, 0.0f, 0.1f, 0x00ffff00}, { 0.0f, 1.0f, 0.1f, 0x00ffff00}, }; - struct vertex_shortcolor quad3[] = /* short */ + static const struct vertex_shortcolor quad3[] = /* short */ { { 0.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 0.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 1.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 1.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, }; - struct vertex_floatcolor quad4[] = + static const struct vertex_floatcolor quad4[] = { { 0.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 0.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 1.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 1.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, }; - DWORD colors[] = { + static const DWORD colors[] = + { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, @@ -8061,40 +8068,51 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device) 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, }; - float quads[] = { - -1.0, -1.0, 0.1, - -1.0, 0.0, 0.1, - 0.0, -1.0, 0.1, - 0.0, 0.0, 0.1, + static const float quads[] = + { + -1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, - 0.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - 1.0, -1.0, 0.1, - 1.0, 0.0, 0.1, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, - 0.0, 0.0, 0.1, - 0.0, 1.0, 0.1, - 1.0, 0.0, 0.1, - 1.0, 1.0, 0.1, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + 1.0f, 1.0f, 0.1f, - -1.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 0.0, 0.1, - 0.0, 1.0, 0.1 + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, }; - struct tvertex quad_transformed[] = { + static const struct tvertex quad_transformed[] = + { { 90, 110, 0.1, 2.0, 0x00ffff00}, { 570, 110, 0.1, 2.0, 0x00ffff00}, { 90, 300, 0.1, 2.0, 0x00ffff00}, { 570, 300, 0.1, 2.0, 0x00ffff00} }; - D3DCAPS9 caps; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "GetDeviceCaps failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_d3dcolor, &dcl_color); @@ -8123,6 +8141,9 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device) 0, 0, D3DPOOL_MANAGED, &vb, NULL); ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); f_ok = FALSE; s_ok = FALSE; ub_ok = FALSE; @@ -8458,13 +8479,8 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device) IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); } - hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 1, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); IDirect3DVertexBuffer9_Release(vb2); - - out: +out: IDirect3DVertexBuffer9_Release(vb); if(dcl_float) IDirect3DVertexDeclaration9_Release(dcl_float); if(dcl_short) IDirect3DVertexDeclaration9_Release(dcl_short); @@ -8473,6 +8489,11 @@ static void fixed_function_decl_test(IDirect3DDevice9 *device) if(dcl_color_2) IDirect3DVertexDeclaration9_Release(dcl_color_2); if(dcl_ubyte_2) IDirect3DVertexDeclaration9_Release(dcl_ubyte_2); if(dcl_positiont) IDirect3DVertexDeclaration9_Release(dcl_positiont); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void test_vshader_float16(void) @@ -16541,11 +16562,11 @@ START_TEST(visual) pixelshader_blending_test(device_ptr); texture_transform_flags_test(device_ptr); autogen_mipmap_test(device_ptr); - fixed_function_decl_test(device_ptr); cleanup_device(device_ptr); device_ptr = NULL; + fixed_function_decl_test(); conditional_np2_repeat_test(); fixed_function_bumpmap_test(); pointsize_test();
1
0
0
0
Henri Verbeet : d3d9/tests: Use a separate device for conditional_np2_repeat_test().
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: e5589b74a7922e2fb297bfd7bca067547ea6201b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e5589b74a7922e2fb297bfd7b…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 7 10:01:06 2014 +0200 d3d9/tests: Use a separate device for conditional_np2_repeat_test(). --- dlls/d3d9/tests/visual.c | 53 +++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index a46ef4b..18a11a1 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -8646,22 +8646,38 @@ done: DestroyWindow(window); } -static void conditional_np2_repeat_test(IDirect3DDevice9 *device) +static void conditional_np2_repeat_test(void) { - D3DCAPS9 caps; IDirect3DTexture9 *texture; - HRESULT hr; + IDirect3DDevice9 *device; D3DLOCKED_RECT rect; unsigned int x, y; DWORD *dst, color; - const float quad[] = { - -1.0, -1.0, 0.1, -0.2, -0.2, - 1.0, -1.0, 0.1, 1.2, -0.2, - -1.0, 1.0, 0.1, -0.2, 1.2, - 1.0, 1.0, 0.1, 1.2, 1.2 + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, -0.2f, -0.2f, + -1.0f, 1.0f, 0.1f, -0.2f, 1.2f, + 1.0f, -1.0f, 0.1f, 1.2f, -0.2f, + 1.0f, 1.0f, 0.1f, 1.2f, 1.2f, }; - memset(&caps, 0, sizeof(caps)); + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); if (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) @@ -8673,15 +8689,17 @@ static void conditional_np2_repeat_test(IDirect3DDevice9 *device) else if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No conditional NP2 support, skipping conditional NP2 tests\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } else { skip("Card has unconditional NP2 support, skipping conditional NP2 tests\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 10, 10, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &texture, NULL); @@ -8705,6 +8723,8 @@ static void conditional_np2_repeat_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed hr=%08x\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); @@ -8765,9 +8785,12 @@ static void conditional_np2_repeat_test(IDirect3DDevice9 *device) IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void vface_register_test(void) @@ -16519,11 +16542,11 @@ START_TEST(visual) texture_transform_flags_test(device_ptr); autogen_mipmap_test(device_ptr); fixed_function_decl_test(device_ptr); - conditional_np2_repeat_test(device_ptr); cleanup_device(device_ptr); device_ptr = NULL; + conditional_np2_repeat_test(); fixed_function_bumpmap_test(); pointsize_test(); tssargtemp_test();
1
0
0
0
Henri Verbeet : d3d9/tests: Use a separate device for fixed_function_bumpmap_test().
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 3d78a77f7403facfd1791beaa941f7e91dd69128 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d78a77f7403facfd1791beaa…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 7 10:01:05 2014 +0200 d3d9/tests: Use a separate device for fixed_function_bumpmap_test(). --- dlls/d3d9/tests/visual.c | 114 +++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 58 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 2410a90..a46ef4b 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -8929,15 +8929,21 @@ done: DestroyWindow(window); } -static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) +static void fixed_function_bumpmap_test(void) { - HRESULT hr; - DWORD color; - int i; - D3DCAPS9 caps; - BOOL L6V5U5_supported = FALSE; - IDirect3DTexture9 *tex1, *tex2; + IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DTexture9 *texture, *tex1, *tex2; D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + BOOL L6V5U5_supported; + float scale, offset; + IDirect3D9 *d3d; + unsigned int i; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; static const float quad[][7] = { @@ -8946,45 +8952,48 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) { 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f}, { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 1.0f}, }; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, {0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, D3DDECL_END() }; - /* use asymmetric matrix to test loading */ - float bumpenvmat[4] = {0.0,0.5,-0.5,0.0}; - float scale, offset; + static const float bumpenvmat[4] = {0.0f, 0.5f, -0.5f, 0.0f}; - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DTexture9 *texture = NULL; + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); - if(!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP)) { + if (!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP)) + { skip("D3DTEXOPCAPS_BUMPENVMAP not set, skipping bumpmap tests\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + /* This check is disabled, some Windows drivers do not handle + * D3DUSAGE_QUERY_LEGACYBUMPMAP properly. They report that it is not + * supported, but after that bump mapping works properly. So just test if + * the format is generally supported, and check the BUMPENVMAP flag. */ + L6V5U5_supported = SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_L6V5U5)); + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_V8U8))) + { + skip("D3DFMT_V8U8 not supported for legacy bump mapping\n"); + IDirect3DDevice9_Release(device); return; - } else { - /* This check is disabled, some Windows drivers do not handle D3DUSAGE_QUERY_LEGACYBUMPMAP properly. - * They report that it is not supported, but after that bump mapping works properly. So just test - * if the format is generally supported, and check the BUMPENVMAP flag - */ - IDirect3D9 *d3d9; - - IDirect3DDevice9_GetDirect3D(device, &d3d9); - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_L6V5U5); - L6V5U5_supported = SUCCEEDED(hr); - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_V8U8); - IDirect3D9_Release(d3d9); - if(FAILED(hr)) { - skip("D3DFMT_V8U8 not supported for legacy bump mapping\n"); - return; - } } /* Generate the textures */ @@ -9019,10 +9028,9 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_SetVertexShader(device, NULL); ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); - hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (0x%08x)\n", hr); hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); @@ -9065,16 +9073,15 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) IDirect3DTexture9_Release(texture); /* To destroy it */ } - if(!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE)) { - skip("D3DTOP_BUMPENVMAPLUMINANCE not supported, skipping\n"); - goto cleanup; - } - if(L6V5U5_supported == FALSE) { - skip("L6V5U5_supported not supported, skipping D3DTOP_BUMPENVMAPLUMINANCE test\n"); - goto cleanup; + if (!L6V5U5_supported || !(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE)) + { + skip("L6V5U5 / D3DTOP_BUMPENVMAPLUMINANCE not supported, skipping tests.\n"); + IDirect3DVertexDeclaration9_Release(vertex_declaration); + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00000000, 0.0, 0x8); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* This test only tests the luminance part. The bumpmapping part was already tested above and * would only make this test more complicated @@ -9172,23 +9179,14 @@ static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 1, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); - IDirect3DTexture9_Release(tex1); IDirect3DTexture9_Release(tex2); - -cleanup: - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed (%08x)\n", hr); IDirect3DVertexDeclaration9_Release(vertex_declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void stencil_cull_test(void) @@ -16522,11 +16520,11 @@ START_TEST(visual) autogen_mipmap_test(device_ptr); fixed_function_decl_test(device_ptr); conditional_np2_repeat_test(device_ptr); - fixed_function_bumpmap_test(device_ptr); cleanup_device(device_ptr); device_ptr = NULL; + fixed_function_bumpmap_test(); pointsize_test(); tssargtemp_test(); np2_stretch_rect_test();
1
0
0
0
Henri Verbeet : d3d9/tests: Use a separate device for pointsize_test().
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: f3a898a87d52079045551fa6d806d5541187eaca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f3a898a87d52079045551fa6d…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Apr 7 10:01:04 2014 +0200 d3d9/tests: Use a separate device for pointsize_test(). --- dlls/d3d9/tests/visual.c | 112 +++++++++++++++++++++++----------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index af93c80..2410a90 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -9616,61 +9616,71 @@ static BOOL point_match(IDirect3DDevice9 *device, UINT x, UINT y, UINT r) return TRUE; } -static void pointsize_test(IDirect3DDevice9 *device) +static void pointsize_test(void) { - HRESULT hr; - D3DCAPS9 caps; - D3DMATRIX matrix; - D3DMATRIX identity; - float ptsize, ptsize_orig, ptsizemax_orig, ptsizemin_orig; - DWORD color; + float ptsize, ptsizemax_orig, ptsizemin_orig; IDirect3DSurface9 *rt, *backbuffer; IDirect3DTexture9 *tex1, *tex2; - RECT rect = {0, 0, 128, 128}; + IDirect3DDevice9 *device; D3DLOCKED_RECT lr; - const DWORD tex1_data[4] = {0x00ff0000, 0x00ff0000, - 0x00000000, 0x00000000}; - const DWORD tex2_data[4] = {0x00000000, 0x0000ff00, - 0x00000000, 0x0000ff00}; - - const float vertices[] = { - 64, 64, 0.1, - 128, 64, 0.1, - 192, 64, 0.1, - 256, 64, 0.1, - 320, 64, 0.1, - 384, 64, 0.1, - 448, 64, 0.1, - 512, 64, 0.1, - }; - - /* Transforms the coordinate system [-1.0;1.0]x[-1.0;1.0] to [0.0;0.0]x[640.0;480.0]. Z is untouched */ - U(matrix).m[0][0] = 2.0/640.0; U(matrix).m[1][0] = 0.0; U(matrix).m[2][0] = 0.0; U(matrix).m[3][0] =-1.0; - U(matrix).m[0][1] = 0.0; U(matrix).m[1][1] =-2.0/480.0; U(matrix).m[2][1] = 0.0; U(matrix).m[3][1] = 1.0; - U(matrix).m[0][2] = 0.0; U(matrix).m[1][2] = 0.0; U(matrix).m[2][2] = 1.0; U(matrix).m[3][2] = 0.0; - U(matrix).m[0][3] = 0.0; U(matrix).m[1][3] = 0.0; U(matrix).m[2][3] = 0.0; U(matrix).m[3][3] = 1.0; - - U(identity).m[0][0] = 1.0; U(identity).m[1][0] = 0.0; U(identity).m[2][0] = 0.0; U(identity).m[3][0] = 0.0; - U(identity).m[0][1] = 0.0; U(identity).m[1][1] = 1.0; U(identity).m[2][1] = 0.0; U(identity).m[3][1] = 0.0; - U(identity).m[0][2] = 0.0; U(identity).m[1][2] = 0.0; U(identity).m[2][2] = 1.0; U(identity).m[3][2] = 0.0; - U(identity).m[0][3] = 0.0; U(identity).m[1][3] = 0.0; U(identity).m[2][3] = 0.0; U(identity).m[3][3] = 1.0; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const RECT rect = {0, 0, 128, 128}; + static const DWORD tex1_data[4] = {0x00ff0000, 0x00ff0000, 0x00000000, 0x00000000}; + static const DWORD tex2_data[4] = {0x00000000, 0x0000ff00, 0x00000000, 0x0000ff00}; + static const float vertices[] = + { + 64.0f, 64.0f, 0.1f, + 128.0f, 64.0f, 0.1f, + 192.0f, 64.0f, 0.1f, + 256.0f, 64.0f, 0.1f, + 320.0f, 64.0f, 0.1f, + 384.0f, 64.0f, 0.1f, + 448.0f, 64.0f, 0.1f, + 512.0f, 64.0f, 0.1f, + }; + /* Transforms the coordinate system [-1.0;1.0]x[-1.0;1.0] to + * [0.0;0.0]x[640.0;480.0]. Z is untouched. */ + D3DMATRIX matrix = + {{{ + 2.0f / 640.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -2.0 / 480.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + -1.0f, 1.0f, 0.0f, 1.0f, + }}}; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); if(caps.MaxPointSize < 32.0) { skip("MaxPointSize < 32.0, skipping(MaxPointsize = %f)\n", caps.MaxPointSize); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &matrix); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed, hr=%08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed hr=%08x\n", hr); - hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE, (DWORD *) &ptsize_orig); - ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); @@ -9776,7 +9786,7 @@ static void pointsize_test(IDirect3DDevice9 *device) * is no point sprite cap bit in d3d because native d3d software emulates point sprites. Until the * SW emulation is implemented in wined3d, this test will fail on GL drivers that does not support them. */ - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 2, 2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex1, NULL); @@ -9850,7 +9860,7 @@ static void pointsize_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); @@ -9883,23 +9893,13 @@ static void pointsize_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 1, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); IDirect3DTexture9_Release(tex1); IDirect3DTexture9_Release(tex2); - - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSPRITEENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize_orig))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &identity); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed, hr=%08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void multiple_rendertargets_test(void) @@ -16523,11 +16523,11 @@ START_TEST(visual) fixed_function_decl_test(device_ptr); conditional_np2_repeat_test(device_ptr); fixed_function_bumpmap_test(device_ptr); - pointsize_test(device_ptr); cleanup_device(device_ptr); device_ptr = NULL; + pointsize_test(); tssargtemp_test(); np2_stretch_rect_test(); yuv_color_test();
1
0
0
0
Dmitry Timoshkov : include/vfw.h: Properly declare implicit This* parameter.
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 22511c11aaaaed8224dc859dcfaccb8160785cf0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=22511c11aaaaed8224dc859dc…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 7 15:59:00 2014 +0900 include/vfw.h: Properly declare implicit This* parameter. --- include/vfw.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/vfw.h b/include/vfw.h index a2dad18..aa3d4f5 100644 --- a/include/vfw.h +++ b/include/vfw.h @@ -1148,8 +1148,8 @@ DECLARE_INTERFACE_(IAVIStreaming,IUnknown) STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IAVIStreaming methods ***/ - STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE; - STDMETHOD(End)(IAVIStreaming*iface) PURE; + STDMETHOD(Begin)(THIS_ LONG lStart,LONG lEnd,LONG lRate) PURE; + STDMETHOD(End)(THIS) PURE; }; #undef INTERFACE @@ -1174,11 +1174,11 @@ DECLARE_INTERFACE_(IAVIEditStream,IUnknown) STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IAVIEditStream methods ***/ - STDMETHOD(Cut)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; - STDMETHOD(Copy)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; - STDMETHOD(Paste)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE; - STDMETHOD(Clone)(IAVIEditStream*iface,PAVISTREAM*ppResult) PURE; - STDMETHOD(SetInfo)(IAVIEditStream*iface,LPAVISTREAMINFOW asi, LONG size) PURE; + STDMETHOD(Cut)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM *ppResult) PURE; + STDMETHOD(Copy)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM *ppResult) PURE; + STDMETHOD(Paste)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE; + STDMETHOD(Clone)(THIS_ PAVISTREAM *ppResult) PURE; + STDMETHOD(SetInfo)(THIS_ LPAVISTREAMINFOW asi, LONG size) PURE; }; #undef INTERFACE
1
0
0
0
Dmitry Timoshkov : schedsvc: Handle directory creation failure in SchRpcRegisterTask.
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 7e871b94d394e29ee95dad45220012684fef7a9f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7e871b94d394e29ee95dad452…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Apr 7 14:30:23 2014 +0900 schedsvc: Handle directory creation failure in SchRpcRegisterTask. --- dlls/schedsvc/schedsvc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/schedsvc/schedsvc.c b/dlls/schedsvc/schedsvc.c index 1b62b94..aa99b03 100644 --- a/dlls/schedsvc/schedsvc.c +++ b/dlls/schedsvc/schedsvc.c @@ -189,6 +189,11 @@ HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD fl if (!p) p = strrchrW(full_name, '\\'); *p = 0; hr = create_directory(full_name); + if (hr != S_OK && hr != HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) + { + heap_free(full_name); + return hr; + } *p = '\\'; }
1
0
0
0
Nikolay Sivov : services: Remove redundant error code check (Coverity).
by Alexandre Julliard
07 Apr '14
07 Apr '14
Module: wine Branch: master Commit: 5300364dfdb1225afddb8962ce4703927fbe61fc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5300364dfdb1225afddb8962c…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Apr 7 09:25:51 2014 +0400 services: Remove redundant error code check (Coverity). --- programs/services/services.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/services/services.c b/programs/services/services.c index 37f3d65..f6de89d 100644 --- a/programs/services/services.c +++ b/programs/services/services.c @@ -718,8 +718,8 @@ static DWORD service_wait_for_startup(struct service_entry *service_entry, HANDL WINE_TRACE("Service started successfully\n"); return ERROR_SUCCESS; } - if (dwCurrentStatus != SERVICE_START_PENDING) - return ERROR_SERVICE_REQUEST_TIMEOUT; + + return ERROR_SERVICE_REQUEST_TIMEOUT; } }
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
50
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
Results per page:
10
25
50
100
200