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
73919154
Commit
73919154
authored
May 29, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Always allocate a new GC for bitmap operations.
parent
567340f0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
12 deletions
+19
-12
bitblt.c
dlls/winex11.drv/bitblt.c
+10
-3
bitmap.c
dlls/winex11.drv/bitmap.c
+1
-1
brush.c
dlls/winex11.drv/brush.c
+4
-3
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-3
xrender.c
dlls/winex11.drv/xrender.c
+4
-2
No files found.
dlls/winex11.drv/bitblt.c
View file @
73919154
...
...
@@ -1365,16 +1365,21 @@ DWORD X11DRV_GetImage( PHYSDEV dev, BITMAPINFO *info,
if
(
X11DRV_check_error
())
{
/* use a temporary pixmap to avoid the BadMatch error */
GC
gc
;
Pixmap
pixmap
;
wine_tsx11_lock
();
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
vis
.
depth
);
XCopyArea
(
gdi_display
,
physdev
->
drawable
,
pixmap
,
get_bitmap_gc
(
vis
.
depth
),
gc
=
XCreateGC
(
gdi_display
,
pixmap
,
0
,
NULL
);
XSetGraphicsExposures
(
gdi_display
,
gc
,
False
);
XCopyArea
(
gdi_display
,
physdev
->
drawable
,
pixmap
,
gc
,
physdev
->
dc_rect
.
left
+
x
,
physdev
->
dc_rect
.
top
+
y
,
width
,
height
,
0
,
0
);
image
=
XGetImage
(
gdi_display
,
pixmap
,
0
,
0
,
width
,
height
,
AllPlanes
,
ZPixmap
);
XFreePixmap
(
gdi_display
,
pixmap
);
XFreeGC
(
gdi_display
,
gc
);
wine_tsx11_unlock
();
}
if
(
!
image
)
return
ERROR_OUTOFMEMORY
;
info
->
bmiHeader
.
biWidth
=
width
;
...
...
@@ -1408,6 +1413,7 @@ static DWORD put_pixmap_image( Pixmap pixmap, const XVisualInfo *vis,
{
DWORD
ret
;
XImage
*
image
;
GC
gc
;
struct
bitblt_coords
coords
;
struct
gdi_image_bits
dst_bits
;
const
XPixmapFormatValues
*
format
=
pixmap_formats
[
vis
->
depth
];
...
...
@@ -1439,8 +1445,9 @@ static DWORD put_pixmap_image( Pixmap pixmap, const XVisualInfo *vis,
{
image
->
data
=
dst_bits
.
ptr
;
wine_tsx11_lock
();
XPutImage
(
gdi_display
,
pixmap
,
get_bitmap_gc
(
vis
->
depth
),
image
,
0
,
0
,
0
,
0
,
coords
.
width
,
coords
.
height
);
gc
=
XCreateGC
(
gdi_display
,
pixmap
,
0
,
NULL
);
XPutImage
(
gdi_display
,
pixmap
,
gc
,
image
,
0
,
0
,
0
,
0
,
coords
.
width
,
coords
.
height
);
XFreeGC
(
gdi_display
,
gc
);
wine_tsx11_unlock
();
image
->
data
=
NULL
;
}
...
...
dlls/winex11.drv/bitmap.c
View file @
73919154
...
...
@@ -36,7 +36,7 @@ X_PHYSBITMAP BITMAP_stock_phys_bitmap = { 0 }; /* phys bitmap for the default s
static
XContext
bitmap_context
;
/* X context to associate a phys bitmap to a handle */
GC
get_bitmap_gc
(
int
depth
)
static
GC
get_bitmap_gc
(
int
depth
)
{
if
(
depth
<
1
||
depth
>
32
)
return
0
;
...
...
dlls/winex11.drv/brush.c
View file @
73919154
...
...
@@ -110,7 +110,7 @@ static Pixmap BRUSH_DitherColor( COLORREF color, int depth)
static
COLORREF
prevColor
=
0xffffffff
;
unsigned
int
x
,
y
;
Pixmap
pixmap
;
GC
gc
=
get_bitmap_gc
(
depth
)
;
GC
gc
;
wine_tsx11_lock
();
if
(
!
ditherImage
)
...
...
@@ -149,8 +149,9 @@ static Pixmap BRUSH_DitherColor( COLORREF color, int depth)
}
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
MATRIX_SIZE
,
MATRIX_SIZE
,
depth
);
XPutImage
(
gdi_display
,
pixmap
,
gc
,
ditherImage
,
0
,
0
,
0
,
0
,
MATRIX_SIZE
,
MATRIX_SIZE
);
gc
=
XCreateGC
(
gdi_display
,
pixmap
,
0
,
NULL
);
XPutImage
(
gdi_display
,
pixmap
,
gc
,
ditherImage
,
0
,
0
,
0
,
0
,
MATRIX_SIZE
,
MATRIX_SIZE
);
XFreeGC
(
gdi_display
,
gc
);
wine_tsx11_unlock
();
return
pixmap
;
...
...
dlls/winex11.drv/x11drv.h
View file @
73919154
...
...
@@ -164,9 +164,6 @@ static inline void add_bounds_rect( RECT *bounds, const RECT *rect )
extern
X_PHYSBITMAP
BITMAP_stock_phys_bitmap
DECLSPEC_HIDDEN
;
/* phys bitmap for the default stock bitmap */
/* Retrieve the GC used for bitmap operations */
extern
GC
get_bitmap_gc
(
int
depth
)
DECLSPEC_HIDDEN
;
/* Wine driver X11 functions */
extern
BOOL
X11DRV_Arc
(
PHYSDEV
dev
,
INT
left
,
INT
top
,
INT
right
,
...
...
dlls/winex11.drv/xrender.c
View file @
73919154
...
...
@@ -1876,6 +1876,7 @@ static DWORD create_image_pixmap( BITMAPINFO *info, const struct gdi_image_bits
int
depth
=
pict_formats
[
format
]
->
depth
;
struct
gdi_image_bits
dst_bits
;
XRenderPictureAttributes
pa
;
GC
gc
;
XImage
*
image
;
wine_tsx11_lock
();
...
...
@@ -1894,9 +1895,10 @@ static DWORD create_image_pixmap( BITMAPINFO *info, const struct gdi_image_bits
wine_tsx11_lock
();
*
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
depth
);
XPutImage
(
gdi_display
,
*
pixmap
,
get_bitmap_gc
(
depth
),
image
,
src
->
visrect
.
left
,
0
,
0
,
0
,
width
,
height
);
gc
=
XCreateGC
(
gdi_display
,
*
pixmap
,
0
,
NULL
);
XPutImage
(
gdi_display
,
*
pixmap
,
gc
,
image
,
src
->
visrect
.
left
,
0
,
0
,
0
,
width
,
height
);
*
pict
=
pXRenderCreatePicture
(
gdi_display
,
*
pixmap
,
pict_formats
[
format
],
CPRepeat
,
&
pa
);
XFreeGC
(
gdi_display
,
gc
);
wine_tsx11_unlock
();
/* make coordinates relative to the pixmap */
...
...
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