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
f1430100
Commit
f1430100
authored
Mar 21, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Relax the bitmap depth check in CreateBitmap to accept some compatible formats.
parent
11e01b17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
17 deletions
+16
-17
bitmap.c
dlls/winex11.drv/bitmap.c
+16
-17
No files found.
dlls/winex11.drv/bitmap.c
View file @
f1430100
...
...
@@ -121,7 +121,13 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit
/* Check parameters */
if
(
bitmap
.
bmPlanes
!=
1
)
return
FALSE
;
if
((
bitmap
.
bmBitsPixel
!=
1
)
&&
(
bitmap
.
bmBitsPixel
!=
screen_depth
))
/* check if bpp is compatible with screen depth */
if
(
!
((
bitmap
.
bmBitsPixel
==
1
)
||
(
bitmap
.
bmBitsPixel
==
screen_depth
)
||
(
bitmap
.
bmBitsPixel
==
24
&&
screen_depth
==
32
)
||
(
bitmap
.
bmBitsPixel
==
32
&&
screen_depth
==
24
)
||
(
bitmap
.
bmBitsPixel
==
15
&&
screen_depth
==
16
)
||
(
bitmap
.
bmBitsPixel
==
16
&&
screen_depth
==
15
)))
{
ERR
(
"Trying to make bitmap with planes=%d, bpp=%d
\n
"
,
bitmap
.
bmPlanes
,
bitmap
.
bmBitsPixel
);
...
...
@@ -139,9 +145,9 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit
/* Create the pixmap */
wine_tsx11_lock
();
physBitmap
->
pixmap_depth
=
bitmap
.
bmBitsPixel
;
physBitmap
->
pixmap_depth
=
(
bitmap
.
bmBitsPixel
==
1
)
?
1
:
screen_depth
;
physBitmap
->
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
bitmap
.
bmBitsPixel
);
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
physBitmap
->
pixmap_depth
);
wine_tsx11_unlock
();
if
(
!
physBitmap
->
pixmap
)
{
...
...
@@ -178,7 +184,7 @@ LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count )
{
BITMAP
bitmap
;
X_PHYSBITMAP
*
physBitmap
=
X11DRV_get_phys_bitmap
(
hbitmap
);
LONG
old_height
,
height
;
LONG
height
;
XImage
*
image
;
LPBYTE
tbuf
,
startline
;
int
h
,
w
;
...
...
@@ -188,21 +194,14 @@ LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count )
TRACE
(
"(bmp=%p, buffer=%p, count=0x%x)
\n
"
,
hbitmap
,
buffer
,
count
);
wine_tsx11_lock
();
/* Hack: change the bitmap height temporarily to avoid */
/* getting unnecessary bitmap rows. */
old_height
=
bitmap
.
bmHeight
;
height
=
bitmap
.
bmHeight
=
count
/
bitmap
.
bmWidthBytes
;
height
=
count
/
bitmap
.
bmWidthBytes
;
image
=
XGetImage
(
gdi_display
,
physBitmap
->
pixmap
,
0
,
0
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
AllPlanes
,
ZPixmap
);
bitmap
.
bmHeight
=
old_height
;
bitmap
.
bmWidth
,
height
,
AllPlanes
,
ZPixmap
);
/* copy XImage to 16 bit padded image buffer with real bitsperpixel */
startline
=
buffer
;
switch
(
physBitmap
->
pixmap_depth
)
switch
(
bitmap
.
bmBitsPixel
)
{
case
1
:
for
(
h
=
0
;
h
<
height
;
h
++
)
...
...
@@ -288,7 +287,7 @@ LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count )
}
break
;
default:
FIXME
(
"Unhandled bits:%d
\n
"
,
physBitmap
->
pixmap_depth
);
FIXME
(
"Unhandled bits:%d
\n
"
,
bitmap
.
bmBitsPixel
);
}
XDestroyImage
(
image
);
wine_tsx11_unlock
();
...
...
@@ -334,7 +333,7 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count )
startline
=
bits
;
switch
(
physBitmap
->
pixmap_depth
)
switch
(
bitmap
.
bmBitsPixel
)
{
case
1
:
for
(
h
=
0
;
h
<
height
;
h
++
)
...
...
@@ -408,7 +407,7 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count )
}
break
;
default:
FIXME
(
"Unhandled bits:%d
\n
"
,
physBitmap
->
pixmap_depth
);
FIXME
(
"Unhandled bits:%d
\n
"
,
bitmap
.
bmBitsPixel
);
}
XPutImage
(
gdi_display
,
physBitmap
->
pixmap
,
BITMAP_GC
(
physBitmap
),
...
...
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