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
600cbb78
Commit
600cbb78
authored
Apr 13, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Use StretchBlt instead of GdiAlphaBlend if device doesn't support alpha blending.
parent
1dba866e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
graphics.c
dlls/gdiplus/graphics.c
+32
-31
No files found.
dlls/gdiplus/graphics.c
View file @
600cbb78
...
...
@@ -340,6 +340,30 @@ static void transform_and_round_points(GpGraphics *graphics, POINT *pti,
}
}
static
void
gdi_alpha_blend
(
GpGraphics
*
graphics
,
INT
dst_x
,
INT
dst_y
,
INT
dst_width
,
INT
dst_height
,
HDC
hdc
,
INT
src_x
,
INT
src_y
,
INT
src_width
,
INT
src_height
)
{
if
(
GetDeviceCaps
(
graphics
->
hdc
,
SHADEBLENDCAPS
)
==
SB_NONE
)
{
TRACE
(
"alpha blending not supported by device, fallback to StretchBlt
\n
"
);
StretchBlt
(
graphics
->
hdc
,
dst_x
,
dst_y
,
dst_width
,
dst_height
,
hdc
,
src_x
,
src_y
,
src_width
,
src_height
,
SRCCOPY
);
}
else
{
BLENDFUNCTION
bf
;
bf
.
BlendOp
=
AC_SRC_OVER
;
bf
.
BlendFlags
=
0
;
bf
.
SourceConstantAlpha
=
255
;
bf
.
AlphaFormat
=
AC_SRC_ALPHA
;
GdiAlphaBlend
(
graphics
->
hdc
,
dst_x
,
dst_y
,
dst_width
,
dst_height
,
hdc
,
src_x
,
src_y
,
src_width
,
src_height
,
bf
);
}
}
/* Draw non-premultiplied ARGB data to the given graphics object */
static
GpStatus
alpha_blend_pixels
(
GpGraphics
*
graphics
,
INT
dst_x
,
INT
dst_y
,
const
BYTE
*
src
,
INT
src_width
,
INT
src_height
,
INT
src_stride
)
...
...
@@ -370,10 +394,9 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
else
{
HDC
hdc
;
HBITMAP
hbitmap
,
old_hbm
=
NULL
;
HBITMAP
hbitmap
;
BITMAPINFOHEADER
bih
;
BYTE
*
temp_bits
;
BLENDFUNCTION
bf
;
hdc
=
CreateCompatibleDC
(
0
);
...
...
@@ -395,17 +418,9 @@ static GpStatus alpha_blend_pixels(GpGraphics *graphics, INT dst_x, INT dst_y,
convert_32bppARGB_to_32bppPARGB
(
src_width
,
src_height
,
temp_bits
,
4
*
src_width
,
src
,
src_stride
);
old_hbm
=
SelectObject
(
hdc
,
hbitmap
);
bf
.
BlendOp
=
AC_SRC_OVER
;
bf
.
BlendFlags
=
0
;
bf
.
SourceConstantAlpha
=
255
;
bf
.
AlphaFormat
=
AC_SRC_ALPHA
;
GdiAlphaBlend
(
graphics
->
hdc
,
dst_x
,
dst_y
,
src_width
,
src_height
,
hdc
,
0
,
0
,
src_width
,
src_height
,
bf
);
SelectObject
(
hdc
,
old_hbm
);
SelectObject
(
hdc
,
hbitmap
);
gdi_alpha_blend
(
graphics
,
dst_x
,
dst_y
,
src_width
,
src_height
,
hdc
,
0
,
0
,
src_width
,
src_height
);
DeleteDC
(
hdc
);
DeleteObject
(
hbitmap
);
...
...
@@ -918,19 +933,12 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
if
(
GetClipBox
(
graphics
->
hdc
,
&
rc
)
!=
NULLREGION
)
{
HDC
hdc
=
CreateCompatibleDC
(
NULL
);
BLENDFUNCTION
bf
;
if
(
!
hdc
)
break
;
SelectObject
(
hdc
,
bmp
);
bf
.
BlendOp
=
AC_SRC_OVER
;
bf
.
BlendFlags
=
0
;
bf
.
SourceConstantAlpha
=
255
;
bf
.
AlphaFormat
=
AC_SRC_ALPHA
;
GdiAlphaBlend
(
graphics
->
hdc
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
hdc
,
0
,
0
,
1
,
1
,
bf
);
gdi_alpha_blend
(
graphics
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
hdc
,
0
,
0
,
1
,
1
);
DeleteDC
(
hdc
);
}
...
...
@@ -3288,15 +3296,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
if
(
bitmap
->
format
&
(
PixelFormatAlpha
|
PixelFormatPAlpha
))
{
BLENDFUNCTION
bf
;
bf
.
BlendOp
=
AC_SRC_OVER
;
bf
.
BlendFlags
=
0
;
bf
.
SourceConstantAlpha
=
255
;
bf
.
AlphaFormat
=
AC_SRC_ALPHA
;
GdiAlphaBlend
(
graphics
->
hdc
,
pti
[
0
].
x
,
pti
[
0
].
y
,
pti
[
1
].
x
-
pti
[
0
].
x
,
pti
[
2
].
y
-
pti
[
0
].
y
,
hdc
,
srcx
,
srcy
,
srcwidth
,
srcheight
,
bf
);
gdi_alpha_blend
(
graphics
,
pti
[
0
].
x
,
pti
[
0
].
y
,
pti
[
1
].
x
-
pti
[
0
].
x
,
pti
[
2
].
y
-
pti
[
0
].
y
,
hdc
,
srcx
,
srcy
,
srcwidth
,
srcheight
);
}
else
{
...
...
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