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
5887e661
Commit
5887e661
authored
Aug 04, 2008
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 05, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Implemented GdipReversePath with tests.
parent
10f23fa7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
100 additions
and
1 deletion
+100
-1
gdiplus.spec
dlls/gdiplus/gdiplus.spec
+1
-1
graphicspath.c
dlls/gdiplus/graphicspath.c
+54
-0
graphicspath.c
dlls/gdiplus/tests/graphicspath.c
+44
-0
gdiplusflat.h
include/gdiplusflat.h
+1
-0
No files found.
dlls/gdiplus/gdiplus.spec
View file @
5887e661
...
@@ -484,7 +484,7 @@
...
@@ -484,7 +484,7 @@
@ stub GdipResetTextureTransform
@ stub GdipResetTextureTransform
@ stub GdipResetWorldTransform
@ stub GdipResetWorldTransform
@ stdcall GdipRestoreGraphics(ptr long)
@ stdcall GdipRestoreGraphics(ptr long)
@ st
ub GdipReversePath
@ st
dcall GdipReversePath(ptr)
@ stub GdipRotateLineTransform
@ stub GdipRotateLineTransform
@ stdcall GdipRotateMatrix(ptr long long)
@ stdcall GdipRotateMatrix(ptr long long)
@ stub GdipRotatePathGradientTransform
@ stub GdipRotatePathGradientTransform
...
...
dlls/gdiplus/graphicspath.c
View file @
5887e661
...
@@ -927,6 +927,60 @@ GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
...
@@ -927,6 +927,60 @@ GpStatus WINGDIPAPI GdipGetPointCount(GpPath *path, INT *count)
return
Ok
;
return
Ok
;
}
}
GpStatus
WINGDIPAPI
GdipReversePath
(
GpPath
*
path
)
{
INT
i
,
count
;
INT
start
=
0
;
/* position in reversed path */
GpPathData
revpath
;
if
(
!
path
)
return
InvalidParameter
;
count
=
path
->
pathdata
.
Count
;
if
(
count
==
0
)
return
Ok
;
revpath
.
Points
=
GdipAlloc
(
sizeof
(
GpPointF
)
*
count
);
revpath
.
Types
=
GdipAlloc
(
sizeof
(
BYTE
)
*
count
);
revpath
.
Count
=
count
;
if
(
!
revpath
.
Points
||
!
revpath
.
Types
){
GdipFree
(
revpath
.
Points
);
GdipFree
(
revpath
.
Types
);
return
OutOfMemory
;
}
for
(
i
=
0
;
i
<
count
;
i
++
){
/* find next start point */
if
(
path
->
pathdata
.
Types
[
count
-
i
-
1
]
==
PathPointTypeStart
){
INT
j
;
for
(
j
=
start
;
j
<=
i
;
j
++
){
revpath
.
Points
[
j
]
=
path
->
pathdata
.
Points
[
count
-
j
-
1
];
revpath
.
Types
[
j
]
=
path
->
pathdata
.
Types
[
count
-
j
-
1
];
}
/* mark start point */
revpath
.
Types
[
start
]
=
PathPointTypeStart
;
/* set 'figure' endpoint type */
if
(
i
-
start
>
1
){
revpath
.
Types
[
i
]
=
path
->
pathdata
.
Types
[
count
-
start
-
1
]
&
~
PathPointTypePathTypeMask
;
revpath
.
Types
[
i
]
|=
revpath
.
Types
[
i
-
1
];
}
else
revpath
.
Types
[
i
]
=
path
->
pathdata
.
Types
[
start
];
start
=
i
+
1
;
}
}
memcpy
(
path
->
pathdata
.
Points
,
revpath
.
Points
,
sizeof
(
GpPointF
)
*
count
);
memcpy
(
path
->
pathdata
.
Types
,
revpath
.
Types
,
sizeof
(
BYTE
)
*
count
);
GdipFree
(
revpath
.
Points
);
GdipFree
(
revpath
.
Types
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipIsOutlineVisiblePathPointI
(
GpPath
*
path
,
INT
x
,
INT
y
,
GpStatus
WINGDIPAPI
GdipIsOutlineVisiblePathPointI
(
GpPath
*
path
,
INT
x
,
INT
y
,
GpPen
*
pen
,
GpGraphics
*
graphics
,
BOOL
*
result
)
GpPen
*
pen
,
GpGraphics
*
graphics
,
BOOL
*
result
)
{
{
...
...
dlls/gdiplus/tests/graphicspath.c
View file @
5887e661
...
@@ -813,6 +813,49 @@ static void test_addclosedcurve(void)
...
@@ -813,6 +813,49 @@ static void test_addclosedcurve(void)
GdipDeletePath
(
path
);
GdipDeletePath
(
path
);
}
}
static
path_test_t
reverse_path
[]
=
{
{
0
.
0
,
20
.
0
,
PathPointTypeStart
,
0
,
0
},
/*0*/
{
25
.
0
,
25
.
0
,
PathPointTypeLine
,
0
,
0
},
/*1*/
{
0
.
0
,
30
.
0
,
PathPointTypeLine
,
0
,
0
},
/*2*/
{
15
.
0
,
35
.
0
,
PathPointTypeStart
,
0
,
0
},
/*3*/
{
0
.
0
,
40
.
0
,
PathPointTypeLine
,
0
,
0
},
/*4*/
{
5
.
0
,
45
.
0
,
PathPointTypeLine
,
0
,
0
},
/*5*/
{
0
.
0
,
50
.
0
,
PathPointTypeLine
|
PathPointTypeCloseSubpath
,
0
,
0
}
/*6*/
};
static
void
test_reverse
(
void
)
{
GpStatus
status
;
GpPath
*
path
;
GpPointF
pts
[
7
];
INT
i
;
for
(
i
=
0
;
i
<
7
;
i
++
){
pts
[
i
].
X
=
i
*
5
.
0
*
(
REAL
)(
i
%
2
);
pts
[
i
].
Y
=
50
.
0
-
i
*
5
.
0
;
}
GdipCreatePath
(
FillModeAlternate
,
&
path
);
/* NULL argument */
status
=
GdipReversePath
(
NULL
);
expect
(
InvalidParameter
,
status
);
/* empty path */
status
=
GdipReversePath
(
path
);
expect
(
Ok
,
status
);
GdipAddPathLine2
(
path
,
pts
,
4
);
GdipClosePathFigure
(
path
);
GdipAddPathLine2
(
path
,
&
(
pts
[
4
]),
3
);
status
=
GdipReversePath
(
path
);
expect
(
Ok
,
status
);
ok_path
(
path
,
reverse_path
,
sizeof
(
reverse_path
)
/
sizeof
(
path_test_t
),
FALSE
);
GdipDeletePath
(
path
);
}
START_TEST
(
graphicspath
)
START_TEST
(
graphicspath
)
{
{
struct
GdiplusStartupInput
gdiplusStartupInput
;
struct
GdiplusStartupInput
gdiplusStartupInput
;
...
@@ -838,6 +881,7 @@ START_TEST(graphicspath)
...
@@ -838,6 +881,7 @@ START_TEST(graphicspath)
test_lastpoint
();
test_lastpoint
();
test_addcurve
();
test_addcurve
();
test_addclosedcurve
();
test_addclosedcurve
();
test_reverse
();
GdiplusShutdown
(
gdiplusToken
);
GdiplusShutdown
(
gdiplusToken
);
}
}
include/gdiplusflat.h
View file @
5887e661
...
@@ -291,6 +291,7 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI(GpPath*,INT,INT,GpPen*,
...
@@ -291,6 +291,7 @@ GpStatus WINGDIPAPI GdipIsOutlineVisiblePathPointI(GpPath*,INT,INT,GpPen*,
GpStatus
WINGDIPAPI
GdipIsVisiblePathPoint
(
GpPath
*
,
REAL
,
REAL
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsVisiblePathPoint
(
GpPath
*
,
REAL
,
REAL
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsVisiblePathPointI
(
GpPath
*
,
INT
,
INT
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipIsVisiblePathPointI
(
GpPath
*
,
INT
,
INT
,
GpGraphics
*
,
BOOL
*
);
GpStatus
WINGDIPAPI
GdipResetPath
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipResetPath
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipReversePath
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipSetPathFillMode
(
GpPath
*
,
GpFillMode
);
GpStatus
WINGDIPAPI
GdipSetPathFillMode
(
GpPath
*
,
GpFillMode
);
GpStatus
WINGDIPAPI
GdipStartPathFigure
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipStartPathFigure
(
GpPath
*
);
GpStatus
WINGDIPAPI
GdipTransformPath
(
GpPath
*
,
GpMatrix
*
);
GpStatus
WINGDIPAPI
GdipTransformPath
(
GpPath
*
,
GpMatrix
*
);
...
...
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