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
738e74a1
Commit
738e74a1
authored
Mar 07, 2008
by
Nathan Beckmann
Committed by
Alexandre Julliard
Mar 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Tests for GdipLockBitmapBits/GdipUnlockBitmapBits.
parent
5e1dd957
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
image.c
dlls/gdiplus/tests/image.c
+106
-0
No files found.
dlls/gdiplus/tests/image.c
View file @
738e74a1
...
...
@@ -171,6 +171,111 @@ static void test_encoders(void)
GdipFree
(
codecs
);
}
static
void
test_LockBits
(
void
)
{
GpStatus
stat
;
GpBitmap
*
bm
;
GpRect
rect
;
BitmapData
bd
;
const
REAL
WIDTH
=
10
.
0
,
HEIGHT
=
20
.
0
;
bm
=
NULL
;
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
rect
.
X
=
2
;
rect
.
Y
=
3
;
rect
.
Width
=
4
;
rect
.
Height
=
5
;
/* read-only */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
/* read-only, consecutive */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
/* read x2 */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
todo_wine
{
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
WrongState
,
stat
);
}
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
/* write, no modification */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeWrite
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
/* write, consecutive */
todo_wine
{
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeWrite
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
}
if
(
stat
==
Ok
)
{
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
/* write, modify */
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeWrite
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
if
(
stat
==
Ok
)
{
if
(
bd
.
Scan0
)
((
char
*
)
bd
.
Scan0
)[
2
]
=
0xff
;
stat
=
GdipBitmapUnlockBits
(
bm
,
&
bd
);
expect
(
Ok
,
stat
);
}
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
/* dispose locked */
stat
=
GdipCreateBitmapFromScan0
(
WIDTH
,
HEIGHT
,
0
,
PixelFormat24bppRGB
,
NULL
,
&
bm
);
expect
(
Ok
,
stat
);
stat
=
GdipBitmapLockBits
(
bm
,
&
rect
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
bd
);
expect
(
Ok
,
stat
);
stat
=
GdipDisposeImage
((
GpImage
*
)
bm
);
expect
(
Ok
,
stat
);
}
START_TEST
(
image
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -187,6 +292,7 @@ START_TEST(image)
test_GetImageDimension
();
test_LoadingImages
();
test_encoders
();
test_LockBits
();
GdiplusShutdown
(
gdiplusToken
);
}
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