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
7839ec87
Commit
7839ec87
authored
May 02, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
May 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Test mipmap GetDC behavior.
parent
a8bcb6c7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
9 deletions
+80
-9
ddraw1.c
dlls/ddraw/tests/ddraw1.c
+25
-3
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+25
-3
ddraw4.c
dlls/ddraw/tests/ddraw4.c
+25
-3
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+5
-0
No files found.
dlls/ddraw/tests/ddraw1.c
View file @
7839ec87
...
...
@@ -4645,7 +4645,7 @@ static void test_palette_complex(void)
IDirectDrawSurface
*
surface
,
*
mipmap
,
*
tmp
;
DDSURFACEDESC
surface_desc
;
IDirectDraw
*
ddraw
;
IDirectDrawPalette
*
palette
,
*
palette2
;
IDirectDrawPalette
*
palette
,
*
palette2
,
*
palette_mipmap
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -4653,6 +4653,9 @@ static void test_palette_complex(void)
DDCAPS
hal_caps
;
PALETTEENTRY
palette_entries
[
256
];
unsigned
int
i
;
HDC
dc
;
RGBQUAD
rgbquad
;
UINT
count
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -4690,6 +4693,13 @@ static void test_palette_complex(void)
palette_entries
,
&
palette
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
memset
(
palette_entries
,
0
,
sizeof
(
palette_entries
));
palette_entries
[
1
].
peRed
=
0xff
;
palette_entries
[
1
].
peGreen
=
0x80
;
hr
=
IDirectDraw_CreatePalette
(
ddraw
,
DDPCAPS_8BIT
|
DDPCAPS_ALLOW256
,
palette_entries
,
&
palette_mipmap
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
palette2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectDrawSurface_GetPalette
(
surface
,
&
palette2
);
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -4712,14 +4722,24 @@ static void test_palette_complex(void)
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x, i %u.
\n
"
,
hr
,
i
);
ok
(
!
palette2
,
"Got unexpected palette %p, i %u.
\n
"
,
palette2
,
i
);
hr
=
IDirectDrawSurface_SetPalette
(
tmp
,
palette
);
hr
=
IDirectDrawSurface_SetPalette
(
tmp
,
palette
_mipmap
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
hr
=
IDirectDrawSurface_GetPalette
(
tmp
,
&
palette2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
ok
(
palette
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
ok
(
palette
_mipmap
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
IDirectDrawPalette_Release
(
palette2
);
hr
=
IDirectDrawSurface_GetDC
(
tmp
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
count
=
GetDIBColorTable
(
dc
,
1
,
1
,
&
rgbquad
);
ok
(
count
==
1
,
"Expected count 1, got %u.
\n
"
,
count
);
ok
(
rgbquad
.
rgbRed
==
0xff
,
"Expected rgbRed = 0xff, got %#x.
\n
"
,
rgbquad
.
rgbRed
);
ok
(
rgbquad
.
rgbGreen
==
0x80
,
"Expected rgbGreen = 0x80, got %#x.
\n
"
,
rgbquad
.
rgbGreen
);
ok
(
rgbquad
.
rgbBlue
==
0x0
,
"Expected rgbBlue = 0x0, got %#x.
\n
"
,
rgbquad
.
rgbBlue
);
hr
=
IDirectDrawSurface_ReleaseDC
(
tmp
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
IDirectDrawSurface_Release
(
mipmap
);
mipmap
=
tmp
;
}
...
...
@@ -4729,6 +4749,8 @@ static void test_palette_complex(void)
IDirectDrawSurface_Release
(
mipmap
);
refcount
=
IDirectDrawSurface_Release
(
surface
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette_mipmap
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
...
...
dlls/ddraw/tests/ddraw2.c
View file @
7839ec87
...
...
@@ -5727,7 +5727,7 @@ static void test_palette_complex(void)
IDirectDrawSurface2
*
surface
,
*
mipmap
,
*
tmp
;
DDSURFACEDESC
surface_desc
;
IDirectDraw2
*
ddraw
;
IDirectDrawPalette
*
palette
,
*
palette2
;
IDirectDrawPalette
*
palette
,
*
palette2
,
*
palette_mipmap
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -5735,6 +5735,9 @@ static void test_palette_complex(void)
DDCAPS
hal_caps
;
PALETTEENTRY
palette_entries
[
256
];
unsigned
int
i
;
HDC
dc
;
RGBQUAD
rgbquad
;
UINT
count
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -5775,6 +5778,13 @@ static void test_palette_complex(void)
palette_entries
,
&
palette
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
memset
(
palette_entries
,
0
,
sizeof
(
palette_entries
));
palette_entries
[
1
].
peRed
=
0xff
;
palette_entries
[
1
].
peGreen
=
0x80
;
hr
=
IDirectDraw2_CreatePalette
(
ddraw
,
DDPCAPS_8BIT
|
DDPCAPS_ALLOW256
,
palette_entries
,
&
palette_mipmap
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
palette2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectDrawSurface2_GetPalette
(
surface
,
&
palette2
);
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -5797,14 +5807,24 @@ static void test_palette_complex(void)
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x, i %u.
\n
"
,
hr
,
i
);
ok
(
!
palette2
,
"Got unexpected palette %p, i %u.
\n
"
,
palette2
,
i
);
hr
=
IDirectDrawSurface2_SetPalette
(
tmp
,
palette
);
hr
=
IDirectDrawSurface2_SetPalette
(
tmp
,
palette
_mipmap
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
hr
=
IDirectDrawSurface2_GetPalette
(
tmp
,
&
palette2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
ok
(
palette
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
ok
(
palette
_mipmap
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
IDirectDrawPalette_Release
(
palette2
);
hr
=
IDirectDrawSurface2_GetDC
(
tmp
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
count
=
GetDIBColorTable
(
dc
,
1
,
1
,
&
rgbquad
);
ok
(
count
==
1
,
"Expected count 1, got %u.
\n
"
,
count
);
ok
(
rgbquad
.
rgbRed
==
0xff
,
"Expected rgbRed = 0xff, got %#x.
\n
"
,
rgbquad
.
rgbRed
);
ok
(
rgbquad
.
rgbGreen
==
0x80
,
"Expected rgbGreen = 0x80, got %#x.
\n
"
,
rgbquad
.
rgbGreen
);
ok
(
rgbquad
.
rgbBlue
==
0x0
,
"Expected rgbBlue = 0x0, got %#x.
\n
"
,
rgbquad
.
rgbBlue
);
hr
=
IDirectDrawSurface2_ReleaseDC
(
tmp
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
IDirectDrawSurface2_Release
(
mipmap
);
mipmap
=
tmp
;
}
...
...
@@ -5814,6 +5834,8 @@ static void test_palette_complex(void)
IDirectDrawSurface2_Release
(
mipmap
);
refcount
=
IDirectDrawSurface2_Release
(
surface
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette_mipmap
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
...
...
dlls/ddraw/tests/ddraw4.c
View file @
7839ec87
...
...
@@ -6622,7 +6622,7 @@ static void test_palette_complex(void)
IDirectDrawSurface4
*
surface
,
*
mipmap
,
*
tmp
;
DDSURFACEDESC2
surface_desc
;
IDirectDraw4
*
ddraw
;
IDirectDrawPalette
*
palette
,
*
palette2
;
IDirectDrawPalette
*
palette
,
*
palette2
,
*
palette_mipmap
;
ULONG
refcount
;
HWND
window
;
HRESULT
hr
;
...
...
@@ -6630,6 +6630,9 @@ static void test_palette_complex(void)
DDCAPS
hal_caps
;
PALETTEENTRY
palette_entries
[
256
];
unsigned
int
i
;
HDC
dc
;
RGBQUAD
rgbquad
;
UINT
count
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
...
...
@@ -6667,6 +6670,13 @@ static void test_palette_complex(void)
palette_entries
,
&
palette
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
memset
(
palette_entries
,
0
,
sizeof
(
palette_entries
));
palette_entries
[
1
].
peRed
=
0xff
;
palette_entries
[
1
].
peGreen
=
0x80
;
hr
=
IDirectDraw4_CreatePalette
(
ddraw
,
DDPCAPS_8BIT
|
DDPCAPS_ALLOW256
,
palette_entries
,
&
palette_mipmap
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create palette, hr %#x.
\n
"
,
hr
);
palette2
=
(
void
*
)
0xdeadbeef
;
hr
=
IDirectDrawSurface4_GetPalette
(
surface
,
&
palette2
);
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x.
\n
"
,
hr
);
...
...
@@ -6689,14 +6699,24 @@ static void test_palette_complex(void)
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x, i %u.
\n
"
,
hr
,
i
);
ok
(
!
palette2
,
"Got unexpected palette %p, i %u.
\n
"
,
palette2
,
i
);
hr
=
IDirectDrawSurface4_SetPalette
(
tmp
,
palette
);
hr
=
IDirectDrawSurface4_SetPalette
(
tmp
,
palette
_mipmap
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
hr
=
IDirectDrawSurface4_GetPalette
(
tmp
,
&
palette2
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get palette, i %u, hr %#x.
\n
"
,
i
,
hr
);
ok
(
palette
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
ok
(
palette
_mipmap
==
palette2
,
"Got unexpected palette %p.
\n
"
,
palette2
);
IDirectDrawPalette_Release
(
palette2
);
hr
=
IDirectDrawSurface4_GetDC
(
tmp
,
&
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
count
=
GetDIBColorTable
(
dc
,
1
,
1
,
&
rgbquad
);
ok
(
count
==
1
,
"Expected count 1, got %u.
\n
"
,
count
);
ok
(
rgbquad
.
rgbRed
==
0xff
,
"Expected rgbRed = 0xff, got %#x.
\n
"
,
rgbquad
.
rgbRed
);
ok
(
rgbquad
.
rgbGreen
==
0x80
,
"Expected rgbGreen = 0x80, got %#x.
\n
"
,
rgbquad
.
rgbGreen
);
ok
(
rgbquad
.
rgbBlue
==
0x0
,
"Expected rgbBlue = 0x0, got %#x.
\n
"
,
rgbquad
.
rgbBlue
);
hr
=
IDirectDrawSurface4_ReleaseDC
(
tmp
,
dc
);
ok
(
SUCCEEDED
(
hr
),
"Failed to release DC, i %u, hr %#x.
\n
"
,
i
,
hr
);
IDirectDrawSurface4_Release
(
mipmap
);
mipmap
=
tmp
;
}
...
...
@@ -6706,6 +6726,8 @@ static void test_palette_complex(void)
IDirectDrawSurface4_Release
(
mipmap
);
refcount
=
IDirectDrawSurface4_Release
(
surface
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette_mipmap
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
refcount
=
IDirectDrawPalette_Release
(
palette
);
ok
(
!
refcount
,
"Got unexpected refcount %u.
\n
"
,
refcount
);
...
...
dlls/ddraw/tests/ddraw7.c
View file @
7839ec87
...
...
@@ -6519,6 +6519,11 @@ static void test_palette_complex(void)
ok
(
hr
==
DDERR_NOPALETTEATTACHED
,
"Got unexpected hr %#x, i %u.
\n
"
,
hr
,
i
);
ok
(
!
palette2
,
"Got unexpected palette %p, i %u.
\n
"
,
palette2
,
i
);
/* Ddraw7 uses the palette of the mipmap for GetDC, just like previous
* ddraw versions. Combined with the test results above this means no
* palette is available. So depending on the driver either GetDC fails
* or the DIB color table contains random data. */
IDirectDrawSurface7_Release
(
mipmap
);
mipmap
=
tmp
;
}
...
...
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