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
52ebbb8a
Commit
52ebbb8a
authored
Mar 11, 2010
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Mar 15, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Restore special handling of monochrome bitmaps removed by…
user32: Restore special handling of monochrome bitmaps removed by
c2202929
.
parent
8447844d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
12 deletions
+37
-12
cursoricon.c
dlls/user32/cursoricon.c
+37
-12
No files found.
dlls/user32/cursoricon.c
View file @
52ebbb8a
...
...
@@ -765,6 +765,7 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
int
sizeAnd
,
sizeXor
;
HBITMAP
hAndBits
=
0
,
hXorBits
=
0
;
/* error condition for later */
BITMAP
bmpXor
,
bmpAnd
;
BOOL
do_stretch
;
INT
size
;
BITMAPINFO
*
pSrcInfo
,
*
pDestInfo
;
...
...
@@ -788,10 +789,11 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
if
(
!
width
)
width
=
bmi
->
bmiHeader
.
biWidth
;
if
(
!
height
)
height
=
bmi
->
bmiHeader
.
biHeight
/
2
;
do_stretch
=
(
bmi
->
bmiHeader
.
biHeight
/
2
!=
height
)
||
(
bmi
->
bmiHeader
.
biWidth
!=
width
);
/* Scale the hotspot */
if
(((
bmi
->
bmiHeader
.
biHeight
/
2
!=
height
)
||
(
bmi
->
bmiHeader
.
biWidth
!=
width
))
&&
hotspot
.
x
!=
ICON_HOTSPOT
&&
hotspot
.
y
!=
ICON_HOTSPOT
)
if
(
do_stretch
&&
hotspot
.
x
!=
ICON_HOTSPOT
&&
hotspot
.
y
!=
ICON_HOTSPOT
)
{
hotspot
.
x
=
(
hotspot
.
x
*
width
)
/
bmi
->
bmiHeader
.
biWidth
;
hotspot
.
y
=
(
hotspot
.
y
*
height
)
/
(
bmi
->
bmiHeader
.
biHeight
/
2
);
...
...
@@ -842,16 +844,30 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
}
else
{
hXorBits
=
CreateCompatibleBitmap
(
screen_dc
,
width
,
height
);
if
(
hXorBits
)
if
(
do_stretch
)
{
if
(
!
stretch_blt_icon
(
hXorBits
,
pDestInfo
,
pSrcInfo
,
(
char
*
)
bmi
+
size
))
hXorBits
=
CreateCompatibleBitmap
(
screen_dc
,
width
,
height
);
if
(
hXorBits
)
{
DeleteObject
(
hXorBits
);
hXorBits
=
0
;
if
(
!
stretch_blt_icon
(
hXorBits
,
pDestInfo
,
pSrcInfo
,
(
char
*
)
bmi
+
size
))
{
DeleteObject
(
hXorBits
);
hXorBits
=
0
;
}
}
}
else
{
if
(
is_dib_monochrome
(
bmi
))
{
hXorBits
=
CreateBitmap
(
width
,
height
,
1
,
1
,
NULL
);
SetDIBits
(
screen_dc
,
hXorBits
,
0
,
height
,
(
char
*
)
bmi
+
size
,
pSrcInfo
,
DIB_RGB_COLORS
);
}
else
hXorBits
=
CreateDIBitmap
(
screen_dc
,
&
pSrcInfo
->
bmiHeader
,
CBM_INIT
,
(
char
*
)
bmi
+
size
,
pSrcInfo
,
DIB_RGB_COLORS
);
}
}
if
(
hXorBits
)
...
...
@@ -879,12 +895,21 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi,
}
/* Create the AND bitmap */
hAndBits
=
CreateBitmap
(
width
,
height
,
1
,
1
,
NULL
);
if
(
do_stretch
)
{
hAndBits
=
CreateBitmap
(
width
,
height
,
1
,
1
,
NULL
);
if
(
!
stretch_blt_icon
(
hAndBits
,
pDestInfo
,
pSrcInfo
,
xbits
))
if
(
!
stretch_blt_icon
(
hAndBits
,
pDestInfo
,
pSrcInfo
,
xbits
))
{
DeleteObject
(
hAndBits
);
hAndBits
=
0
;
}
}
else
{
DeleteObject
(
hAndBits
);
hAndBits
=
0
;
hAndBits
=
CreateBitmap
(
width
,
height
,
1
,
1
,
NULL
);
SetDIBits
(
screen_dc
,
hAndBits
,
0
,
height
,
xbits
,
pSrcInfo
,
DIB_RGB_COLORS
);
}
if
(
!
hAndBits
)
...
...
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