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
394d4b07
Commit
394d4b07
authored
Nov 08, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Avoid not necessary memory allocations in GdipCreateRegionPath.
parent
f204aab1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
33 deletions
+2
-33
region.c
dlls/gdiplus/region.c
+2
-33
No files found.
dlls/gdiplus/region.c
View file @
394d4b07
...
...
@@ -425,9 +425,6 @@ GpStatus WINGDIPAPI GdipCreateRegion(GpRegion **region)
GpStatus
WINGDIPAPI
GdipCreateRegionPath
(
GpPath
*
path
,
GpRegion
**
region
)
{
region_element
*
element
;
GpPoint
*
pointsi
;
GpPointF
*
pointsf
;
GpStatus
stat
;
DWORD
flags
=
FLAGS_INTPATH
;
INT
count
,
i
;
...
...
@@ -450,43 +447,15 @@ GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region)
count
=
path
->
pathdata
.
Count
;
/* Test to see if the path is an Integer path */
if
(
count
)
{
pointsi
=
GdipAlloc
(
sizeof
(
GpPoint
)
*
count
);
pointsf
=
GdipAlloc
(
sizeof
(
GpPointF
)
*
count
);
if
(
!
(
pointsi
&&
pointsf
))
{
GdipFree
(
pointsi
);
GdipFree
(
pointsf
);
GdipDeleteRegion
(
*
region
);
return
OutOfMemory
;
}
stat
=
GdipGetPathPointsI
(
path
,
pointsi
,
count
);
if
(
stat
!=
Ok
)
{
GdipDeleteRegion
(
*
region
);
return
stat
;
}
stat
=
GdipGetPathPoints
(
path
,
pointsf
,
count
);
if
(
stat
!=
Ok
)
{
GdipDeleteRegion
(
*
region
);
return
stat
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
(
!
(
pointsi
[
i
].
X
==
pointsf
[
i
].
X
&&
pointsi
[
i
].
Y
==
pointsf
[
i
].
Y
))
if
(
path
->
pathdata
.
Points
[
i
].
X
!=
gdip_round
(
path
->
pathdata
.
Points
[
i
].
X
)
||
path
->
pathdata
.
Points
[
i
].
Y
!=
gdip_round
(
path
->
pathdata
.
Points
[
i
].
Y
))
{
flags
=
FLAGS_NOFLAGS
;
break
;
}
}
GdipFree
(
pointsi
);
GdipFree
(
pointsf
);
}
stat
=
GdipClonePath
(
path
,
&
element
->
elementdata
.
pathdata
.
path
);
if
(
stat
!=
Ok
)
...
...
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