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
732aa89c
Commit
732aa89c
authored
Feb 14, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Feb 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add test for ImageLockModeUserInputBuf.
parent
86d58dc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
image.c
dlls/gdiplus/tests/image.c
+85
-0
No files found.
dlls/gdiplus/tests/image.c
View file @
732aa89c
...
...
@@ -621,6 +621,90 @@ static void test_LockBits(void)
expect
(
Ok
,
stat
);
}
static
void
test_LockBits_UserBuf
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bm
;
GpRect
rect
;
BitmapData
bd
;
const
INT
WIDTH
=
10
,
HEIGHT
=
20
;
DWORD
bits
[
200
];
ARGB
color
;
bm
=
NULL
;
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat32bppARGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
memset
(
bits
,
0xaa
,
sizeof
(
bits
));
rect
.
X
=
2
;
rect
.
Y
=
3
;
rect
.
Width
=
4
;
rect
.
Height
=
5
;
bd
.
Width
=
4
;
bd
.
Height
=
6
;
bd
.
Stride
=
WIDTH
*
4
;
bd
.
PixelFormat
=
PixelFormat32bppARGB
;
bd
.
Scan0
=
&
bits
[
2
+
3
*
WIDTH
];
bd
.
Reserved
=
0xaaaaaaaa
;
/* read-only */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
|
ImageLockModeUserInputBuf
,
PixelFormat32bppARGB
,
&
bd
);
todo_wine
expect
(
Ok
,
stat
);
expect
(
0xaaaaaaaa
,
bits
[
0
]);
todo_wine
expect
(
0
,
bits
[
2
+
3
*
WIDTH
]);
bits
[
2
+
3
*
WIDTH
]
=
0xdeadbeef
;
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipBitmapGetPixel
(
bm
,
2
,
3
,
&
color
);
expect
(
Ok
,
stat
);
expect
(
0
,
color
);
/* write-only */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeWrite
|
ImageLockModeUserInputBuf
,
PixelFormat32bppARGB
,
&
bd
);
todo_wine
expect
(
Ok
,
stat
);
expect
(
0xdeadbeef
,
bits
[
2
+
3
*
WIDTH
]);
bits
[
2
+
3
*
WIDTH
]
=
0x12345678
;
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipBitmapGetPixel
(
bm
,
2
,
3
,
&
color
);
expect
(
Ok
,
stat
);
todo_wine
expect
(
0x12345678
,
color
);
bits
[
2
+
3
*
WIDTH
]
=
0
;
/* read/write */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
|
ImageLockModeWrite
|
ImageLockModeUserInputBuf
,
PixelFormat32bppARGB
,
&
bd
);
todo_wine
expect
(
Ok
,
stat
);
todo_wine
expect
(
0x12345678
,
bits
[
2
+
3
*
WIDTH
]);
bits
[
2
+
3
*
WIDTH
]
=
0xdeadbeef
;
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipBitmapGetPixel
(
bm
,
2
,
3
,
&
color
);
expect
(
Ok
,
stat
);
todo_wine
expect
(
0xdeadbeef
,
color
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
}
static
void
test_GdipCreateBitmapFromHBITMAP
(
void
)
{
GpBitmap
*
gpbm
=
NULL
;
...
...
@@ -2295,6 +2379,7 @@ START_TEST(image)
test_SavingImages
();
test_encoders
();
test_LockBits
();
test_LockBits_UserBuf
();
test_GdipCreateBitmapFromHBITMAP
();
test_GdipGetImageFlags
();
test_GdipCloneImage
();
...
...
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