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
c0576948
Commit
c0576948
authored
Feb 17, 2011
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Mar 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Add tests and fix GdipDrawImagePointsRect.
parent
fe8e08a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
graphics.c
dlls/gdiplus/graphics.c
+5
-0
graphics.c
dlls/gdiplus/tests/graphics.c
+56
-0
No files found.
dlls/gdiplus/graphics.c
View file @
c0576948
...
...
@@ -2161,6 +2161,9 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
count
,
srcx
,
srcy
,
srcwidth
,
srcheight
,
srcUnit
,
imageAttributes
,
callback
,
callbackData
);
if
(
count
>
3
)
return
NotImplemented
;
if
(
!
graphics
||
!
image
||
!
points
||
count
!=
3
)
return
InvalidParameter
;
...
...
@@ -2170,6 +2173,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
memcpy
(
ptf
,
points
,
3
*
sizeof
(
GpPointF
));
ptf
[
3
].
X
=
ptf
[
2
].
X
+
ptf
[
1
].
X
-
ptf
[
0
].
X
;
ptf
[
3
].
Y
=
ptf
[
2
].
Y
+
ptf
[
1
].
Y
-
ptf
[
0
].
Y
;
if
(
!
srcwidth
||
!
srcheight
||
ptf
[
3
].
X
==
ptf
[
0
].
X
||
ptf
[
3
].
Y
==
ptf
[
0
].
Y
)
return
Ok
;
transform_and_round_points
(
graphics
,
pti
,
ptf
,
4
);
if
(
image
->
picture
)
...
...
dlls/gdiplus/tests/graphics.c
View file @
c0576948
...
...
@@ -1130,6 +1130,60 @@ static void test_GdipDrawLineI(void)
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipDrawImagePointsRect
(
void
)
{
GpStatus
status
;
GpGraphics
*
graphics
=
NULL
;
GpPointF
ptf
[
4
];
GpBitmap
*
bm
=
NULL
;
BYTE
rbmi
[
sizeof
(
BITMAPINFOHEADER
)];
BYTE
buff
[
400
];
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
rbmi
;
HDC
hdc
=
GetDC
(
hwnd
);
if
(
!
hdc
)
return
;
memset
(
rbmi
,
0
,
sizeof
(
rbmi
));
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmi
->
bmiHeader
.
biWidth
=
10
;
bmi
->
bmiHeader
.
biHeight
=
10
;
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biBitCount
=
32
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
status
=
GdipCreateBitmapFromGdiDib
(
bmi
,
buff
,
&
bm
);
expect
(
Ok
,
status
);
ok
(
NULL
!=
bm
,
"Expected bitmap to be initialized
\n
"
);
status
=
GdipCreateFromHDC
(
hdc
,
&
graphics
);
expect
(
Ok
,
status
);
ptf
[
0
].
X
=
0
;
ptf
[
0
].
Y
=
0
;
ptf
[
1
].
X
=
10
;
ptf
[
1
].
Y
=
0
;
ptf
[
2
].
X
=
0
;
ptf
[
2
].
Y
=
10
;
ptf
[
3
].
X
=
10
;
ptf
[
3
].
Y
=
10
;
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
ptf
,
4
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
NotImplemented
,
status
);
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
ptf
,
2
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
ptf
,
3
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
Ok
,
status
);
status
=
GdipDrawImagePointsRect
(
graphics
,
NULL
,
ptf
,
3
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
NULL
,
3
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
InvalidParameter
,
status
);
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
ptf
,
3
,
0
,
0
,
0
,
0
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
Ok
,
status
);
memset
(
ptf
,
0
,
sizeof
(
ptf
));
status
=
GdipDrawImagePointsRect
(
graphics
,
(
GpImage
*
)
bm
,
ptf
,
3
,
0
,
0
,
10
,
10
,
UnitPixel
,
NULL
,
NULL
,
NULL
);
expect
(
Ok
,
status
);
GdipDisposeImage
((
GpImage
*
)
bm
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
hwnd
,
hdc
);
}
static
void
test_GdipDrawLinesI
(
void
)
{
GpStatus
status
;
...
...
@@ -1603,6 +1657,7 @@ static void test_Get_Release_DC(void)
expect
(
ObjectBusy
,
status
);
status
=
GdipTransformPoints
(
graphics
,
CoordinateSpacePage
,
CoordinateSpaceWorld
,
ptf
,
5
);
expect
(
ObjectBusy
,
status
);
/* try to delete before release */
status
=
GdipDeleteGraphics
(
graphics
);
expect
(
ObjectBusy
,
status
);
...
...
@@ -2998,6 +3053,7 @@ START_TEST(graphics)
test_GdipDrawCurve3I
();
test_GdipDrawLineI
();
test_GdipDrawLinesI
();
test_GdipDrawImagePointsRect
();
test_GdipFillClosedCurve
();
test_GdipFillClosedCurveI
();
test_GdipDrawString
();
...
...
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