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
0d30daa8
Commit
0d30daa8
authored
Feb 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Abstract the depth->bpp conversion and use it in X11DRV_DIB_CreateDIBFromPixmap.
parent
68feed7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
30 deletions
+35
-30
dib.c
dlls/winex11.drv/dib.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+2
-0
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+32
-29
No files found.
dlls/winex11.drv/dib.c
View file @
0d30daa8
...
...
@@ -4856,7 +4856,7 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc)
* Create an HBITMAP with the same dimensions and BPP as the pixmap,
* and make it a container for the pixmap passed.
*/
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
depth
,
NULL
)
;
if
(
!
(
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
depth_to_bpp
(
depth
),
NULL
)))
return
0
;
/* force bitmap to be owned by a screen DC */
hdcMem
=
CreateCompatibleDC
(
hdc
);
...
...
dlls/winex11.drv/x11drv.h
View file @
0d30daa8
...
...
@@ -463,6 +463,8 @@ extern BOOL X11DRV_IsSolidColor(COLORREF color);
extern
COLORREF
X11DRV_PALETTE_ToLogical
(
int
pixel
);
extern
int
X11DRV_PALETTE_ToPhysical
(
X11DRV_PDEVICE
*
physDev
,
COLORREF
color
);
extern
unsigned
int
depth_to_bpp
(
unsigned
int
depth
);
/* GDI escapes */
#define X11DRV_ESCAPE 6789
...
...
dlls/winex11.drv/x11drv_main.c
View file @
0d30daa8
...
...
@@ -278,6 +278,37 @@ void wine_tsx11_unlock(void)
/***********************************************************************
* depth_to_bpp
*
* Convert X11-reported depth to the BPP value that Windows apps expect to see.
*/
unsigned
int
depth_to_bpp
(
unsigned
int
depth
)
{
switch
(
depth
)
{
case
1
:
case
8
:
return
depth
;
case
15
:
case
16
:
return
16
;
case
24
:
/* This is not necessarily right. X11 always has 24 bits per pixel, but it can run
* with 24 bit framebuffers and 32 bit framebuffers. It doesn't make any difference
* for windowing, but gl applications can get visuals with alpha channels. So we
* should check the framebuffer and/or opengl formats available to find out what the
* framebuffer actually does
*/
case
32
:
return
32
;
default:
FIXME
(
"Unexpected X11 depth %d bpp, what to report to app?
\n
"
,
depth
);
return
depth
;
}
}
/***********************************************************************
* get_config_key
*
* Get a config key from either the app-specific or the default config
...
...
@@ -491,35 +522,7 @@ static BOOL process_attach(void)
screen_depth
=
desktop_vi
->
depth
;
XFree
(
desktop_vi
);
}
switch
(
screen_depth
)
{
case
8
:
screen_bpp
=
8
;
break
;
case
15
:
/* In GetDeviceCaps MSDN description explicitly states that
* in 15 bpp mode 16 is returned.
*/
/* fall through */
case
16
:
screen_bpp
=
16
;
break
;
case
24
:
/* This is not necessarily right. X11 always has 24 bits per pixel, but it can run
* with 24 bit framebuffers and 32 bit framebuffers. It doesn't make any difference
* for windowing, but gl applications can get visuals with alpha channels. So we
* should check the framebuffer and/or opengl formats available to find out what the
* framebuffer actually does
*/
screen_bpp
=
32
;
break
;
default:
FIXME
(
"Unexpected X11 depth %d bpp, what to report to app?
\n
"
,
screen_depth
);
screen_bpp
=
screen_depth
;
}
screen_bpp
=
depth_to_bpp
(
screen_depth
);
XInternAtoms
(
display
,
(
char
**
)
atom_names
,
NB_XATOMS
-
FIRST_XATOM
,
False
,
X11DRV_Atoms
);
...
...
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