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
8062bbde
Commit
8062bbde
authored
Apr 14, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Apr 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In X11DRV_DIB_SetImageBits avoid BadMatch errors when calling
XGetSubImage.
parent
036dcf2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
7 deletions
+37
-7
dib.c
dlls/x11drv/dib.c
+37
-7
No files found.
dlls/x11drv/dib.c
View file @
8062bbde
...
...
@@ -3449,6 +3449,41 @@ static void X11DRV_DIB_GetImageBits_32( int lines, BYTE *dstbits,
}
}
static
int
XGetSubImageErrorHandler
(
Display
*
dpy
,
XErrorEvent
*
event
,
void
*
arg
)
{
return
(
event
->
request_code
==
X_GetImage
&&
event
->
error_code
==
BadMatch
);
}
/***********************************************************************
* X11DRV_DIB_SetImageBits_GetSubImage
*
* Helper for X11DRV_DIB_SetImageBits
*/
static
void
X11DRV_DIB_SetImageBits_GetSubImage
(
const
X11DRV_DIB_IMAGEBITS_DESCR
*
descr
,
XImage
*
bmpImage
)
{
/* compressed bitmaps may contain gaps in them. So make a copy
* of the existing pixels first */
RECT
bmprc
,
rc
;
SetRect
(
&
bmprc
,
descr
->
xDest
,
descr
->
yDest
,
descr
->
xDest
+
descr
->
width
,
descr
->
yDest
+
descr
->
height
);
GetRgnBox
(
descr
->
physDev
->
region
,
&
rc
);
/* convert from dc to drawable origin */
OffsetRect
(
&
rc
,
descr
->
physDev
->
org
.
x
,
descr
->
physDev
->
org
.
y
);
/* clip visible rect with bitmap */
if
(
IntersectRect
(
&
rc
,
&
rc
,
&
bmprc
))
{
X11DRV_expect_error
(
gdi_display
,
XGetSubImageErrorHandler
,
NULL
);
XGetSubImage
(
gdi_display
,
descr
->
drawable
,
rc
.
left
,
rc
.
top
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
AllPlanes
,
ZPixmap
,
bmpImage
,
descr
->
xSrc
+
rc
.
left
-
bmprc
.
left
,
descr
->
ySrc
+
rc
.
top
-
bmprc
.
top
);
X11DRV_check_error
();
}
}
/***********************************************************************
* X11DRV_DIB_SetImageBits
*
...
...
@@ -3491,10 +3526,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
break
;
case
4
:
if
(
descr
->
compression
)
{
XGetSubImage
(
gdi_display
,
descr
->
drawable
,
descr
->
xDest
,
descr
->
yDest
,
descr
->
width
,
descr
->
height
,
AllPlanes
,
ZPixmap
,
bmpImage
,
descr
->
xSrc
,
descr
->
ySrc
);
X11DRV_DIB_SetImageBits_GetSubImage
(
descr
,
bmpImage
);
X11DRV_DIB_SetImageBits_RLE4
(
descr
->
lines
,
descr
->
bits
,
descr
->
infoWidth
,
descr
->
width
,
descr
->
xSrc
,
(
int
*
)(
descr
->
colorMap
),
...
...
@@ -3507,9 +3539,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
break
;
case
8
:
if
(
descr
->
compression
)
{
XGetSubImage
(
gdi_display
,
descr
->
drawable
,
descr
->
xDest
,
descr
->
yDest
,
descr
->
width
,
descr
->
height
,
AllPlanes
,
ZPixmap
,
bmpImage
,
descr
->
xSrc
,
descr
->
ySrc
);
X11DRV_DIB_SetImageBits_GetSubImage
(
descr
,
bmpImage
);
X11DRV_DIB_SetImageBits_RLE8
(
descr
->
lines
,
descr
->
bits
,
descr
->
infoWidth
,
descr
->
width
,
descr
->
xSrc
,
(
int
*
)(
descr
->
colorMap
),
...
...
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