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
18964c96
Commit
18964c96
authored
Sep 16, 2016
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add tests for GdipBeginContainer.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f5b14a7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
173 additions
and
0 deletions
+173
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+173
-0
No files found.
dlls/gdiplus/tests/graphics.c
View file @
18964c96
...
...
@@ -5897,6 +5897,178 @@ static void test_GdipGetVisibleClipBounds_memoryDC(void)
ReleaseDC
(
hwnd
,
dc
);
}
static
void
test_container_rects
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
;
HDC
hdc
=
GetDC
(
hwnd
);
GpRectF
dstrect
,
srcrect
;
GraphicsContainer
state
;
static
const
GpPointF
test_points
[
3
]
=
{{
0
.
0
,
0
.
0
},
{
1
.
0
,
0
.
0
},
{
0
.
0
,
1
.
0
}};
GpPointF
points
[
3
];
REAL
dpix
,
dpiy
;
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
dstrect
.
X
=
0
.
0
;
dstrect
.
Y
=
0
.
0
;
dstrect
.
Width
=
1
.
0
;
dstrect
.
Height
=
1
.
0
;
srcrect
=
dstrect
;
status
=
GdipGetDpiX
(
graphics
,
&
dpix
);
expect
(
Ok
,
status
);
status
=
GdipGetDpiY
(
graphics
,
&
dpiy
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitWorld
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitDisplay
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitMillimeter
+
1
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
NULL
,
&
dstrect
,
&
srcrect
,
UnitPixel
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
NULL
,
&
srcrect
,
UnitPixel
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
NULL
,
UnitPixel
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
-
1
,
&
state
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitPixel
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitPixel
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
0
.
0
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
1
.
0
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
0
.
0
,
points
[
2
].
X
);
expectf
(
1
.
0
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitInch
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
0
.
0
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
1
.
0
/
dpix
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
0
.
0
,
points
[
2
].
X
);
expectf
(
1
.
0
/
dpiy
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
status
=
GdipScaleWorldTransform
(
graphics
,
2
.
0
,
2
.
0
,
MatrixOrderPrepend
);
expect
(
Ok
,
status
);
dstrect
.
X
=
1
.
0
;
dstrect
.
Height
=
3
.
0
;
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitPixel
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
2
.
0
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
4
.
0
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
2
.
0
,
points
[
2
].
X
);
expectf
(
6
.
0
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
0
.
0
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
2
.
0
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
0
.
0
,
points
[
2
].
X
);
expectf
(
2
.
0
,
points
[
2
].
Y
);
status
=
GdipResetWorldTransform
(
graphics
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitInch
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
1
.
0
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
((
dpix
+
1
.
0
)
/
dpix
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
1
.
0
,
points
[
2
].
X
);
expectf
(
3
.
0
/
dpiy
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
status
=
GdipSetPageUnit
(
graphics
,
UnitInch
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitPixel
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
dpix
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
dpix
*
2
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
dpix
,
points
[
2
].
X
);
expectf
(
dpiy
*
3
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
status
=
GdipBeginContainer
(
graphics
,
&
dstrect
,
&
srcrect
,
UnitInch
,
&
state
);
expect
(
Ok
,
status
);
memcpy
(
points
,
test_points
,
sizeof
(
points
));
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpaceDevice
,
CoordinateSpaceWorld
,
points
,
3
);
expect
(
Ok
,
status
);
expectf
(
dpix
,
points
[
0
].
X
);
expectf
(
0
.
0
,
points
[
0
].
Y
);
expectf
(
dpix
+
1
.
0
,
points
[
1
].
X
);
expectf
(
0
.
0
,
points
[
1
].
Y
);
expectf
(
dpix
,
points
[
2
].
X
);
expectf
(
3
.
0
,
points
[
2
].
Y
);
status
=
GdipEndContainer
(
graphics
,
state
);
expect
(
Ok
,
status
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
hwnd
,
hdc
);
}
START_TEST
(
graphics
)
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
...
@@ -5970,6 +6142,7 @@ START_TEST(graphics)
test_bitmapfromgraphics
();
test_GdipFillRectangles
();
test_GdipGetVisibleClipBounds_memoryDC
();
test_container_rects
();
GdiplusShutdown
(
gdiplusToken
);
DestroyWindow
(
hwnd
);
...
...
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