Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
dfb41b35
Commit
dfb41b35
authored
18 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
18 years ago
Browse files
Options
Downloads
Patches
Plain Diff
comctl32: Switch to a Nx4 tiling.
parent
67728733
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comctl32/imagelist.c
+39
-8
39 additions, 8 deletions
dlls/comctl32/imagelist.c
with
39 additions
and
8 deletions
dlls/comctl32/imagelist.c
+
39
−
8
View file @
dfb41b35
...
...
@@ -84,28 +84,59 @@ static inline BOOL is_valid(HIMAGELIST himl)
return
himl
&&
himl
->
magic
==
IMAGELIST_MAGIC
;
}
/*
* An imagelist with N images is tiled like this:
*
* N/4 ->
*
* 4 048C..
* 159D..
* | 26AE.N
* V 37BF.
*/
#define TILE_COUNT 4
static
inline
UINT
imagelist_width
(
UINT
count
)
{
return
((
count
+
TILE_COUNT
-
1
)
/
TILE_COUNT
);
}
static
inline
void
imagelist_point_from_index
(
HIMAGELIST
himl
,
UINT
index
,
LPPOINT
pt
)
{
pt
->
x
=
index
*
himl
->
cx
;
pt
->
y
=
0
;
pt
->
x
=
(
index
/
TILE_COUNT
)
*
himl
->
cx
;
pt
->
y
=
(
index
%
TILE_COUNT
)
*
himl
->
cy
;
}
static
inline
void
imagelist_get_bitmap_size
(
HIMAGELIST
himl
,
UINT
count
,
UINT
cy
,
SIZE
*
sz
)
{
sz
->
cx
=
count
*
himl
->
cx
;
sz
->
cy
=
cy
;
sz
->
cx
=
imagelist_width
(
count
)
*
himl
->
cx
;
sz
->
cy
=
cy
*
TILE_COUNT
;
}
/*
* imagelist_copy_images()
*
* Copies a block of count images from offset src in the list to offset dest.
* Images are copied a row at at time. Assumes hdcSrc and hdcDest are different.
*/
static
inline
void
imagelist_copy_images
(
HIMAGELIST
himl
,
HDC
hdcSrc
,
HDC
hdcDest
,
UINT
src
,
UINT
count
,
UINT
dest
)
{
POINT
ptSrc
,
ptDest
;
SIZE
sz
;
UINT
i
;
imagelist_point_from_index
(
himl
,
src
,
&
ptSrc
);
imagelist_point_from_index
(
himl
,
dest
,
&
ptDest
);
imagelist_get_bitmap_size
(
himl
,
count
,
himl
->
cy
,
&
sz
);
BitBlt
(
hdcDest
,
ptSrc
.
x
,
ptSrc
.
y
,
sz
.
cx
,
sz
.
cy
,
hdcSrc
,
ptDest
.
x
,
ptDest
.
y
,
SRCCOPY
);
for
(
i
=
0
;
i
<
TILE_COUNT
;
i
++
)
{
imagelist_point_from_index
(
himl
,
src
+
i
,
&
ptSrc
);
imagelist_point_from_index
(
himl
,
dest
+
i
,
&
ptDest
);
sz
.
cx
=
himl
->
cx
*
imagelist_width
(
count
-
i
);
sz
.
cy
=
himl
->
cy
;
BitBlt
(
hdcDest
,
ptDest
.
x
,
ptDest
.
y
,
sz
.
cx
,
sz
.
cy
,
hdcSrc
,
ptSrc
.
x
,
ptSrc
.
y
,
SRCCOPY
);
}
}
/*************************************************************************
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment