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
833316f9
Commit
833316f9
authored
Mar 10, 2011
by
Vincent Povirk
Committed by
Alexandre Julliard
Mar 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Call GdiAlphaBlend only once per GdipFillRegion call.
parent
77f5a07c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
21 deletions
+72
-21
graphics.c
dlls/gdiplus/graphics.c
+72
-21
No files found.
dlls/gdiplus/graphics.c
View file @
833316f9
...
...
@@ -3856,39 +3856,90 @@ static GpStatus SOFTWARE_GdipFillRegion(GpGraphics *graphics, GpBrush *brush,
if
(
stat
==
Ok
)
{
UINT
max_size
=
0
;
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
if
(
!
graphics
->
image
)
{
UINT
size
=
scans
[
i
].
Width
*
scans
[
i
].
Height
;
/* If we have to go through gdi32, use as few alpha blends as possible. */
INT
min_x
,
min_y
,
max_x
,
max_y
;
UINT
data_width
,
data_height
;
if
(
size
>
max_size
)
max_size
=
size
;
}
min_x
=
scans
[
0
].
X
;
min_y
=
scans
[
0
].
Y
;
max_x
=
scans
[
0
].
X
+
scans
[
0
].
Width
;
max_y
=
scans
[
0
].
Y
+
scans
[
0
].
Height
;
pixel_data
=
GdipAlloc
(
sizeof
(
*
pixel_data
)
*
max_size
);
if
(
!
pixel_data
)
stat
=
OutOfMemory
;
for
(
i
=
1
;
i
<
scans_count
;
i
++
)
{
min_x
=
min
(
min_x
,
scans
[
i
].
X
);
min_y
=
min
(
min_y
,
scans
[
i
].
Y
);
max_x
=
max
(
max_x
,
scans
[
i
].
X
+
scans
[
i
].
Width
);
max_y
=
max
(
max_y
,
scans
[
i
].
Y
+
scans
[
i
].
Height
);
}
if
(
stat
==
Ok
)
{
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
data_width
=
max_x
-
min_x
;
data_height
=
max_y
-
min_y
;
pixel_data
=
GdipAlloc
(
sizeof
(
*
pixel_data
)
*
data_width
*
data_height
);
if
(
!
pixel_data
)
stat
=
OutOfMemory
;
if
(
stat
==
Ok
)
{
stat
=
brush_fill_pixels
(
graphics
,
brush
,
pixel_data
,
&
scans
[
i
],
scans
[
i
].
Width
);
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
{
stat
=
brush_fill_pixels
(
graphics
,
brush
,
pixel_data
+
(
scans
[
i
].
X
-
min_x
)
+
(
scans
[
i
].
Y
-
min_y
)
*
data_width
,
&
scans
[
i
],
data_width
);
if
(
stat
!=
Ok
)
break
;
}
if
(
stat
==
Ok
)
{
stat
=
alpha_blend_pixels
(
graphics
,
scans
[
i
].
X
,
scans
[
i
].
Y
,
(
BYTE
*
)
pixel_data
,
scans
[
i
].
Width
,
scans
[
i
].
H
eight
,
scans
[
i
].
W
idth
*
4
);
stat
=
alpha_blend_pixels
(
graphics
,
min_x
,
min_y
,
(
BYTE
*
)
pixel_data
,
data_width
,
data_h
eight
,
data_w
idth
*
4
);
}
if
(
stat
!=
Ok
)
break
;
GdipFree
(
pixel_data
);
}
}
else
{
UINT
max_size
=
0
;
GdipFree
(
pixel_data
);
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
{
UINT
size
=
scans
[
i
].
Width
*
scans
[
i
].
Height
;
if
(
size
>
max_size
)
max_size
=
size
;
}
pixel_data
=
GdipAlloc
(
sizeof
(
*
pixel_data
)
*
max_size
);
if
(
!
pixel_data
)
stat
=
OutOfMemory
;
if
(
stat
==
Ok
)
{
for
(
i
=
0
;
i
<
scans_count
;
i
++
)
{
stat
=
brush_fill_pixels
(
graphics
,
brush
,
pixel_data
,
&
scans
[
i
],
scans
[
i
].
Width
);
if
(
stat
==
Ok
)
{
stat
=
alpha_blend_pixels
(
graphics
,
scans
[
i
].
X
,
scans
[
i
].
Y
,
(
BYTE
*
)
pixel_data
,
scans
[
i
].
Width
,
scans
[
i
].
Height
,
scans
[
i
].
Width
*
4
);
}
if
(
stat
!=
Ok
)
break
;
}
GdipFree
(
pixel_data
);
}
}
GdipFree
(
scans
);
...
...
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