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
44b4c745
Commit
44b4c745
authored
Aug 29, 2005
by
Frank Richter
Committed by
Alexandre Julliard
Aug 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass around what kind of transparency an image actually needs. Use
alpha-blending for 32bpp images.
parent
a15006fe
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
2 deletions
+42
-2
draw.c
dlls/uxtheme/draw.c
+0
-0
msstyles.c
dlls/uxtheme/msstyles.c
+34
-1
uxthemedll.h
dlls/uxtheme/uxthemedll.h
+8
-1
No files found.
dlls/uxtheme/draw.c
View file @
44b4c745
This diff is collapsed.
Click to expand it.
dlls/uxtheme/msstyles.c
View file @
44b4c745
...
...
@@ -876,6 +876,38 @@ PTHEME_PROPERTY MSSTYLES_FindProperty(PTHEME_CLASS tc, int iPartId, int iStateId
return
NULL
;
}
/* Prepare a bitmap to be used for alpha blending */
static
BOOL
prepare_alpha
(
HBITMAP
bmp
,
BOOL
*
hasAlpha
)
{
DIBSECTION
dib
;
int
n
;
BYTE
*
p
;
*
hasAlpha
=
FALSE
;
if
(
!
bmp
||
GetObjectW
(
bmp
,
sizeof
(
dib
),
&
dib
)
!=
sizeof
(
dib
))
return
FALSE
;
if
(
dib
.
dsBm
.
bmBitsPixel
!=
32
)
/* nothing to do */
return
TRUE
;
*
hasAlpha
=
TRUE
;
p
=
(
BYTE
*
)
dib
.
dsBm
.
bmBits
;
n
=
abs
(
dib
.
dsBmih
.
biHeight
)
*
dib
.
dsBmih
.
biWidth
;
/* AlphaBlend() wants premultiplied alpha, so do that now */
while
(
n
--
>
0
)
{
int
a
=
p
[
3
]
+
1
;
p
[
0
]
=
(
p
[
0
]
*
a
)
>>
8
;
p
[
1
]
=
(
p
[
1
]
*
a
)
>>
8
;
p
[
2
]
=
(
p
[
2
]
*
a
)
>>
8
;
p
+=
4
;
}
return
TRUE
;
}
HBITMAP
MSSTYLES_LoadBitmap
(
PTHEME_CLASS
tc
,
LPCWSTR
lpFilename
,
BOOL
*
hasAlpha
)
{
WCHAR
szFile
[
MAX_PATH
];
...
...
@@ -904,7 +936,8 @@ HBITMAP MSSTYLES_LoadBitmap (PTHEME_CLASS tc, LPCWSTR lpFilename, BOOL* hasAlpha
/* Not found? Load from resources */
img
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
THEME_IMAGE
));
img
->
image
=
LoadImageW
(
tc
->
hTheme
,
szFile
,
IMAGE_BITMAP
,
0
,
0
,
LR_CREATEDIBSECTION
);
img
->
hasAlpha
=
*
hasAlpha
=
FALSE
;
/* TODO: real check */
prepare_alpha
(
img
->
image
,
hasAlpha
);
img
->
hasAlpha
=
*
hasAlpha
;
/* ...and stow away for later reuse. */
lstrcpyW
(
img
->
name
,
szFile
);
img
->
next
=
tc
->
tf
->
images
;
...
...
dlls/uxtheme/uxthemedll.h
View file @
44b4c745
...
...
@@ -87,4 +87,11 @@ HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown,
extern
void
UXTHEME_InitSystem
(
HINSTANCE
hInst
);
#endif
/* No alpha blending */
#define ALPHABLEND_NONE 0
/* "Cheap" binary alpha blending - but possibly faster */
#define ALPHABLEND_BINARY 1
/* Full alpha blending */
#define ALPHABLEND_FULL 2
#endif
/* __WINE_UXTHEMEDLL_H */
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