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
81d9ffa0
Commit
81d9ffa0
authored
Dec 05, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Always use AlphaBlend to draw to 32-bit DIB's.
parent
431aa5bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
6 deletions
+16
-6
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+1
-0
graphics.c
dlls/gdiplus/graphics.c
+14
-5
graphics.c
dlls/gdiplus/tests/graphics.c
+1
-1
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
81d9ffa0
...
...
@@ -152,6 +152,7 @@ struct GpGraphics{
HDC
hdc
;
HWND
hwnd
;
BOOL
owndc
;
BOOL
alpha_hdc
;
GpImage
*
image
;
SmoothingMode
smoothing
;
CompositingQuality
compqual
;
...
...
dlls/gdiplus/graphics.c
View file @
81d9ffa0
...
...
@@ -2250,6 +2250,8 @@ GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
GpStatus
WINGDIPAPI
GdipCreateFromHDC2
(
HDC
hdc
,
HANDLE
hDevice
,
GpGraphics
**
graphics
)
{
GpStatus
retval
;
HBITMAP
hbitmap
;
DIBSECTION
dib
;
TRACE
(
"(%p, %p, %p)
\n
"
,
hdc
,
hDevice
,
graphics
);
...
...
@@ -2274,6 +2276,13 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
return
retval
;
}
hbitmap
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
if
(
hbitmap
&&
GetObjectW
(
hbitmap
,
sizeof
(
dib
),
&
dib
)
==
sizeof
(
dib
)
&&
dib
.
dsBmih
.
biBitCount
==
32
&&
dib
.
dsBmih
.
biCompression
==
BI_RGB
)
{
(
*
graphics
)
->
alpha_hdc
=
1
;
}
(
*
graphics
)
->
hdc
=
hdc
;
(
*
graphics
)
->
hwnd
=
WindowFromDC
(
hdc
);
(
*
graphics
)
->
owndc
=
FALSE
;
...
...
@@ -3157,7 +3166,7 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
graphics
->
scale
,
image
->
xres
,
image
->
yres
,
bitmap
->
format
,
imageAttributes
?
imageAttributes
->
outside_color
:
0
);
if
(
imageAttributes
||
if
(
imageAttributes
||
graphics
->
alpha_hdc
||
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeBitmap
)
||
ptf
[
1
].
Y
!=
ptf
[
0
].
Y
||
ptf
[
2
].
X
!=
ptf
[
0
].
X
||
ptf
[
1
].
X
-
ptf
[
0
].
X
!=
srcwidth
||
ptf
[
2
].
Y
-
ptf
[
0
].
Y
!=
srcheight
||
...
...
@@ -4021,7 +4030,7 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *p
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
image
)
if
(
!
graphics
->
image
&&
!
graphics
->
alpha_hdc
)
stat
=
GDI32_GdipFillPath
(
graphics
,
brush
,
path
);
if
(
stat
==
NotImplemented
)
...
...
@@ -4359,7 +4368,7 @@ GpStatus WINGDIPAPI GdipFillRegion(GpGraphics* graphics, GpBrush* brush,
if
(
graphics
->
busy
)
return
ObjectBusy
;
if
(
!
graphics
->
image
)
if
(
!
graphics
->
image
&&
!
graphics
->
alpha_hdc
)
stat
=
GDI32_GdipFillRegion
(
graphics
,
brush
,
region
);
if
(
stat
==
NotImplemented
)
...
...
@@ -5982,7 +5991,7 @@ GpStatus WINGDIPAPI GdipGetDC(GpGraphics *graphics, HDC *hdc)
{
stat
=
METAFILE_GetDC
((
GpMetafile
*
)
graphics
->
image
,
hdc
);
}
else
if
(
!
graphics
->
hdc
||
else
if
(
!
graphics
->
hdc
||
graphics
->
alpha_hdc
||
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeBitmap
&&
((
GpBitmap
*
)
graphics
->
image
)
->
format
&
PixelFormatAlpha
))
{
/* Create a fake HDC and fill it with a constant color. */
...
...
@@ -6626,7 +6635,7 @@ static GpStatus draw_driver_string(GpGraphics *graphics, GDIPCONST UINT16 *text,
if
(
length
==
-
1
)
length
=
strlenW
(
text
);
if
(
graphics
->
hdc
&&
if
(
graphics
->
hdc
&&
!
graphics
->
alpha_hdc
&&
((
flags
&
DriverStringOptionsRealizedAdvance
)
||
length
<=
1
)
&&
brush
->
bt
==
BrushTypeSolidColor
&&
(((
GpSolidFill
*
)
brush
)
->
color
&
0xff000000
)
==
0xff000000
)
...
...
dlls/gdiplus/tests/graphics.c
View file @
81d9ffa0
...
...
@@ -4115,7 +4115,7 @@ static void test_alpha_hdc(void)
status
=
GdipGraphicsClear
(
graphics
,
0xffaaaaaa
);
expect
(
Ok
,
status
);
todo_wine
expect
(
0xffaaaaaa
,
bits
[
0
]);
expect
(
0xffaaaaaa
,
bits
[
0
]);
SelectObject
(
hdc
,
old_hbm
);
...
...
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