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
159145ce
Commit
159145ce
authored
May 07, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make DrawIcon simply call DrawIconEx.
parent
4c03fd01
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
82 deletions
+1
-82
cursoricon.c
dlls/user32/cursoricon.c
+1
-82
No files found.
dlls/user32/cursoricon.c
View file @
159145ce
...
@@ -1656,88 +1656,7 @@ static void premultiply_alpha_channel( unsigned char *destBitmap,
...
@@ -1656,88 +1656,7 @@ static void premultiply_alpha_channel( unsigned char *destBitmap,
*/
*/
BOOL
WINAPI
DrawIcon
(
HDC
hdc
,
INT
x
,
INT
y
,
HICON
hIcon
)
BOOL
WINAPI
DrawIcon
(
HDC
hdc
,
INT
x
,
INT
y
,
HICON
hIcon
)
{
{
CURSORICONINFO
*
ptr
;
return
DrawIconEx
(
hdc
,
x
,
y
,
hIcon
,
0
,
0
,
0
,
0
,
DI_NORMAL
|
DI_COMPAT
|
DI_DEFAULTSIZE
);
HDC
hMemDC
;
HBITMAP
hXorBits
=
NULL
,
hAndBits
=
NULL
,
hBitTemp
=
NULL
;
COLORREF
oldFg
,
oldBg
;
unsigned
char
*
xorBitmapBits
;
unsigned
int
dibLength
;
TRACE
(
"%p, (%d,%d), %p
\n
"
,
hdc
,
x
,
y
,
hIcon
);
if
(
!
(
ptr
=
get_icon_ptr
(
hIcon
)))
return
FALSE
;
if
(
!
(
hMemDC
=
CreateCompatibleDC
(
hdc
)))
{
release_icon_ptr
(
hIcon
,
ptr
);
return
FALSE
;
}
dibLength
=
ptr
->
nHeight
*
get_bitmap_width_bytes
(
ptr
->
nWidth
,
ptr
->
bBitsPerPixel
);
xorBitmapBits
=
(
unsigned
char
*
)(
ptr
+
1
)
+
ptr
->
nHeight
*
get_bitmap_width_bytes
(
ptr
->
nWidth
,
1
);
oldFg
=
SetTextColor
(
hdc
,
RGB
(
0
,
0
,
0
)
);
oldBg
=
SetBkColor
(
hdc
,
RGB
(
255
,
255
,
255
)
);
if
(
bitmap_has_alpha_channel
(
ptr
->
bBitsPerPixel
,
xorBitmapBits
,
dibLength
))
{
BITMAPINFOHEADER
bmih
;
unsigned
char
*
dibBits
;
memset
(
&
bmih
,
0
,
sizeof
(
BITMAPINFOHEADER
));
bmih
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmih
.
biWidth
=
ptr
->
nWidth
;
bmih
.
biHeight
=
-
ptr
->
nHeight
;
bmih
.
biPlanes
=
ptr
->
bPlanes
;
bmih
.
biBitCount
=
32
;
bmih
.
biCompression
=
BI_RGB
;
hXorBits
=
CreateDIBSection
(
hdc
,
(
BITMAPINFO
*
)
&
bmih
,
DIB_RGB_COLORS
,
(
void
*
)
&
dibBits
,
NULL
,
0
);
if
(
hXorBits
&&
dibBits
)
{
BLENDFUNCTION
pixelblend
=
{
AC_SRC_OVER
,
0
,
255
,
AC_SRC_ALPHA
};
/* Do the alpha blending render */
premultiply_alpha_channel
(
dibBits
,
xorBitmapBits
,
dibLength
);
hBitTemp
=
SelectObject
(
hMemDC
,
hXorBits
);
/* Destination width/height has to be "System Large" size */
GdiAlphaBlend
(
hdc
,
x
,
y
,
GetSystemMetrics
(
SM_CXICON
),
GetSystemMetrics
(
SM_CYICON
),
hMemDC
,
0
,
0
,
ptr
->
nWidth
,
ptr
->
nHeight
,
pixelblend
);
SelectObject
(
hMemDC
,
hBitTemp
);
}
}
else
{
hAndBits
=
CreateBitmap
(
ptr
->
nWidth
,
ptr
->
nHeight
,
1
,
1
,
ptr
+
1
);
hXorBits
=
CreateBitmap
(
ptr
->
nWidth
,
ptr
->
nHeight
,
ptr
->
bPlanes
,
ptr
->
bBitsPerPixel
,
xorBitmapBits
);
if
(
hXorBits
&&
hAndBits
)
{
hBitTemp
=
SelectObject
(
hMemDC
,
hAndBits
);
StretchBlt
(
hdc
,
x
,
y
,
GetSystemMetrics
(
SM_CXICON
),
GetSystemMetrics
(
SM_CYICON
),
hMemDC
,
0
,
0
,
ptr
->
nWidth
,
ptr
->
nHeight
,
SRCAND
);
SelectObject
(
hMemDC
,
hXorBits
);
StretchBlt
(
hdc
,
x
,
y
,
GetSystemMetrics
(
SM_CXICON
),
GetSystemMetrics
(
SM_CYICON
),
hMemDC
,
0
,
0
,
ptr
->
nWidth
,
ptr
->
nHeight
,
SRCINVERT
);
SelectObject
(
hMemDC
,
hBitTemp
);
}
}
DeleteDC
(
hMemDC
);
if
(
hXorBits
)
DeleteObject
(
hXorBits
);
if
(
hAndBits
)
DeleteObject
(
hAndBits
);
release_icon_ptr
(
hIcon
,
ptr
);
SetTextColor
(
hdc
,
oldFg
);
SetBkColor
(
hdc
,
oldBg
);
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