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
bcc65899
Commit
bcc65899
authored
Jan 06, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Remove DIB locking calls from all graphics functions.
parent
dcbfd3d0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
112 deletions
+1
-112
dib.c
dlls/winex11.drv/dib.c
+0
-18
graphics.c
dlls/winex11.drv/graphics.c
+0
-71
text.c
dlls/winex11.drv/text.c
+0
-12
x11drv.h
dlls/winex11.drv/x11drv.h
+0
-2
xrender.c
dlls/winex11.drv/xrender.c
+1
-9
No files found.
dlls/winex11.drv/dib.c
View file @
bcc65899
...
...
@@ -3777,24 +3777,6 @@ INT X11DRV_CoerceDIBSection(X11DRV_PDEVICE *physDev, INT req)
return
X11DRV_DIB_Coerce
(
physDev
->
bitmap
,
req
);
}
/***********************************************************************
* X11DRV_LockDIBSection
*/
INT
X11DRV_LockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
INT
req
)
{
if
(
!
physDev
||
!
physDev
->
bitmap
)
return
DIB_Status_None
;
return
X11DRV_DIB_Lock
(
physDev
->
bitmap
,
req
);
}
/***********************************************************************
* X11DRV_UnlockDIBSection
*/
void
X11DRV_UnlockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
BOOL
commit
)
{
if
(
!
physDev
||
!
physDev
->
bitmap
)
return
;
X11DRV_DIB_Unlock
(
physDev
->
bitmap
,
commit
);
}
#ifdef HAVE_LIBXXSHM
/***********************************************************************
...
...
dlls/winex11.drv/graphics.c
View file @
bcc65899
...
...
@@ -522,9 +522,6 @@ BOOL X11DRV_LineTo( PHYSDEV dev, INT x, INT y )
POINT
pt
[
2
];
if
(
X11DRV_SetupGCForPen
(
physDev
))
{
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
GetCurrentPositionEx
(
dev
->
hdc
,
&
pt
[
0
]
);
pt
[
1
].
x
=
x
;
pt
[
1
].
y
=
y
;
...
...
@@ -535,9 +532,6 @@ BOOL X11DRV_LineTo( PHYSDEV dev, INT x, INT y )
physDev
->
dc_rect
.
left
+
pt
[
0
].
x
,
physDev
->
dc_rect
.
top
+
pt
[
0
].
y
,
physDev
->
dc_rect
.
left
+
pt
[
1
].
x
,
physDev
->
dc_rect
.
top
+
pt
[
1
].
y
);
wine_tsx11_unlock
();
/* Update the DIBSection from the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
}
return
TRUE
;
}
...
...
@@ -559,7 +553,6 @@ static BOOL X11DRV_DrawArc( PHYSDEV dev, INT left, INT top, INT right, INT botto
INT
width
,
oldwidth
;
double
start_angle
,
end_angle
;
XPoint
points
[
4
];
BOOL
update
=
FALSE
;
POINT
start
,
end
;
RECT
rc
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
);
...
...
@@ -613,9 +606,6 @@ static BOOL X11DRV_DrawArc( PHYSDEV dev, INT left, INT top, INT right, INT botto
idiff_angle
=
(
INT
)((
end_angle
-
start_angle
)
*
180
*
64
/
PI
+
0
.
5
);
if
(
idiff_angle
<=
0
)
idiff_angle
+=
360
*
64
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
/* Fill arc with brush if Chord() or Pie() */
if
((
lines
>
0
)
&&
X11DRV_SetupGCForBrush
(
physDev
))
{
...
...
@@ -625,7 +615,6 @@ static BOOL X11DRV_DrawArc( PHYSDEV dev, INT left, INT top, INT right, INT botto
physDev
->
dc_rect
.
left
+
rc
.
left
,
physDev
->
dc_rect
.
top
+
rc
.
top
,
rc
.
right
-
rc
.
left
-
1
,
rc
.
bottom
-
rc
.
top
-
1
,
istart_angle
,
idiff_angle
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Draw arc and lines */
...
...
@@ -693,12 +682,8 @@ static BOOL X11DRV_DrawArc( PHYSDEV dev, INT left, INT top, INT right, INT botto
points
,
lines
+
1
,
CoordModeOrigin
);
}
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Update the DIBSection of the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
update
);
physDev
->
pen
.
width
=
oldwidth
;
return
TRUE
;
}
...
...
@@ -740,7 +725,6 @@ BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
INT
width
,
oldwidth
;
BOOL
update
=
FALSE
;
RECT
rc
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
);
if
((
rc
.
left
==
rc
.
right
)
||
(
rc
.
top
==
rc
.
bottom
))
return
TRUE
;
...
...
@@ -761,9 +745,6 @@ BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
if
(
width
==
0
)
width
=
1
;
/* more accurate */
physDev
->
pen
.
width
=
width
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
if
(
X11DRV_SetupGCForBrush
(
physDev
))
{
wine_tsx11_lock
();
...
...
@@ -771,7 +752,6 @@ BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
physDev
->
dc_rect
.
left
+
rc
.
left
,
physDev
->
dc_rect
.
top
+
rc
.
top
,
rc
.
right
-
rc
.
left
-
1
,
rc
.
bottom
-
rc
.
top
-
1
,
0
,
360
*
64
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
if
(
X11DRV_SetupGCForPen
(
physDev
))
{
...
...
@@ -780,12 +760,8 @@ BOOL X11DRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
physDev
->
dc_rect
.
left
+
rc
.
left
,
physDev
->
dc_rect
.
top
+
rc
.
top
,
rc
.
right
-
rc
.
left
-
1
,
rc
.
bottom
-
rc
.
top
-
1
,
0
,
360
*
64
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Update the DIBSection from the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
update
);
physDev
->
pen
.
width
=
oldwidth
;
return
TRUE
;
}
...
...
@@ -798,7 +774,6 @@ BOOL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
INT
width
,
oldwidth
,
oldjoinstyle
;
BOOL
update
=
FALSE
;
RECT
rc
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
);
TRACE
(
"(%d %d %d %d)
\n
"
,
left
,
top
,
right
,
bottom
);
...
...
@@ -824,9 +799,6 @@ BOOL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
if
(
physDev
->
pen
.
type
!=
PS_GEOMETRIC
)
physDev
->
pen
.
linejoin
=
PS_JOIN_MITER
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
if
((
rc
.
right
>
rc
.
left
+
width
)
&&
(
rc
.
bottom
>
rc
.
top
+
width
))
{
if
(
X11DRV_SetupGCForBrush
(
physDev
))
...
...
@@ -837,7 +809,6 @@ BOOL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
physDev
->
dc_rect
.
top
+
rc
.
top
+
(
width
+
1
)
/
2
,
rc
.
right
-
rc
.
left
-
width
-
1
,
rc
.
bottom
-
rc
.
top
-
width
-
1
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
}
if
(
X11DRV_SetupGCForPen
(
physDev
))
...
...
@@ -847,12 +818,8 @@ BOOL X11DRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
physDev
->
dc_rect
.
left
+
rc
.
left
,
physDev
->
dc_rect
.
top
+
rc
.
top
,
rc
.
right
-
rc
.
left
-
1
,
rc
.
bottom
-
rc
.
top
-
1
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Update the DIBSection from the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
update
);
physDev
->
pen
.
width
=
oldwidth
;
physDev
->
pen
.
linejoin
=
oldjoinstyle
;
return
TRUE
;
...
...
@@ -866,7 +833,6 @@ BOOL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
{
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
INT
width
,
oldwidth
,
oldendcap
;
BOOL
update
=
FALSE
;
POINT
pts
[
2
];
RECT
rc
=
get_device_rect
(
dev
->
hdc
,
left
,
top
,
right
,
bottom
);
...
...
@@ -903,9 +869,6 @@ BOOL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
physDev
->
pen
.
width
=
width
;
physDev
->
pen
.
endcap
=
PS_ENDCAP_SQUARE
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
if
(
X11DRV_SetupGCForBrush
(
physDev
))
{
wine_tsx11_lock
();
...
...
@@ -971,7 +934,6 @@ BOOL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
rc
.
bottom
-
rc
.
top
-
ell_height
-
1
);
}
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* FIXME: this could be done with on X call
* more efficient and probably more correct
...
...
@@ -1049,10 +1011,7 @@ BOOL X11DRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
physDev
->
dc_rect
.
top
+
rc
.
bottom
-
(
ell_height
+
1
)
/
2
);
}
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Update the DIBSection from the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
update
);
physDev
->
pen
.
width
=
oldwidth
;
physDev
->
pen
.
endcap
=
oldendcap
;
...
...
@@ -1138,12 +1097,10 @@ BOOL X11DRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
if
(
X11DRV_SetupGCForPen
(
physDev
))
{
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
wine_tsx11_lock
();
XDrawLines
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
points
,
count
,
CoordModeOrigin
);
wine_tsx11_unlock
();
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
}
HeapFree
(
GetProcessHeap
(),
0
,
points
);
...
...
@@ -1159,7 +1116,6 @@ BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
X11DRV_PDEVICE
*
physDev
=
get_x11drv_dev
(
dev
);
int
i
;
XPoint
*
points
;
BOOL
update
=
FALSE
;
if
(
!
(
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
XPoint
)
*
(
count
+
1
)
)))
{
...
...
@@ -1175,16 +1131,12 @@ BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
}
points
[
count
]
=
points
[
0
];
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
if
(
X11DRV_SetupGCForBrush
(
physDev
))
{
wine_tsx11_lock
();
XFillPolygon
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
points
,
count
+
1
,
Complex
,
CoordModeOrigin
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
if
(
X11DRV_SetupGCForPen
(
physDev
))
{
...
...
@@ -1192,12 +1144,8 @@ BOOL X11DRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
XDrawLines
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
points
,
count
+
1
,
CoordModeOrigin
);
wine_tsx11_unlock
();
update
=
TRUE
;
}
/* Update the DIBSection from the pixmap */
X11DRV_UnlockDIBSection
(
physDev
,
update
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
return
TRUE
;
}
...
...
@@ -1226,9 +1174,6 @@ BOOL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT p
int
j
,
max
=
0
;
XPoint
*
points
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
for
(
i
=
0
;
i
<
polygons
;
i
++
)
if
(
counts
[
i
]
>
max
)
max
=
counts
[
i
];
if
(
!
(
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
XPoint
)
*
(
max
+
1
)
)))
{
...
...
@@ -1251,10 +1196,6 @@ BOOL X11DRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT p
points
,
j
+
1
,
CoordModeOrigin
);
wine_tsx11_unlock
();
}
/* Update the DIBSection of the dc's bitmap */
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
}
return
TRUE
;
...
...
@@ -1273,9 +1214,6 @@ BOOL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
unsigned
int
i
,
j
,
max
=
0
;
XPoint
*
points
;
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
for
(
i
=
0
;
i
<
polylines
;
i
++
)
if
(
counts
[
i
]
>
max
)
max
=
counts
[
i
];
if
(
!
(
points
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
XPoint
)
*
max
)))
{
...
...
@@ -1297,10 +1235,6 @@ BOOL X11DRV_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
points
,
j
,
CoordModeOrigin
);
wine_tsx11_unlock
();
}
/* Update the DIBSection of the dc's bitmap */
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
HeapFree
(
GetProcessHeap
(),
0
,
points
);
}
return
TRUE
;
...
...
@@ -1427,9 +1361,6 @@ BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillTy
{
unsigned
long
pixel
=
X11DRV_PALETTE_ToPhysical
(
physDev
,
color
);
/* Update the pixmap from the DIB section */
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
/* ROP mode is always GXcopy for flood-fill */
wine_tsx11_lock
();
XSetFunction
(
gdi_display
,
physDev
->
gc
,
GXcopy
);
...
...
@@ -1440,8 +1371,6 @@ BOOL X11DRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillTy
physDev
->
dc_rect
.
top
+
rect
.
top
,
pixel
,
fillType
);
wine_tsx11_unlock
();
/* Update the DIBSection of the dc's bitmap */
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
}
wine_tsx11_lock
();
...
...
dlls/winex11.drv/text.c
View file @
bcc65899
...
...
@@ -47,7 +47,6 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
XFontStruct
*
font
;
BOOL
rotated
=
FALSE
;
XChar2b
*
str2b
=
NULL
;
BOOL
dibUpdateFlag
=
FALSE
;
BOOL
result
=
TRUE
;
if
(
!
pfo
)
...
...
@@ -71,8 +70,6 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
if
(
flags
&
ETO_OPAQUE
)
{
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
dibUpdateFlag
=
TRUE
;
wine_tsx11_lock
();
XSetForeground
(
gdi_display
,
physDev
->
gc
,
physDev
->
backgroundPixel
);
XFillRectangle
(
gdi_display
,
physDev
->
drawable
,
physDev
->
gc
,
...
...
@@ -92,14 +89,6 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
DeleteObject
(
clip_region
);
}
/* Draw the text background if necessary */
if
(
!
dibUpdateFlag
)
{
X11DRV_LockDIBSection
(
physDev
,
DIB_Status_GdiMod
);
dibUpdateFlag
=
TRUE
;
}
/* Draw the text (count > 0 verified) */
if
(
!
(
str2b
=
X11DRV_cptable
[
pfo
->
fi
->
cptable
].
punicode_to_char2b
(
pfo
,
wstr
,
count
)))
...
...
@@ -181,7 +170,6 @@ BOOL X11DRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
END:
HeapFree
(
GetProcessHeap
(),
0
,
str2b
);
if
(
dibUpdateFlag
)
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
if
(
restore_region
)
restore_clipping_region
(
physDev
);
return
result
;
}
...
...
dlls/winex11.drv/x11drv.h
View file @
bcc65899
...
...
@@ -463,8 +463,6 @@ extern const dib_conversions dib_normal DECLSPEC_HIDDEN, dib_src_byteswap DECLSP
extern
INT
X11DRV_DIB_MaskToShift
(
DWORD
mask
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_CoerceDIBSection
(
X11DRV_PDEVICE
*
physDev
,
INT
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_LockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
INT
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_UnlockDIBSection
(
X11DRV_PDEVICE
*
physDev
,
BOOL
)
DECLSPEC_HIDDEN
;
extern
INT
X11DRV_DIB_Lock
(
X_PHYSBITMAP
*
,
INT
)
DECLSPEC_HIDDEN
;
extern
void
X11DRV_DIB_Unlock
(
X_PHYSBITMAP
*
,
BOOL
)
DECLSPEC_HIDDEN
;
...
...
dlls/winex11.drv/xrender.c
View file @
bcc65899
...
...
@@ -1751,8 +1751,6 @@ static BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
XChangeGC
(
gdi_display
,
physdev
->
x11dev
->
gc
,
GCFunction
|
GCBackground
|
GCFillStyle
,
&
xgcval
);
wine_tsx11_unlock
();
X11DRV_LockDIBSection
(
physdev
->
x11dev
,
DIB_Status_GdiMod
);
if
(
physdev
->
x11dev
->
depth
==
1
)
{
if
((
physdev
->
x11dev
->
textPixel
&
0xffffff
)
==
0
)
{
textPixel
=
0
;
...
...
@@ -1776,11 +1774,7 @@ static BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
wine_tsx11_unlock
();
}
if
(
count
==
0
)
{
X11DRV_UnlockDIBSection
(
physdev
->
x11dev
,
TRUE
);
return
TRUE
;
}
if
(
count
==
0
)
return
TRUE
;
EnterCriticalSection
(
&
xrender_cs
);
...
...
@@ -1802,7 +1796,6 @@ static BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
{
WARN
(
"could not upload requested glyphs
\n
"
);
LeaveCriticalSection
(
&
xrender_cs
);
X11DRV_UnlockDIBSection
(
physdev
->
x11dev
,
TRUE
);
return
FALSE
;
}
...
...
@@ -1871,7 +1864,6 @@ static BOOL xrenderdrv_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
HeapFree
(
GetProcessHeap
(),
0
,
elts
);
LeaveCriticalSection
(
&
xrender_cs
);
X11DRV_UnlockDIBSection
(
physdev
->
x11dev
,
TRUE
);
return
TRUE
;
}
...
...
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