Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e2f1bd4f
Commit
e2f1bd4f
authored
Jun 23, 2011
by
Huw Davies
Committed by
Alexandre Julliard
Jun 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32/tests: Show that Get/SetDIBits ignore the layout mode.
parent
7a0363cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
0 deletions
+70
-0
bitmap.c
dlls/gdi32/tests/bitmap.c
+70
-0
No files found.
dlls/gdi32/tests/bitmap.c
View file @
e2f1bd4f
...
...
@@ -33,6 +33,7 @@
#include "wine/test.h"
static
BOOL
(
WINAPI
*
pGdiAlphaBlend
)(
HDC
,
int
,
int
,
int
,
int
,
HDC
,
int
,
int
,
int
,
int
,
BLENDFUNCTION
);
static
DWORD
(
WINAPI
*
pSetLayout
)(
HDC
hdc
,
DWORD
layout
);
#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
...
...
@@ -3080,12 +3081,80 @@ static void test_GetDIBits_top_down(int bpp)
DeleteObject
(
bmptb
);
}
static
void
test_GetSetDIBits_rtl
(
void
)
{
HDC
hdc
,
hdc_mem
;
HBITMAP
bitmap
,
orig_bitmap
;
BITMAPINFO
info
;
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
);
pSetLayout
(
hdc_mem
,
LAYOUT_LTR
);
bitmap
=
CreateCompatibleBitmap
(
hdc
,
8
,
8
);
orig_bitmap
=
SelectObject
(
hdc_mem
,
bitmap
);
SetPixel
(
hdc_mem
,
0
,
0
,
RGB
(
0xff
,
0
,
0
)
);
SelectObject
(
hdc_mem
,
orig_bitmap
);
info
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
info
.
bmiHeader
.
biWidth
=
8
;
info
.
bmiHeader
.
biHeight
=
8
;
info
.
bmiHeader
.
biPlanes
=
1
;
info
.
bmiHeader
.
biBitCount
=
32
;
info
.
bmiHeader
.
biCompression
=
BI_RGB
;
/* First show that GetDIBits ignores the layout mode. */
ret
=
GetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_1
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
bits_1
[
56
]
==
0xff0000
,
"got %08x
\n
"
,
bits_1
[
56
]);
/* check we have a red pixel */
pSetLayout
(
hdc_mem
,
LAYOUT_RTL
);
ret
=
GetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_2
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
bits_1
,
bits_2
,
sizeof
(
bits_1
)
),
"bits differ
\n
"
);
/* Now to show that SetDIBits also ignores the mode, we perform a SetDIBits
followed by a GetDIBits and show that the bits remain unchanged. */
pSetLayout
(
hdc_mem
,
LAYOUT_LTR
);
ret
=
SetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_1
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ret
=
GetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_2
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
bits_1
,
bits_2
,
sizeof
(
bits_1
)
),
"bits differ
\n
"
);
pSetLayout
(
hdc_mem
,
LAYOUT_RTL
);
ret
=
SetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_1
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ret
=
GetDIBits
(
hdc_mem
,
bitmap
,
0
,
8
,
bits_2
,
&
info
,
DIB_RGB_COLORS
);
ok
(
ret
==
8
,
"got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
bits_1
,
bits_2
,
sizeof
(
bits_1
)
),
"bits differ
\n
"
);
DeleteObject
(
bitmap
);
DeleteDC
(
hdc_mem
);
ReleaseDC
(
NULL
,
hdc
);
}
START_TEST
(
bitmap
)
{
HMODULE
hdll
;
hdll
=
GetModuleHandle
(
"gdi32.dll"
);
pGdiAlphaBlend
=
(
void
*
)
GetProcAddress
(
hdll
,
"GdiAlphaBlend"
);
pSetLayout
=
(
void
*
)
GetProcAddress
(
hdll
,
"SetLayout"
);
test_createdibitmap
();
test_dibsections
();
...
...
@@ -3112,4 +3181,5 @@ START_TEST(bitmap)
test_GetDIBits_top_down
(
16
);
test_GetDIBits_top_down
(
24
);
test_GetDIBits_top_down
(
32
);
test_GetSetDIBits_rtl
();
}
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