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
8ab39efe
Commit
8ab39efe
authored
Jan 08, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Remove workarounds for SetLayout().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9db0d763
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
58 deletions
+39
-58
bitmap.c
dlls/gdi32/tests/bitmap.c
+14
-25
dc.c
dlls/gdi32/tests/dc.c
+17
-23
mapping.c
dlls/gdi32/tests/mapping.c
+8
-10
No files found.
dlls/gdi32/tests/bitmap.c
View file @
8ab39efe
...
...
@@ -40,7 +40,6 @@ static NTSTATUS (WINAPI *pD3DKMTCreateDCFromMemory)( D3DKMT_CREATEDCFROMMEMORY *
static
NTSTATUS
(
WINAPI
*
pD3DKMTDestroyDCFromMemory
)(
const
D3DKMT_DESTROYDCFROMMEMORY
*
desc
);
static
BOOL
(
WINAPI
*
pGdiAlphaBlend
)(
HDC
,
int
,
int
,
int
,
int
,
HDC
,
int
,
int
,
int
,
int
,
BLENDFUNCTION
);
static
BOOL
(
WINAPI
*
pGdiGradientFill
)(
HDC
,
TRIVERTEX
*
,
ULONG
,
void
*
,
ULONG
,
ULONG
);
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
static
inline
int
get_bitmap_stride
(
int
width
,
int
bpp
)
{
...
...
@@ -4216,15 +4215,9 @@ static void test_GetSetDIBits_rtl(void)
int
ret
;
DWORD
bits_1
[
8
*
8
],
bits_2
[
8
*
8
];
if
(
!
pSetLayout
)
{
win_skip
(
"Don't have SetLayout
\n
"
);
return
;
}
hdc
=
GetDC
(
NULL
);
hdc_mem
=
CreateCompatibleDC
(
hdc
);
p
SetLayout
(
hdc_mem
,
LAYOUT_LTR
);
SetLayout
(
hdc_mem
,
LAYOUT_LTR
);
bitmap
=
CreateCompatibleBitmap
(
hdc
,
8
,
8
);
orig_bitmap
=
SelectObject
(
hdc_mem
,
bitmap
);
...
...
@@ -4244,7 +4237,7 @@ static void test_GetSetDIBits_rtl(void)
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
bits_1
[
56
]
==
0xff0000
,
"got %08x
\n
"
,
bits_1
[
56
]);
/* check we have a red pixel */
p
SetLayout
(
hdc_mem
,
LAYOUT_RTL
);
SetLayout
(
hdc_mem
,
LAYOUT_RTL
);
ret
=
GetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_2
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
...
...
@@ -4254,7 +4247,7 @@ static void test_GetSetDIBits_rtl(void)
/* Now to show that SetDIBits also ignores the mode, we perform a SetDIBits
followed by a GetDIBits and show that the bits remain unchanged. */
p
SetLayout
(
hdc_mem
,
LAYOUT_LTR
);
SetLayout
(
hdc_mem
,
LAYOUT_LTR
);
ret
=
SetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_1
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
...
...
@@ -4262,7 +4255,7 @@ static void test_GetSetDIBits_rtl(void)
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
bits_1
,
bits_2
,
sizeof
(
bits_1
)
),
"bits differ
\n
"
);
p
SetLayout
(
hdc_mem
,
LAYOUT_RTL
);
SetLayout
(
hdc_mem
,
LAYOUT_RTL
);
ret
=
SetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_1
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
...
...
@@ -5165,19 +5158,16 @@ static void test_SetDIBitsToDevice(void)
memset
(
dib_bits
,
0xaa
,
64
*
4
);
SetMapMode
(
hdc
,
MM_TEXT
);
if
(
pSetLayout
)
{
pSetLayout
(
hdc
,
LAYOUT_RTL
);
ret
=
SetDIBitsToDevice
(
hdc
,
1
,
2
,
3
,
2
,
1
,
2
,
1
,
5
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
3
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
(
i
==
36
||
i
==
37
||
i
==
38
||
i
==
44
||
i
==
45
||
i
==
46
)
ok
(
dib_bits
[
i
]
==
data
[
i
-
27
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
pSetLayout
(
hdc
,
LAYOUT_LTR
);
}
SetLayout
(
hdc
,
LAYOUT_RTL
);
ret
=
SetDIBitsToDevice
(
hdc
,
1
,
2
,
3
,
2
,
1
,
2
,
1
,
5
,
data
,
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
3
,
"got %d
\n
"
,
ret
);
for
(
i
=
0
;
i
<
64
;
i
++
)
if
(
i
==
36
||
i
==
37
||
i
==
38
||
i
==
44
||
i
==
45
||
i
==
46
)
ok
(
dib_bits
[
i
]
==
data
[
i
-
27
],
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
else
ok
(
dib_bits
[
i
]
==
0xaaaaaaaa
,
"%d: got %08x
\n
"
,
i
,
dib_bits
[
i
]
);
memset
(
dib_bits
,
0xaa
,
64
*
4
);
SetLayout
(
hdc
,
LAYOUT_LTR
);
/* t-d -> b-u */
info
->
bmiHeader
.
biHeight
=
-
8
;
...
...
@@ -5954,7 +5944,6 @@ START_TEST(bitmap)
pD3DKMTDestroyDCFromMemory
=
(
void
*
)
GetProcAddress
(
hdll
,
"D3DKMTDestroyDCFromMemory"
);
pGdiAlphaBlend
=
(
void
*
)
GetProcAddress
(
hdll
,
"GdiAlphaBlend"
);
pGdiGradientFill
=
(
void
*
)
GetProcAddress
(
hdll
,
"GdiGradientFill"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetLayout"
);
test_createdibitmap
();
test_dibsections
();
...
...
dlls/gdi32/tests/dc.c
View file @
8ab39efe
...
...
@@ -38,8 +38,6 @@
#define LAYOUT_LTR 0
#endif
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
static
void
test_dc_values
(
void
)
{
HDC
hdc
=
CreateDCA
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
...
...
@@ -1002,27 +1000,24 @@ static void test_boundsrect(void)
SetRect
(
&
expect
,
40
,
70
,
100
,
130
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
if
(
pSetLayout
)
{
pSetLayout
(
hdc
,
LAYOUT_RTL
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
159
,
70
,
99
,
130
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
SetRect
(
&
set_rect
,
50
,
25
,
30
,
35
);
ret
=
SetBoundsRect
(
hdc
,
&
set_rect
,
DCB_SET
);
ok
(
ret
==
(
DCB_SET
|
DCB_DISABLE
),
"SetBoundsRect returned %x
\n
"
,
ret
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
50
,
25
,
30
,
35
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
SetLayout
(
hdc
,
LAYOUT_RTL
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
159
,
70
,
99
,
130
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
SetRect
(
&
set_rect
,
50
,
25
,
30
,
35
);
ret
=
SetBoundsRect
(
hdc
,
&
set_rect
,
DCB_SET
);
ok
(
ret
==
(
DCB_SET
|
DCB_DISABLE
),
"SetBoundsRect returned %x
\n
"
,
ret
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
50
,
25
,
30
,
35
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
pSetLayout
(
hdc
,
LAYOUT_LTR
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
149
,
25
,
169
,
35
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
}
SetLayout
(
hdc
,
LAYOUT_LTR
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_SET
,
"GetBoundsRect returned %x
\n
"
,
ret
);
SetRect
(
&
expect
,
149
,
25
,
169
,
35
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Got %s
\n
"
,
wine_dbgstr_rect
(
&
rect
));
/* empty rect resets, except on nt4 */
SetRect
(
&
expect
,
20
,
20
,
10
,
10
);
...
...
@@ -1642,7 +1637,6 @@ static void test_clip_box(void)
START_TEST
(
dc
)
{
pSetLayout
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"gdi32.dll"
),
"SetLayout"
);
test_dc_values
();
test_savedc
();
test_savedc_2
();
...
...
dlls/gdi32/tests/mapping.c
View file @
8ab39efe
...
...
@@ -28,7 +28,6 @@
#include "winuser.h"
#include "winerror.h"
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
static
DWORD
(
WINAPI
*
pGetLayout
)(
HDC
hdc
);
static
INT
(
WINAPI
*
pGetRandomRgn
)(
HDC
hDC
,
HRGN
hRgn
,
INT
iCode
);
static
BOOL
(
WINAPI
*
pGetTransform
)(
HDC
,
DWORD
,
XFORM
*
);
...
...
@@ -247,9 +246,9 @@ static void test_dc_layout(void)
HDC
hdc
;
HRGN
hrgn
;
if
(
!
pGetLayout
||
!
pSetLayout
)
if
(
!
pGetLayout
)
{
win_skip
(
"Don't have
S
etLayout
\n
"
);
win_skip
(
"Don't have
G
etLayout
\n
"
);
return
;
}
...
...
@@ -271,7 +270,7 @@ static void test_dc_layout(void)
expect_world_transform
(
hdc
,
1
.
0
,
1
.
0
);
expect_LPtoDP
(
hdc
,
1000
,
1000
);
p
SetLayout
(
hdc
,
LAYOUT_RTL
);
SetLayout
(
hdc
,
LAYOUT_RTL
);
if
(
!
pGetLayout
(
hdc
))
{
win_skip
(
"SetLayout not supported
\n
"
);
...
...
@@ -310,7 +309,7 @@ static void test_dc_layout(void)
GetClipRgn
(
hdc
,
hrgn
);
GetRgnBox
(
hrgn
,
&
ret_rc
);
ok
(
EqualRect
(
&
rc
,
&
ret_rc
),
"wrong clip box %s
\n
"
,
wine_dbgstr_rect
(
&
ret_rc
));
p
SetLayout
(
hdc
,
LAYOUT_LTR
);
SetLayout
(
hdc
,
LAYOUT_LTR
);
SetRect
(
&
rc
,
80
,
10
,
90
,
20
);
GetClipRgn
(
hdc
,
hrgn
);
GetRgnBox
(
hrgn
,
&
ret_rc
);
...
...
@@ -318,7 +317,7 @@ static void test_dc_layout(void)
GetClipBox
(
hdc
,
&
ret_rc
);
ok
(
EqualRect
(
&
rc
,
&
ret_rc
),
"wrong clip box %s
\n
"
,
wine_dbgstr_rect
(
&
ret_rc
));
IntersectClipRect
(
hdc
,
80
,
10
,
85
,
20
);
p
SetLayout
(
hdc
,
LAYOUT_RTL
);
SetLayout
(
hdc
,
LAYOUT_RTL
);
SetRect
(
&
rc
,
15
,
10
,
20
,
20
);
GetClipRgn
(
hdc
,
hrgn
);
GetRgnBox
(
hrgn
,
&
ret_rc
);
...
...
@@ -326,9 +325,9 @@ static void test_dc_layout(void)
GetClipBox
(
hdc
,
&
ret_rc
);
ok
(
EqualRect
(
&
rc
,
&
ret_rc
),
"wrong clip box %s
\n
"
,
wine_dbgstr_rect
(
&
ret_rc
));
SetRectRgn
(
hrgn
,
60
,
10
,
80
,
20
);
p
SetLayout
(
hdc
,
LAYOUT_LTR
);
SetLayout
(
hdc
,
LAYOUT_LTR
);
ExtSelectClipRgn
(
hdc
,
hrgn
,
RGN_OR
);
p
SetLayout
(
hdc
,
LAYOUT_RTL
);
SetLayout
(
hdc
,
LAYOUT_RTL
);
SetRect
(
&
rc
,
15
,
10
,
40
,
20
);
GetClipRgn
(
hdc
,
hrgn
);
GetRgnBox
(
hrgn
,
&
ret_rc
);
...
...
@@ -370,7 +369,7 @@ static void test_dc_layout(void)
SetMapMode
(
hdc
,
MM_TEXT
);
ret
=
GetMapMode
(
hdc
);
ok
(
ret
==
MM_ANISOTROPIC
,
"expected MM_ANISOTROPIC, got %d
\n
"
,
ret
);
p
SetLayout
(
hdc
,
LAYOUT_LTR
);
SetLayout
(
hdc
,
LAYOUT_LTR
);
ret
=
GetMapMode
(
hdc
);
ok
(
ret
==
MM_ANISOTROPIC
,
"expected MM_ANISOTROPIC, got %d
\n
"
,
ret
);
SetMapMode
(
hdc
,
MM_TEXT
);
...
...
@@ -715,7 +714,6 @@ START_TEST(mapping)
{
HMODULE
mod
=
GetModuleHandleA
(
"gdi32.dll"
);
pGetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"GetLayout"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
mod
,
"SetLayout"
);
pGetRandomRgn
=
(
void
*
)
GetProcAddress
(
mod
,
"GetRandomRgn"
);
pGetTransform
=
(
void
*
)
GetProcAddress
(
mod
,
"GetTransform"
);
pSetVirtualResolution
=
(
void
*
)
GetProcAddress
(
mod
,
"SetVirtualResolution"
);
...
...
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