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
6526ac19
Commit
6526ac19
authored
Jul 04, 2016
by
Huw Davies
Committed by
Alexandre Julliard
Jul 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Try to compact the region.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
27375d84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
region.c
dlls/gdi32/region.c
+25
-18
No files found.
dlls/gdi32/region.c
View file @
6526ac19
...
...
@@ -1598,6 +1598,28 @@ static INT REGION_Coalesce (
return
(
curStart
);
}
/**********************************************************************
* REGION_compact
*
* To keep regions from growing without bound, shrink the array of rectangles
* to match the new number of rectangles in the region.
*
* Only do this if the number of rectangles allocated is more than
* twice the number of rectangles in the region.
*/
static
void
REGION_compact
(
WINEREGION
*
reg
)
{
if
((
reg
->
numRects
<
reg
->
size
/
2
)
&&
(
reg
->
numRects
>
2
))
{
RECT
*
new_rects
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
reg
->
rects
,
reg
->
numRects
*
sizeof
(
RECT
)
);
if
(
new_rects
)
{
reg
->
rects
=
new_rects
;
reg
->
size
=
reg
->
numRects
;
}
}
}
/***********************************************************************
* REGION_RegionOp
*
...
...
@@ -1839,23 +1861,7 @@ static BOOL REGION_RegionOp(
REGION_Coalesce
(
&
newReg
,
prevBand
,
curBand
);
}
/*
* A bit of cleanup. To keep regions from growing without bound,
* we shrink the array of rectangles to match the new number of
* rectangles in the region. This never goes to 0, however...
*
* Only do this stuff if the number of rectangles allocated is more than
* twice the number of rectangles in the region (a simple optimization...).
*/
if
((
newReg
.
numRects
<
(
newReg
.
size
>>
1
))
&&
(
newReg
.
numRects
>
2
))
{
RECT
*
new_rects
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
newReg
.
rects
,
newReg
.
numRects
*
sizeof
(
RECT
)
);
if
(
new_rects
)
{
newReg
.
rects
=
new_rects
;
newReg
.
size
=
newReg
.
numRects
;
}
}
REGION_compact
(
&
newReg
);
HeapFree
(
GetProcessHeap
(),
0
,
destReg
->
rects
);
destReg
->
rects
=
newReg
.
rects
;
destReg
->
size
=
newReg
.
size
;
...
...
@@ -2633,8 +2639,9 @@ static BOOL REGION_PtsToRegion( struct point_block *FirstPtBlock, WINEREGION *re
extents
->
right
=
0
;
extents
->
bottom
=
0
;
}
REGION_compact
(
reg
);
return
(
TRUE
)
;
return
TRUE
;
}
/***********************************************************************
...
...
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