Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2e4b0b1e
Commit
2e4b0b1e
authored
Jul 06, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Set the reported screen bpp based on the available pixmap formats.
parent
99e422c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
31 deletions
+18
-31
dib.c
dlls/winex11.drv/dib.c
+2
-2
init.c
dlls/winex11.drv/init.c
+1
-3
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-2
x11drv_main.c
dlls/winex11.drv/x11drv_main.c
+14
-24
No files found.
dlls/winex11.drv/dib.c
View file @
2e4b0b1e
...
...
@@ -5053,7 +5053,7 @@ HGLOBAL X11DRV_DIB_CreateDIBFromPixmap(Pixmap pixmap, HDC hdc)
if
(
!
XGetGeometry
(
gdi_display
,
pixmap
,
&
root
,
&
x
,
&
y
,
&
width
,
&
height
,
&
border_width
,
&
depth
))
depth
=
0
;
wine_tsx11_unlock
();
if
(
!
depth
)
return
0
;
if
(
!
pixmap_formats
[
depth
]
)
return
0
;
TRACE
(
"
\t
Pixmap properties: width=%d, height=%d, depth=%d
\n
"
,
width
,
height
,
depth
);
...
...
@@ -5062,7 +5062,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.
*/
if
(
!
(
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
depth_to_bpp
(
depth
)
,
NULL
)))
return
0
;
if
(
!
(
hBmp
=
CreateBitmap
(
width
,
height
,
1
,
pixmap_formats
[
depth
]
->
bits_per_pixel
,
NULL
)))
return
0
;
/* force bitmap to be owned by a screen DC */
hdcMem
=
CreateCompatibleDC
(
hdc
);
...
...
dlls/winex11.drv/init.c
View file @
2e4b0b1e
...
...
@@ -240,10 +240,8 @@ INT CDECL X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap )
* BITSPIXEL: 8 -> COLORRES: 18
* BITSPIXEL: 16 -> COLORRES: 16
* BITSPIXEL: 24 -> COLORRES: 24
* (note that depth_to_bpp never chooses a bpp of 24)
* BITSPIXEL: 32 -> COLORRES: 24 */
return
(
screen_bpp
<=
8
)
?
18
:
(
screen_bpp
==
32
)
?
24
:
screen_bpp
;
return
(
screen_bpp
<=
8
)
?
18
:
min
(
24
,
screen_bpp
);
case
RASTERCAPS
:
return
(
RC_BITBLT
|
RC_BANDING
|
RC_SCALING
|
RC_BITMAP64
|
RC_DI_BITMAP
|
RC_DIBTODEV
|
RC_BIGFONT
|
RC_STRETCHBLT
|
RC_STRETCHDIB
|
RC_DEVBITS
|
...
...
dlls/winex11.drv/x11drv.h
View file @
2e4b0b1e
...
...
@@ -503,8 +503,6 @@ extern COLORREF X11DRV_PALETTE_GetColor( X11DRV_PDEVICE *physDev, COLORREF color
extern
int
X11DRV_PALETTE_LookupPixel
(
ColorShifts
*
shifts
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_PALETTE_ComputeColorShifts
(
ColorShifts
*
shifts
,
unsigned
long
redMask
,
unsigned
long
greenMask
,
unsigned
long
blueMask
)
DECLSPEC_HIDDEN
;
extern
unsigned
int
depth_to_bpp
(
unsigned
int
depth
)
DECLSPEC_HIDDEN
;
/* GDI escapes */
#define X11DRV_ESCAPE 6789
...
...
@@ -589,6 +587,7 @@ static inline size_t get_property_size( int format, unsigned long count )
}
extern
Visual
*
visual
DECLSPEC_HIDDEN
;
extern
XPixmapFormatValues
**
pixmap_formats
DECLSPEC_HIDDEN
;
extern
Window
root_window
DECLSPEC_HIDDEN
;
extern
int
clipping_cursor
DECLSPEC_HIDDEN
;
extern
unsigned
int
screen_width
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/x11drv_main.c
View file @
2e4b0b1e
...
...
@@ -69,6 +69,7 @@ static CRITICAL_SECTION X11DRV_CritSection = { &critsect_debug, -1, 0, 0, 0, 0 }
static
Screen
*
screen
;
Visual
*
visual
;
XPixmapFormatValues
**
pixmap_formats
;
unsigned
int
screen_width
;
unsigned
int
screen_height
;
unsigned
int
screen_bpp
;
...
...
@@ -324,33 +325,21 @@ void CDECL wine_tsx11_unlock(void)
/***********************************************************************
* depth_to_bpp
*
* Convert X11-reported depth to the BPP value that Windows apps expect to see.
* init_pixmap_formats
*/
unsigned
int
depth_to_bpp
(
unsigned
int
depth
)
static
void
init_pixmap_formats
(
Display
*
display
)
{
switch
(
depth
)
int
i
,
count
,
max
=
32
;
XPixmapFormatValues
*
formats
=
XListPixmapFormats
(
display
,
&
count
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
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
;
TRACE
(
"depth %u, bpp %u, pad %u
\n
"
,
formats
[
i
].
depth
,
formats
[
i
].
bits_per_pixel
,
formats
[
i
].
scanline_pad
);
if
(
formats
[
i
].
depth
>
max
)
max
=
formats
[
i
].
depth
;
}
pixmap_formats
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
pixmap_formats
)
*
(
max
+
1
)
);
for
(
i
=
0
;
i
<
count
;
i
++
)
pixmap_formats
[
formats
[
i
].
depth
]
=
&
formats
[
i
];
}
...
...
@@ -579,7 +568,8 @@ static BOOL process_attach(void)
}
}
if
(
!
screen_depth
)
screen_depth
=
DefaultDepthOfScreen
(
screen
);
screen_bpp
=
depth_to_bpp
(
screen_depth
);
init_pixmap_formats
(
display
);
screen_bpp
=
pixmap_formats
[
screen_depth
]
->
bits_per_pixel
;
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