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
bd3b0e4f
Commit
bd3b0e4f
authored
Aug 29, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Simplify the DIB byte width computation.
parent
8cf64240
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
47 deletions
+2
-47
imagelist.c
dlls/comctl32/imagelist.c
+1
-29
imagelist.c
dlls/comctl32/tests/imagelist.c
+1
-18
No files found.
dlls/comctl32/imagelist.c
View file @
bd3b0e4f
...
...
@@ -2061,41 +2061,13 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
/***********************************************************************
* DIB_GetDIBWidthBytes
*
* Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned.
*/
static
int
DIB_GetDIBWidthBytes
(
int
width
,
int
depth
)
{
int
words
;
switch
(
depth
)
{
case
1
:
words
=
(
width
+
31
)
/
32
;
break
;
case
4
:
words
=
(
width
+
7
)
/
8
;
break
;
case
8
:
words
=
(
width
+
3
)
/
4
;
break
;
case
15
:
case
16
:
words
=
(
width
+
1
)
/
2
;
break
;
case
24
:
words
=
(
width
*
3
+
3
)
/
4
;
break
;
default:
WARN
(
"(%d): Unsupported depth
\n
"
,
depth
);
/* fall through */
case
32
:
words
=
width
;
break
;
}
return
4
*
words
;
}
/***********************************************************************
* DIB_GetDIBImageBytes
*
* Return the number of bytes used to hold the image in a DIB bitmap.
*/
static
int
DIB_GetDIBImageBytes
(
int
width
,
int
height
,
int
depth
)
{
return
DIB_GetDIBWidthBytes
(
width
,
depth
)
*
abs
(
height
);
return
(((
width
*
depth
+
31
)
/
8
)
&
~
3
)
*
abs
(
height
);
}
...
...
dlls/comctl32/tests/imagelist.c
View file @
bd3b0e4f
...
...
@@ -738,24 +738,7 @@ static struct my_IStream Test_Stream = { { &Test_Stream_Vtbl }, 0, 0 };
static
INT
DIB_GetWidthBytes
(
int
width
,
int
bpp
)
{
int
words
;
switch
(
bpp
)
{
case
1
:
words
=
(
width
+
31
)
/
32
;
break
;
case
4
:
words
=
(
width
+
7
)
/
8
;
break
;
case
8
:
words
=
(
width
+
3
)
/
4
;
break
;
case
15
:
case
16
:
words
=
(
width
+
1
)
/
2
;
break
;
case
24
:
words
=
(
width
*
3
+
3
)
/
4
;
break
;
case
32
:
words
=
width
;
break
;
default:
trace
(
"Unknown depth %d, please report.
\n
"
,
bpp
);
assert
(
0
);
return
-
1
;
}
return
4
*
words
;
return
((
width
*
bpp
+
31
)
/
8
)
&
~
3
;
}
static
void
check_bitmap_data
(
const
char
*
bm_data
,
ULONG
bm_data_size
,
...
...
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