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
a59d79c9
Commit
a59d79c9
authored
May 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix drawing of 1-bpp icons in DrawIconEx.
parent
2e96abd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
16 deletions
+27
-16
cursoricon.c
dlls/user32/cursoricon.c
+27
-16
No files found.
dlls/user32/cursoricon.c
View file @
a59d79c9
...
@@ -2294,28 +2294,40 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
...
@@ -2294,28 +2294,40 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
if
(
flags
&
DI_IMAGE
)
if
(
flags
&
DI_IMAGE
)
{
{
BITMAPINFOHEADER
bmih
;
if
(
ptr
->
bPlanes
*
ptr
->
bBitsPerPixel
==
1
)
unsigned
char
*
dibBits
;
{
hXorBits
=
CreateBitmap
(
ptr
->
nWidth
,
ptr
->
nHeight
,
1
,
1
,
xorBitmapBits
);
memset
(
&
bmih
,
0
,
sizeof
(
BITMAPINFOHEADER
));
}
bmih
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
else
bmih
.
biWidth
=
ptr
->
nWidth
;
{
bmih
.
biHeight
=
-
ptr
->
nHeight
;
unsigned
char
*
dibBits
;
bmih
.
biPlanes
=
ptr
->
bPlanes
;
BITMAPINFO
*
bmi
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
bmih
.
biBitCount
=
ptr
->
bBitsPerPixel
;
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
]
));
bmih
.
biCompression
=
BI_RGB
;
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmi
->
bmiHeader
.
biWidth
=
ptr
->
nWidth
;
hXorBits
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bmih
,
DIB_RGB_COLORS
,
bmi
->
bmiHeader
.
biHeight
=
-
ptr
->
nHeight
;
(
void
*
)
&
dibBits
,
NULL
,
0
);
bmi
->
bmiHeader
.
biPlanes
=
ptr
->
bPlanes
;
bmi
->
bmiHeader
.
biBitCount
=
ptr
->
bBitsPerPixel
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
/* FIXME: color table */
hXorBits
=
CreateDIBSection
(
hdc
,
bmi
,
DIB_RGB_COLORS
,
(
void
*
)
&
dibBits
,
NULL
,
0
);
if
(
hXorBits
)
{
if
(
has_alpha
)
premultiply_alpha_channel
(
dibBits
,
xorBitmapBits
,
xorLength
);
else
memcpy
(
dibBits
,
xorBitmapBits
,
xorLength
);
}
}
if
(
hXorBits
&&
dibBits
)
if
(
hXorBits
)
{
{
if
(
has_alpha
)
if
(
has_alpha
)
{
{
BLENDFUNCTION
pixelblend
=
{
AC_SRC_OVER
,
0
,
255
,
AC_SRC_ALPHA
};
BLENDFUNCTION
pixelblend
=
{
AC_SRC_OVER
,
0
,
255
,
AC_SRC_ALPHA
};
/* Do the alpha blending render */
/* Do the alpha blending render */
premultiply_alpha_channel
(
dibBits
,
xorBitmapBits
,
xorLength
);
hBitTemp
=
SelectObject
(
hMemDC
,
hXorBits
);
hBitTemp
=
SelectObject
(
hMemDC
,
hXorBits
);
if
(
DoOffscreen
)
if
(
DoOffscreen
)
...
@@ -2329,7 +2341,6 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
...
@@ -2329,7 +2341,6 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
}
}
else
else
{
{
memcpy
(
dibBits
,
xorBitmapBits
,
xorLength
);
hBitTemp
=
SelectObject
(
hMemDC
,
hXorBits
);
hBitTemp
=
SelectObject
(
hMemDC
,
hXorBits
);
if
(
DoOffscreen
)
if
(
DoOffscreen
)
StretchBlt
(
hDC_off
,
0
,
0
,
cxWidth
,
cyWidth
,
StretchBlt
(
hDC_off
,
0
,
0
,
cxWidth
,
cyWidth
,
...
...
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