2 * X11 graphics driver graphics functions
4 * Copyright 1993,1994 Alexandre Julliard
13 #include <X11/Xutil.h>
14 #include <X11/Intrinsic.h>
37 /**********************************************************************
41 X11DRV_MoveToEx(DC
*dc
,INT32 x
,INT32 y
,LPPOINT32 pt
) {
44 pt
->x
= dc
->w
.CursPosX
;
45 pt
->y
= dc
->w
.CursPosY
;
52 /***********************************************************************
56 X11DRV_LineTo( DC
*dc
, INT32 x
, INT32 y
)
58 if (DC_SetupGCForPen( dc
))
59 XDrawLine(display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
60 dc
->w
.DCOrgX
+ XLPTODP( dc
, dc
->w
.CursPosX
),
61 dc
->w
.DCOrgY
+ YLPTODP( dc
, dc
->w
.CursPosY
),
62 dc
->w
.DCOrgX
+ XLPTODP( dc
, x
),
63 dc
->w
.DCOrgY
+ YLPTODP( dc
, y
) );
71 /***********************************************************************
74 * Helper functions for Arc(), Chord() and Pie().
75 * 'lines' is the number of lines to draw: 0 for Arc, 1 for Chord, 2 for Pie.
78 X11DRV_DrawArc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
79 INT32 bottom
, INT32 xstart
, INT32 ystart
,
80 INT32 xend
, INT32 yend
, INT32 lines
)
82 INT32 xcenter
, ycenter
, istart_angle
, idiff_angle
, tmp
;
83 double start_angle
, end_angle
;
86 left
= XLPTODP( dc
, left
);
87 top
= YLPTODP( dc
, top
);
88 right
= XLPTODP( dc
, right
);
89 bottom
= YLPTODP( dc
, bottom
);
90 xstart
= XLPTODP( dc
, xstart
);
91 ystart
= YLPTODP( dc
, ystart
);
92 xend
= XLPTODP( dc
, xend
);
93 yend
= YLPTODP( dc
, yend
);
94 if ((left
== right
) || (top
== bottom
)) return FALSE
;
96 xcenter
= (right
+ left
) / 2;
97 ycenter
= (bottom
+ top
) / 2;
98 start_angle
= atan2( (double)(ycenter
-ystart
)*(right
-left
),
99 (double)(xstart
-xcenter
)*(bottom
-top
) );
100 end_angle
= atan2( (double)(ycenter
-yend
)*(right
-left
),
101 (double)(xend
-xcenter
)*(bottom
-top
) );
102 istart_angle
= (INT32
)(start_angle
* 180 * 64 / PI
);
103 idiff_angle
= (INT32
)((end_angle
- start_angle
) * 180 * 64 / PI
);
104 if (idiff_angle
<= 0) idiff_angle
+= 360 * 64;
105 if (left
> right
) { tmp
=left
; left
=right
; right
=tmp
; }
106 if (top
> bottom
) { tmp
=top
; top
=bottom
; bottom
=tmp
; }
108 /* Fill arc with brush if Chord() or Pie() */
110 if ((lines
> 0) && DC_SetupGCForBrush( dc
))
112 XSetArcMode( display
, dc
->u
.x
.gc
, (lines
==1) ? ArcChord
: ArcPieSlice
);
113 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
114 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
115 right
-left
-1, bottom
-top
-1, istart_angle
, idiff_angle
);
118 /* Draw arc and lines */
120 if (!DC_SetupGCForPen( dc
)) return TRUE
;
121 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
122 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
123 right
-left
-1, bottom
-top
-1, istart_angle
, idiff_angle
);
124 if (!lines
) return TRUE
;
126 points
[0].x
= dc
->w
.DCOrgX
+ xcenter
+ (int)(cos(start_angle
) * (right
-left
) / 2);
127 points
[0].y
= dc
->w
.DCOrgY
+ ycenter
- (int)(sin(start_angle
) * (bottom
-top
) / 2);
128 points
[1].x
= dc
->w
.DCOrgX
+ xcenter
+ (int)(cos(end_angle
) * (right
-left
) / 2);
129 points
[1].y
= dc
->w
.DCOrgY
+ ycenter
- (int)(sin(end_angle
) * (bottom
-top
) / 2);
132 points
[2] = points
[1];
133 points
[1].x
= dc
->w
.DCOrgX
+ xcenter
;
134 points
[1].y
= dc
->w
.DCOrgY
+ ycenter
;
136 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
137 points
, lines
+1, CoordModeOrigin
);
142 /***********************************************************************
146 X11DRV_Arc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
147 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
149 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
150 xstart
, ystart
, xend
, yend
, 0 );
154 /***********************************************************************
158 X11DRV_Pie( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
159 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
161 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
162 xstart
, ystart
, xend
, yend
, 2 );
165 /***********************************************************************
169 X11DRV_Chord( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
170 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
172 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
173 xstart
, ystart
, xend
, yend
, 1 );
177 /***********************************************************************
181 X11DRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
183 left
= XLPTODP( dc
, left
);
184 top
= YLPTODP( dc
, top
);
185 right
= XLPTODP( dc
, right
);
186 bottom
= YLPTODP( dc
, bottom
);
187 if ((left
== right
) || (top
== bottom
)) return FALSE
;
189 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
190 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
192 if ((dc
->u
.x
.pen
.style
== PS_INSIDEFRAME
) &&
193 (dc
->u
.x
.pen
.width
< right
-left
-1) &&
194 (dc
->u
.x
.pen
.width
< bottom
-top
-1))
196 left
+= dc
->u
.x
.pen
.width
/ 2;
197 right
-= (dc
->u
.x
.pen
.width
+ 1) / 2;
198 top
+= dc
->u
.x
.pen
.width
/ 2;
199 bottom
-= (dc
->u
.x
.pen
.width
+ 1) / 2;
202 if (DC_SetupGCForBrush( dc
))
203 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
204 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
205 right
-left
-1, bottom
-top
-1, 0, 360*64 );
206 if (DC_SetupGCForPen( dc
))
207 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
208 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
209 right
-left
-1, bottom
-top
-1, 0, 360*64 );
214 /***********************************************************************
218 X11DRV_Rectangle(DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
221 left
= XLPTODP( dc
, left
);
222 top
= YLPTODP( dc
, top
);
223 right
= XLPTODP( dc
, right
);
224 bottom
= YLPTODP( dc
, bottom
);
226 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
227 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
229 if ((left
== right
) || (top
== bottom
))
231 if (DC_SetupGCForPen( dc
))
232 XDrawLine(display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
235 dc
->w
.DCOrgX
+ right
,
236 dc
->w
.DCOrgY
+ bottom
);
239 width
= dc
->u
.x
.pen
.width
;
240 if (!width
) width
= 1;
241 if(dc
->u
.x
.pen
.style
== PS_NULL
) width
= 0;
243 if ((dc
->u
.x
.pen
.style
== PS_INSIDEFRAME
) &&
244 (width
< right
-left
) && (width
< bottom
-top
))
247 right
-= (width
+ 1) / 2;
249 bottom
-= (width
+ 1) / 2;
252 if ((right
> left
+ width
) && (bottom
> top
+ width
))
254 if (DC_SetupGCForBrush( dc
))
255 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
256 dc
->w
.DCOrgX
+ left
+ (width
+ 1) / 2,
257 dc
->w
.DCOrgY
+ top
+ (width
+ 1) / 2,
258 right
-left
-width
-1, bottom
-top
-width
-1);
260 if (DC_SetupGCForPen( dc
))
261 XDrawRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
262 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
263 right
-left
-1, bottom
-top
-1 );
267 /***********************************************************************
271 X11DRV_RoundRect( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
272 INT32 bottom
, INT32 ell_width
, INT32 ell_height
)
274 dprintf_graphics(stddeb
, "X11DRV_RoundRect(%d %d %d %d %d %d\n",
275 left
, top
, right
, bottom
, ell_width
, ell_height
);
277 left
= XLPTODP( dc
, left
);
278 top
= YLPTODP( dc
, top
);
279 right
= XLPTODP( dc
, right
);
280 bottom
= YLPTODP( dc
, bottom
);
281 ell_width
= abs( ell_width
* dc
->vportExtX
/ dc
->wndExtX
);
282 ell_height
= abs( ell_height
* dc
->vportExtY
/ dc
->wndExtY
);
284 /* Fix the coordinates */
286 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
287 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
288 if (ell_width
> right
- left
) ell_width
= right
- left
;
289 if (ell_height
> bottom
- top
) ell_height
= bottom
- top
;
291 if (DC_SetupGCForBrush( dc
))
293 if (ell_width
&& ell_height
)
295 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
296 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
297 ell_width
, ell_height
, 90 * 64, 90 * 64 );
298 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
299 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ bottom
- ell_height
,
300 ell_width
, ell_height
, 180 * 64, 90 * 64 );
301 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
302 dc
->w
.DCOrgX
+ right
- ell_width
,
303 dc
->w
.DCOrgY
+ bottom
- ell_height
,
304 ell_width
, ell_height
, 270 * 64, 90 * 64 );
305 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
306 dc
->w
.DCOrgX
+ right
- ell_width
, dc
->w
.DCOrgY
+ top
,
307 ell_width
, ell_height
, 0, 90 * 64 );
309 if (ell_width
< right
- left
)
311 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
312 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
314 right
- left
- ell_width
, ell_height
/ 2 );
315 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
316 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
317 dc
->w
.DCOrgY
+ bottom
- (ell_height
+1) / 2,
318 right
- left
- ell_width
, (ell_height
+1) / 2 );
320 if (ell_height
< bottom
- top
)
322 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
324 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
325 right
- left
, bottom
- top
- ell_height
);
328 if (DC_SetupGCForPen(dc
))
330 if (ell_width
&& ell_height
)
332 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
333 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
334 ell_width
, ell_height
, 90 * 64, 90 * 64 );
335 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
336 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ bottom
- ell_height
,
337 ell_width
, ell_height
, 180 * 64, 90 * 64 );
338 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
339 dc
->w
.DCOrgX
+ right
- ell_width
,
340 dc
->w
.DCOrgY
+ bottom
- ell_height
,
341 ell_width
, ell_height
, 270 * 64, 90 * 64 );
342 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
343 dc
->w
.DCOrgX
+ right
- ell_width
, dc
->w
.DCOrgY
+ top
,
344 ell_width
, ell_height
, 0, 90 * 64 );
346 if (ell_width
< right
- left
)
348 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
349 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
351 dc
->w
.DCOrgX
+ right
- ell_width
/ 2,
352 dc
->w
.DCOrgY
+ top
);
353 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
354 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
355 dc
->w
.DCOrgY
+ bottom
,
356 dc
->w
.DCOrgX
+ right
- ell_width
/ 2,
357 dc
->w
.DCOrgY
+ bottom
);
359 if (ell_height
< bottom
- top
)
361 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
362 dc
->w
.DCOrgX
+ right
,
363 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
364 dc
->w
.DCOrgX
+ right
,
365 dc
->w
.DCOrgY
+ bottom
- ell_height
/ 2 );
366 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
368 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
370 dc
->w
.DCOrgY
+ bottom
- ell_height
/ 2 );
377 /***********************************************************************
381 X11DRV_SetPixel( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
)
385 x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, x
);
386 y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, y
);
387 pixel
= COLOR_ToPhysical( dc
, color
);
389 XSetForeground( display
, dc
->u
.x
.gc
, pixel
);
390 XSetFunction( display
, dc
->u
.x
.gc
, GXcopy
);
391 XDrawPoint( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
, x
, y
);
393 /* inefficient but simple... */
395 return COLOR_ToLogical(pixel
);
399 /***********************************************************************
403 X11DRV_GetPixel( DC
*dc
, INT32 x
, INT32 y
)
405 static Pixmap pixmap
= 0;
409 x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, x
);
410 y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, y
);
411 if (dc
->w
.flags
& DC_MEMORY
)
413 image
= XGetImage( display
, dc
->u
.x
.drawable
, x
, y
, 1, 1,
414 AllPlanes
, ZPixmap
);
418 /* If we are reading from the screen, use a temporary copy */
419 /* to avoid a BadMatch error */
420 if (!pixmap
) pixmap
= XCreatePixmap( display
, rootWindow
,
421 1, 1, dc
->w
.bitsPerPixel
);
422 XCopyArea( display
, dc
->u
.x
.drawable
, pixmap
, BITMAP_colorGC
,
424 image
= XGetImage( display
, pixmap
, 0, 0, 1, 1, AllPlanes
, ZPixmap
);
426 pixel
= XGetPixel( image
, 0, 0 );
427 XDestroyImage( image
);
429 return COLOR_ToLogical(pixel
);
433 /***********************************************************************
437 X11DRV_PaintRgn( DC
*dc
, HRGN32 hrgn
)
440 HRGN32 tmpVisRgn
, prevVisRgn
;
441 HDC32 hdc
= dc
->hSelf
; /* FIXME: should not mix dc/hdc this way */
443 /* Modify visible region */
445 if (!(prevVisRgn
= SaveVisRgn( hdc
))) return FALSE
;
446 if (!(tmpVisRgn
= CreateRectRgn32( 0, 0, 0, 0 )))
448 RestoreVisRgn( hdc
);
451 CombineRgn32( tmpVisRgn
, prevVisRgn
, hrgn
, RGN_AND
);
452 SelectVisRgn( hdc
, tmpVisRgn
);
453 DeleteObject32( tmpVisRgn
);
455 /* Fill the region */
457 GetRgnBox32( dc
->w
.hGCClipRgn
, &box
);
458 if (DC_SetupGCForBrush( dc
))
459 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
460 dc
->w
.DCOrgX
+ box
.left
, dc
->w
.DCOrgY
+ box
.top
,
461 box
.right
-box
.left
, box
.bottom
-box
.top
);
463 /* Restore the visible region */
465 RestoreVisRgn( hdc
);
469 /**********************************************************************
473 X11DRV_Polyline( DC
*dc
, const LPPOINT32 pt
, INT32 count
)
477 if (DC_SetupGCForPen( dc
))
478 for (i
= 0; i
< count
-1; i
++)
479 XDrawLine (display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
480 dc
->w
.DCOrgX
+ XLPTODP(dc
, pt
[i
].x
),
481 dc
->w
.DCOrgY
+ YLPTODP(dc
, pt
[i
].y
),
482 dc
->w
.DCOrgX
+ XLPTODP(dc
, pt
[i
+1].x
),
483 dc
->w
.DCOrgY
+ YLPTODP(dc
, pt
[i
+1].y
));
488 /**********************************************************************
492 X11DRV_Polygon( DC
*dc
, LPPOINT32 pt
, INT32 count
)
497 points
= (XPoint
*) xmalloc (sizeof (XPoint
) * (count
+1));
498 for (i
= 0; i
< count
; i
++)
500 points
[i
].x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, pt
[i
].x
);
501 points
[i
].y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, pt
[i
].y
);
503 points
[count
] = points
[0];
505 if (DC_SetupGCForBrush( dc
))
506 XFillPolygon( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
507 points
, count
+1, Complex
, CoordModeOrigin
);
509 if (DC_SetupGCForPen ( dc
))
510 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
511 points
, count
+1, CoordModeOrigin
);
518 /**********************************************************************
522 X11DRV_PolyPolygon( DC
*dc
, LPPOINT32 pt
, LPINT32 counts
, UINT32 polygons
)
526 /* FIXME: The points should be converted to device coords before */
527 /* creating the region. But as CreatePolyPolygonRgn is not */
528 /* really correct either, it doesn't matter much... */
529 /* At least the outline will be correct :-) */
530 hrgn
= CreatePolyPolygonRgn32( pt
, counts
, polygons
, dc
->w
.polyFillMode
);
531 X11DRV_PaintRgn( dc
, hrgn
);
532 DeleteObject32( hrgn
);
534 /* Draw the outline of the polygons */
536 if (DC_SetupGCForPen ( dc
))
541 for (i
= 0; i
< polygons
; i
++) if (counts
[i
] > max
) max
= counts
[i
];
542 points
= (XPoint
*) xmalloc( sizeof(XPoint
) * (max
+1) );
544 for (i
= 0; i
< polygons
; i
++)
546 for (j
= 0; j
< counts
[i
]; j
++)
548 points
[j
].x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, pt
->x
);
549 points
[j
].y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, pt
->y
);
552 points
[j
] = points
[0];
553 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
554 points
, j
+ 1, CoordModeOrigin
);
562 /**********************************************************************
563 * X11DRV_InternalFloodFill
565 * Internal helper function for flood fill.
566 * (xorg,yorg) is the origin of the X image relative to the drawable.
567 * (x,y) is relative to the origin of the X image.
569 static void X11DRV_InternalFloodFill(XImage
*image
, DC
*dc
,
572 Pixel pixel
, WORD fillType
)
576 #define TO_FLOOD(x,y) ((fillType == FLOODFILLBORDER) ? \
577 (XGetPixel(image,x,y) != pixel) : \
578 (XGetPixel(image,x,y) == pixel))
580 if (!TO_FLOOD(x
,y
)) return;
582 /* Find left and right boundaries */
585 while ((left
> 0) && TO_FLOOD( left
-1, y
)) left
--;
586 while ((right
< image
->width
) && TO_FLOOD( right
, y
)) right
++;
587 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
588 xOrg
+ left
, yOrg
+ y
, right
-left
, 1 );
590 /* Set the pixels of this line so we don't fill it again */
592 for (x
= left
; x
< right
; x
++)
594 if (fillType
== FLOODFILLBORDER
) XPutPixel( image
, x
, y
, pixel
);
595 else XPutPixel( image
, x
, y
, ~pixel
);
598 /* Fill the line above */
605 while ((x
< right
) && !TO_FLOOD(x
,y
)) x
++;
606 if (x
>= right
) break;
607 while ((x
< right
) && TO_FLOOD(x
,y
)) x
++;
608 X11DRV_InternalFloodFill(image
, dc
, x
-1, y
,
609 xOrg
, yOrg
, pixel
, fillType
);
613 /* Fill the line below */
615 if ((y
+= 2) < image
->height
)
620 while ((x
< right
) && !TO_FLOOD(x
,y
)) x
++;
621 if (x
>= right
) break;
622 while ((x
< right
) && TO_FLOOD(x
,y
)) x
++;
623 X11DRV_InternalFloodFill(image
, dc
, x
-1, y
,
624 xOrg
, yOrg
, pixel
, fillType
);
631 /**********************************************************************
634 * Main flood-fill routine.
637 struct FloodFill_params
646 static BOOL32
X11DRV_DoFloodFill( const struct FloodFill_params
*params
)
652 if (GetRgnBox32( dc
->w
.hGCClipRgn
, &rect
) == ERROR
) return FALSE
;
654 if (!(image
= XGetImage( display
, dc
->u
.x
.drawable
,
655 dc
->w
.DCOrgX
+ rect
.left
,
656 dc
->w
.DCOrgY
+ rect
.top
,
657 rect
.right
- rect
.left
,
658 rect
.bottom
- rect
.top
,
659 AllPlanes
, ZPixmap
))) return FALSE
;
661 if (DC_SetupGCForBrush( dc
))
663 /* ROP mode is always GXcopy for flood-fill */
664 XSetFunction( display
, dc
->u
.x
.gc
, GXcopy
);
665 X11DRV_InternalFloodFill(image
, dc
,
666 XLPTODP(dc
,params
->x
) - rect
.left
,
667 YLPTODP(dc
,params
->y
) - rect
.top
,
668 dc
->w
.DCOrgX
+ rect
.left
,
669 dc
->w
.DCOrgY
+ rect
.top
,
670 COLOR_ToPhysical( dc
, params
->color
),
674 XDestroyImage( image
);
679 /**********************************************************************
680 * X11DRV_ExtFloodFill
683 X11DRV_ExtFloodFill( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
,
686 struct FloodFill_params params
= { dc
, x
, y
, color
, fillType
};
688 dprintf_graphics( stddeb
, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
689 x
, y
, color
, fillType
);
691 if (!PtVisible32( dc
->hSelf
, x
, y
)) return FALSE
;
692 return CALL_LARGE_STACK( X11DRV_DoFloodFill
, ¶ms
);