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
ada3aea7
Commit
ada3aea7
authored
Feb 25, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Feb 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add some tests for ARGB conversions.
parent
eab914b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
image.c
dlls/gdiplus/tests/image.c
+72
-0
No files found.
dlls/gdiplus/tests/image.c
View file @
ada3aea7
...
...
@@ -4107,6 +4107,77 @@ static void test_gif_properties(void)
GdipDisposeImage
(
image
);
}
static
void
test_ARGB_conversion
(
void
)
{
BYTE
argb
[
8
]
=
{
0x11
,
0x22
,
0x33
,
0x80
,
0xff
,
0xff
,
0xff
,
0
};
BYTE
pargb
[
8
]
=
{
0x09
,
0x11
,
0x1a
,
0x80
,
0
,
0
,
0
,
0
};
BYTE
rgb32_xp
[
8
]
=
{
0x11
,
0x22
,
0x33
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
};
BYTE
rgb24
[
6
]
=
{
0x11
,
0x22
,
0x33
,
0xff
,
0xff
,
0xff
};
BYTE
*
bits
;
GpBitmap
*
bitmap
;
BitmapData
data
;
GpStatus
status
;
int
match
;
status
=
GdipCreateBitmapFromScan0
(
2
,
1
,
8
,
PixelFormat32bppARGB
,
argb
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipBitmapLockBits
(
bitmap
,
NULL
,
ImageLockModeRead
,
PixelFormat32bppPARGB
,
&
data
);
expect
(
Ok
,
status
);
ok
(
data
.
Width
==
2
,
"expected 2, got %d
\n
"
,
data
.
Width
);
ok
(
data
.
Height
==
1
,
"expected 1, got %d
\n
"
,
data
.
Height
);
ok
(
data
.
Stride
==
8
,
"expected 8, got %d
\n
"
,
data
.
Stride
);
ok
(
data
.
PixelFormat
==
PixelFormat32bppPARGB
,
"expected PixelFormat32bppPARGB, got %d
\n
"
,
data
.
PixelFormat
);
match
=
!
memcmp
(
data
.
Scan0
,
pargb
,
sizeof
(
pargb
));
todo_wine
ok
(
match
,
"bits don't match
\n
"
);
if
(
!
match
)
{
bits
=
data
.
Scan0
;
trace
(
"format %#x, bits %02x,%02x,%02x,%02x %02x,%02x,%02x,%02x
\n
"
,
PixelFormat32bppPARGB
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
],
bits
[
4
],
bits
[
5
],
bits
[
6
],
bits
[
7
]);
}
status
=
GdipBitmapUnlockBits
(
bitmap
,
&
data
);
expect
(
Ok
,
status
);
status
=
GdipBitmapLockBits
(
bitmap
,
NULL
,
ImageLockModeRead
,
PixelFormat32bppRGB
,
&
data
);
expect
(
Ok
,
status
);
ok
(
data
.
Width
==
2
,
"expected 2, got %d
\n
"
,
data
.
Width
);
ok
(
data
.
Height
==
1
,
"expected 1, got %d
\n
"
,
data
.
Height
);
ok
(
data
.
Stride
==
8
,
"expected 8, got %d
\n
"
,
data
.
Stride
);
ok
(
data
.
PixelFormat
==
PixelFormat32bppRGB
,
"expected PixelFormat32bppRGB, got %d
\n
"
,
data
.
PixelFormat
);
match
=
!
memcmp
(
data
.
Scan0
,
argb
,
sizeof
(
argb
))
||
!
memcmp
(
data
.
Scan0
,
rgb32_xp
,
sizeof
(
rgb32_xp
));
ok
(
match
,
"bits don't match
\n
"
);
if
(
!
match
)
{
bits
=
data
.
Scan0
;
trace
(
"format %#x, bits %02x,%02x,%02x,%02x %02x,%02x,%02x,%02x
\n
"
,
PixelFormat32bppRGB
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
],
bits
[
4
],
bits
[
5
],
bits
[
6
],
bits
[
7
]);
}
status
=
GdipBitmapUnlockBits
(
bitmap
,
&
data
);
expect
(
Ok
,
status
);
status
=
GdipBitmapLockBits
(
bitmap
,
NULL
,
ImageLockModeRead
,
PixelFormat24bppRGB
,
&
data
);
expect
(
Ok
,
status
);
ok
(
data
.
Width
==
2
,
"expected 2, got %d
\n
"
,
data
.
Width
);
ok
(
data
.
Height
==
1
,
"expected 1, got %d
\n
"
,
data
.
Height
);
ok
(
data
.
Stride
==
8
,
"expected 8, got %d
\n
"
,
data
.
Stride
);
ok
(
data
.
PixelFormat
==
PixelFormat24bppRGB
,
"expected PixelFormat24bppRGB, got %d
\n
"
,
data
.
PixelFormat
);
match
=
!
memcmp
(
data
.
Scan0
,
rgb24
,
sizeof
(
rgb24
));
ok
(
match
,
"bits don't match
\n
"
);
if
(
!
match
)
{
bits
=
data
.
Scan0
;
trace
(
"format %#x, bits %02x,%02x,%02x,%02x %02x,%02x,%02x,%02x
\n
"
,
PixelFormat24bppRGB
,
bits
[
0
],
bits
[
1
],
bits
[
2
],
bits
[
3
],
bits
[
4
],
bits
[
5
],
bits
[
6
],
bits
[
7
]);
}
status
=
GdipBitmapUnlockBits
(
bitmap
,
&
data
);
expect
(
Ok
,
status
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
START_TEST
(
image
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -4119,6 +4190,7 @@ START_TEST(image)
GdiplusStartup
(
&
gdiplusToken
,
&
gdiplusStartupInput
,
NULL
);
test_ARGB_conversion
();
test_DrawImage_scale
();
test_image_format
();
test_DrawImage
();
...
...
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