Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
ae519aff
Commit
ae519aff
authored
Mar 13, 2018
by
Matteo Bruni
Committed by
Alexandre Julliard
Mar 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9/tests: Add a few missing surface Release() calls.
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9682095a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
44 deletions
+26
-44
texture.c
dlls/d3dx9_36/tests/texture.c
+26
-44
No files found.
dlls/d3dx9_36/tests/texture.c
View file @
ae519aff
...
...
@@ -1563,28 +1563,25 @@ static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
IDirect3DTexture9_Release
(
texture
);
IDirect3DTexture9_Release
(
texture
);
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DUSAGE_DYNAMIC
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
IDirect3DTexture9_Release
(
texture
);
IDirect3DTexture9_Release
(
texture
);
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_24bit
,
sizeof
(
dds_24bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DUSAGE_DYNAMIC
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_SKIP_DDS_MIP_LEVELS
(
1
,
D3DX_FILTER_POINT
),
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
miplevels
=
IDirect3DTexture9_GetLevelCount
(
texture
);
ok
(
miplevels
==
1
,
"Got miplevels %u, expected %u
\n
"
,
miplevels
,
1
);
ok
(
miplevels
==
1
,
"Got miplevels %u, expected %u.
\n
"
,
miplevels
,
1
);
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Width
==
1
&&
desc
.
Height
==
1
,
"Surface dimensions are %ux%u, expected 1x1.
\n
"
,
desc
.
Width
,
desc
.
Height
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
if
(
!
is_autogenmipmap_supported
(
device
,
D3DRTYPE_TEXTURE
))
{
...
...
@@ -1595,110 +1592,92 @@ static void test_D3DXCreateTextureFromFileInMemoryEx(IDirect3DDevice9 *device)
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DUSAGE_DYNAMIC
|
D3DUSAGE_AUTOGENMIPMAP
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
IDirect3DTexture9_Release
(
texture
);
IDirect3DTexture9_Release
(
texture
);
/* Checking for color key format overrides. */
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_X1R5G5B5
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_X1R5G5B5
);
ok
(
desc
.
Format
==
D3DFMT_X1R5G5B5
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_X1R5G5B5
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_A1R5G5B5
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_A1R5G5B5
);
ok
(
desc
.
Format
==
D3DFMT_A1R5G5B5
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_A1R5G5B5
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_16bit
,
sizeof
(
dds_16bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_X1R5G5B5
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_X1R5G5B5
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_X1R5G5B5
);
ok
(
desc
.
Format
==
D3DFMT_X1R5G5B5
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_X1R5G5B5
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_24bit
,
sizeof
(
dds_24bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_X8R8G8B8
);
ok
(
desc
.
Format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_X8R8G8B8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_24bit
,
sizeof
(
dds_24bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_A8R8G8B8
);
ok
(
desc
.
Format
==
D3DFMT_A8R8G8B8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_A8R8G8B8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
dds_24bit
,
sizeof
(
dds_24bit
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_X8R8G8B8
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_X8R8G8B8
);
ok
(
desc
.
Format
==
D3DFMT_X8R8G8B8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_X8R8G8B8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
png_grayscale
,
sizeof
(
png_grayscale
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_L8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_L8
);
ok
(
desc
.
Format
==
D3DFMT_L8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_L8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
png_grayscale
,
sizeof
(
png_grayscale
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_UNKNOWN
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_A8L8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_A8L8
);
ok
(
desc
.
Format
==
D3DFMT_A8L8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_A8L8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
hr
=
D3DXCreateTextureFromFileInMemoryEx
(
device
,
png_grayscale
,
sizeof
(
png_grayscale
),
D3DX_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0
,
D3DFMT_L8
,
D3DPOOL_DEFAULT
,
D3DX_DEFAULT
,
D3DX_DEFAULT
,
0xff000000
,
NULL
,
NULL
,
&
texture
);
ok
(
hr
==
D3D_OK
,
"D3DXCreateTextureFromFileInMemoryEx returned %#x, expected %#x.
\n
"
,
hr
,
D3D_OK
);
if
(
SUCCEEDED
(
hr
))
{
IDirect3DTexture9_GetSurfaceLevel
(
texture
,
0
,
&
surface
);
IDirect3DSurface9_GetDesc
(
surface
,
&
desc
);
ok
(
desc
.
Format
==
D3DFMT_L8
,
"Returned format %u, expected %u
\n
"
,
desc
.
Format
,
D3DFMT_L8
);
ok
(
desc
.
Format
==
D3DFMT_L8
,
"Returned format %u, expected %u.
\n
"
,
desc
.
Format
,
D3DFMT_L8
);
IDirect3DSurface9_Release
(
surface
);
IDirect3DTexture9_Release
(
texture
);
}
}
static
void
test_D3DXCreateCubeTextureFromFileInMemory
(
IDirect3DDevice9
*
device
)
...
...
@@ -2222,6 +2201,7 @@ START_TEST(texture)
IDirect3DDevice9
*
device
;
D3DPRESENT_PARAMETERS
d3dpp
;
HRESULT
hr
;
ULONG
ref
;
if
(
!
(
wnd
=
CreateWindowA
(
"static"
,
"d3dx9_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
NULL
,
NULL
,
NULL
,
NULL
)))
...
...
@@ -2274,7 +2254,9 @@ START_TEST(texture)
test_D3DXCreateVolumeTextureFromFileInMemory
(
device
);
test_D3DXSaveTextureToFileInMemory
(
device
);
IDirect3DDevice9_Release
(
device
);
ref
=
IDirect3DDevice9_Release
(
device
);
ok
(
!
ref
,
"Device has %u references left.
\n
"
,
ref
);
IDirect3D9_Release
(
d3d
);
DestroyWindow
(
wnd
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment