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
a9c72d87
Commit
a9c72d87
authored
Oct 13, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Nov 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a test for YV12 partial block locks and lock offsets.
parent
b0782481
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
overlay.c
dlls/ddraw/tests/overlay.c
+18
-1
No files found.
dlls/ddraw/tests/overlay.c
View file @
a9c72d87
/*
* Unit tests for DirectDraw overlay functions
*
* Copyright (C) 2008 Stefan Dösinger for CodeWeavers
* Copyright (C) 2008
,2011
Stefan Dösinger for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -195,6 +195,9 @@ static void yv12_test(void)
HRESULT
hr
;
DDSURFACEDESC2
desc
;
IDirectDrawSurface7
*
surface
;
char
*
base
;
RECT
rect
=
{
13
,
17
,
14
,
18
};
unsigned
int
offset
;
surface
=
create_overlay
(
256
,
256
,
MAKEFOURCC
(
'Y'
,
'V'
,
'1'
,
'2'
));
if
(
!
surface
)
{
...
...
@@ -217,6 +220,20 @@ static void yv12_test(void)
/* The overlay pitch seems to have 256 byte alignment */
ok
((
U1
(
desc
).
lPitch
&
0xff
)
==
0
,
"Expected 256 byte aligned pitch, got %u
\n
"
,
U1
(
desc
).
lPitch
);
base
=
desc
.
lpSurface
;
hr
=
IDirectDrawSurface7_Unlock
(
surface
,
NULL
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface7_Unlock returned 0x%08x, expected DD_OK
\n
"
,
hr
);
/* YV12 uses 2x2 blocks with 6 bytes per block(4*Y, 1*U, 1*V). Unlike other block-based formats like DXT
* the entire Y channel is stored in one big chunk of memory, followed by the chroma channels. So
* partial locks do not really make sense. Show that they are allowed nevertheless and the offset points
* into the luminance data */
hr
=
IDirectDrawSurface7_Lock
(
surface
,
&
rect
,
&
desc
,
0
,
NULL
);
ok
(
hr
==
DD_OK
,
"Partial lock of a YV12 surface returned 0x%08x, expected DD_OK
\n
"
,
hr
);
offset
=
((
const
char
*
)
desc
.
lpSurface
-
base
);
ok
(
offset
==
rect
.
top
*
U1
(
desc
).
lPitch
+
rect
.
left
,
"Expected %u byte offset from partial lock, got %u
\n
"
,
rect
.
top
*
U1
(
desc
).
lPitch
+
rect
.
left
,
offset
);
hr
=
IDirectDrawSurface7_Unlock
(
surface
,
NULL
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface7_Unlock returned 0x%08x, expected DD_OK
\n
"
,
hr
);
...
...
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