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
73aed1b5
Commit
73aed1b5
authored
Oct 26, 2023
by
Jeff Smith
Committed by
Alexandre Julliard
Oct 26, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus/tests: Add tests related to setting the page tranform.
parent
1b06627a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+97
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/tests/graphics.c
View file @
73aed1b5
...
...
@@ -1828,6 +1828,9 @@ static void test_Get_Release_DC(void)
/* GdipMeasureString */
status
=
GdipResetClip
(
graphics
);
expect
(
ObjectBusy
,
status
);
status
=
GdipResetPageTransform
(
graphics
);
todo_wine
expect
(
ObjectBusy
,
status
);
status
=
GdipResetWorldTransform
(
graphics
);
expect
(
ObjectBusy
,
status
);
/* GdipRestoreGraphics */
...
...
@@ -1844,6 +1847,9 @@ static void test_Get_Release_DC(void)
expect
(
ObjectBusy
,
status
);
status
=
GdipSetPageScale
(
graphics
,
1
.
0
);
expect
(
ObjectBusy
,
status
);
status
=
GdipSetPageScale
(
graphics
,
0
.
0
);
todo_wine
expect
(
ObjectBusy
,
status
);
status
=
GdipSetPageUnit
(
graphics
,
UnitWorld
);
expect
(
ObjectBusy
,
status
);
status
=
GdipSetPixelOffsetMode
(
graphics
,
PixelOffsetModeDefault
);
...
...
@@ -4058,6 +4064,96 @@ static void test_transform(void)
}
}
static
void
test_set_page_transform
(
void
)
{
static
const
struct
{
GpUnit
unit
;
BOOL
isInvalid
;
}
td_unit
[]
=
{
{
UnitWorld
,
TRUE
},
{
UnitDisplay
},
{
UnitPixel
},
{
UnitPoint
},
{
UnitInch
},
{
UnitDocument
},
{
UnitMillimeter
},
{
UnitMillimeter
+
1
,
TRUE
},
};
static
const
struct
{
REAL
scale
;
BOOL
isInvalid
;
}
td_scale
[]
=
{
{
-
1
.
0
,
TRUE
},
{
0
.
0
,
TRUE
},
{
0
.
5
},
{
1
.
0
},
{
2
.
0
},
};
GpStatus
status
;
GpGraphics
*
graphics
;
HDC
hdc
=
GetDC
(
hwnd
);
GpUnit
unit
;
REAL
scale
;
UINT
i
;
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
td_unit
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
status
=
GdipSetPageUnit
(
graphics
,
td_unit
[
i
].
unit
);
todo_wine_if
(
td_unit
[
i
].
unit
>
UnitMillimeter
)
expect
(
td_unit
[
i
].
isInvalid
?
InvalidParameter
:
Ok
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetPageUnit
(
graphics
,
&
unit
);
expect
(
Ok
,
status
);
expect
(
td_unit
[
i
].
unit
,
unit
);
}
winetest_pop_context
();
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
td_scale
);
i
++
)
{
winetest_push_context
(
"%u"
,
i
);
status
=
GdipSetPageScale
(
graphics
,
td_scale
[
i
].
scale
);
expect
(
td_scale
[
i
].
isInvalid
?
InvalidParameter
:
Ok
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetPageScale
(
graphics
,
&
scale
);
expect
(
Ok
,
status
);
expectf_
(
td_scale
[
i
].
scale
,
scale
,
0
);
}
winetest_pop_context
();
}
status
=
GdipGetPageUnit
(
graphics
,
&
unit
);
expect
(
Ok
,
status
);
todo_wine
expect
(
UnitMillimeter
,
unit
);
status
=
GdipGetPageScale
(
graphics
,
&
scale
);
expect
(
Ok
,
status
);
expectf_
(
2
.
0
,
scale
,
0
);
status
=
GdipResetPageTransform
(
graphics
);
todo_wine
expect
(
Ok
,
status
);
status
=
GdipGetPageUnit
(
graphics
,
&
unit
);
expect
(
Ok
,
status
);
todo_wine
expect
(
UnitDisplay
,
unit
);
status
=
GdipGetPageScale
(
graphics
,
&
scale
);
expect
(
Ok
,
status
);
todo_wine
expectf_
(
1
.
0
,
scale
,
0
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_pen_thickness
(
void
)
{
static
const
struct
test_data
...
...
@@ -7275,6 +7371,7 @@ START_TEST(graphics)
test_measure_string
();
test_font_height_scaling
();
test_transform
();
test_set_page_transform
();
test_pen_thickness
();
test_GdipMeasureString
();
test_constructor_destructor
();
...
...
include/gdiplusflat.h
View file @
73aed1b5
...
...
@@ -290,6 +290,7 @@ GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(GDIPCONST WCHAR*,HDC,EmfType,
GDIPCONST
GpRect
*
,
MetafileFrameUnit
,
GDIPCONST
WCHAR
*
,
GpMetafile
**
);
GpStatus
WINGDIPAPI
GdipReleaseDC
(
GpGraphics
*
,
HDC
);
GpStatus
WINGDIPAPI
GdipResetClip
(
GpGraphics
*
);
GpStatus
WINGDIPAPI
GdipResetPageTransform
(
GpGraphics
*
);
GpStatus
WINGDIPAPI
GdipResetWorldTransform
(
GpGraphics
*
);
GpStatus
WINGDIPAPI
GdipRestoreGraphics
(
GpGraphics
*
,
GraphicsState
);
GpStatus
WINGDIPAPI
GdipRotateWorldTransform
(
GpGraphics
*
,
REAL
,
GpMatrixOrder
);
...
...
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