Alexandre Julliard : winex11: Fix a potential deadlock in the GradientFill non-XRender fallback.
Alexandre Julliard
julliard at winehq.org
Tue Apr 3 12:17:38 CDT 2012
Module: wine
Branch: master
Commit: 46390b09d5dccce6704208ea62cbf53e29e0ce90
URL: http://source.winehq.org/git/wine.git/?a=commit;h=46390b09d5dccce6704208ea62cbf53e29e0ce90
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Apr 2 22:21:22 2012 +0200
winex11: Fix a potential deadlock in the GradientFill non-XRender fallback.
---
dlls/winex11.drv/graphics.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c
index afe2ff1..e78cd74 100644
--- a/dlls/winex11.drv/graphics.c
+++ b/dlls/winex11.drv/graphics.c
@@ -1446,11 +1446,13 @@ BOOL X11DRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
}
for (x = 0, pos = min( pt[0].x, pt[1].x ); x < dx; x++, pos++)
{
- COLORREF color = RGB( (v[0].Red * (dx - x) + v[1].Red * x) / dx / 256,
+ int color = X11DRV_PALETTE_ToPhysical( physdev,
+ RGB( (v[0].Red * (dx - x) + v[1].Red * x) / dx / 256,
(v[0].Green * (dx - x) + v[1].Green * x) / dx / 256,
- (v[0].Blue * (dx - x) + v[1].Blue * x) / dx / 256);
+ (v[0].Blue * (dx - x) + v[1].Blue * x) / dx / 256) );
+
wine_tsx11_lock();
- XSetForeground( gdi_display, physdev->gc, X11DRV_PALETTE_ToPhysical( physdev, color ));
+ XSetForeground( gdi_display, physdev->gc, color );
XDrawLine( gdi_display, physdev->drawable, physdev->gc,
physdev->dc_rect.left + pos, physdev->dc_rect.top + pt[0].y,
physdev->dc_rect.left + pos, physdev->dc_rect.top + pt[1].y );
@@ -1491,11 +1493,13 @@ BOOL X11DRV_GradientFill( PHYSDEV dev, TRIVERTEX *vert_array, ULONG nvert,
}
for (y = 0, pos = min( pt[0].y, pt[1].y ); y < dy; y++, pos++)
{
- COLORREF color = RGB( (v[0].Red * (dy - y) + v[1].Red * y) / dy / 256,
+ int color = X11DRV_PALETTE_ToPhysical( physdev,
+ RGB( (v[0].Red * (dy - y) + v[1].Red * y) / dy / 256,
(v[0].Green * (dy - y) + v[1].Green * y) / dy / 256,
- (v[0].Blue * (dy - y) + v[1].Blue * y) / dy / 256);
+ (v[0].Blue * (dy - y) + v[1].Blue * y) / dy / 256) );
+
wine_tsx11_lock();
- XSetForeground( gdi_display, physdev->gc, X11DRV_PALETTE_ToPhysical( physdev, color ));
+ XSetForeground( gdi_display, physdev->gc, color );
XDrawLine( gdi_display, physdev->drawable, physdev->gc,
physdev->dc_rect.left + pt[0].x, physdev->dc_rect.top + pos,
physdev->dc_rect.left + pt[1].x, physdev->dc_rect.top + pos );
More information about the wine-cvs
mailing list