2 * X11 graphics driver graphics functions
4 * Copyright 1993,1994 Alexandre Julliard
13 #include <X11/Xutil.h>
14 #include <X11/Intrinsic.h>
38 /**********************************************************************
42 X11DRV_MoveToEx(DC
*dc
,INT32 x
,INT32 y
,LPPOINT32 pt
) {
45 pt
->x
= dc
->w
.CursPosX
;
46 pt
->y
= dc
->w
.CursPosY
;
53 /***********************************************************************
57 X11DRV_LineTo( DC
*dc
, INT32 x
, INT32 y
)
59 if (DC_SetupGCForPen( dc
))
60 XDrawLine(display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
61 dc
->w
.DCOrgX
+ XLPTODP( dc
, dc
->w
.CursPosX
),
62 dc
->w
.DCOrgY
+ YLPTODP( dc
, dc
->w
.CursPosY
),
63 dc
->w
.DCOrgX
+ XLPTODP( dc
, x
),
64 dc
->w
.DCOrgY
+ YLPTODP( dc
, y
) );
72 /***********************************************************************
75 * Helper functions for Arc(), Chord() and Pie().
76 * 'lines' is the number of lines to draw: 0 for Arc, 1 for Chord, 2 for Pie.
79 X11DRV_DrawArc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
80 INT32 bottom
, INT32 xstart
, INT32 ystart
,
81 INT32 xend
, INT32 yend
, INT32 lines
)
83 INT32 xcenter
, ycenter
, istart_angle
, idiff_angle
, tmp
;
84 double start_angle
, end_angle
;
87 left
= XLPTODP( dc
, left
);
88 top
= YLPTODP( dc
, top
);
89 right
= XLPTODP( dc
, right
);
90 bottom
= YLPTODP( dc
, bottom
);
91 xstart
= XLPTODP( dc
, xstart
);
92 ystart
= YLPTODP( dc
, ystart
);
93 xend
= XLPTODP( dc
, xend
);
94 yend
= YLPTODP( dc
, yend
);
95 if ((left
== right
) || (top
== bottom
)) return FALSE
;
97 xcenter
= (right
+ left
) / 2;
98 ycenter
= (bottom
+ top
) / 2;
99 start_angle
= atan2( (double)(ycenter
-ystart
)*(right
-left
),
100 (double)(xstart
-xcenter
)*(bottom
-top
) );
101 end_angle
= atan2( (double)(ycenter
-yend
)*(right
-left
),
102 (double)(xend
-xcenter
)*(bottom
-top
) );
103 istart_angle
= (INT32
)(start_angle
* 180 * 64 / PI
);
104 idiff_angle
= (INT32
)((end_angle
- start_angle
) * 180 * 64 / PI
);
105 if (idiff_angle
<= 0) idiff_angle
+= 360 * 64;
106 if (left
> right
) { tmp
=left
; left
=right
; right
=tmp
; }
107 if (top
> bottom
) { tmp
=top
; top
=bottom
; bottom
=tmp
; }
109 /* Fill arc with brush if Chord() or Pie() */
111 if ((lines
> 0) && DC_SetupGCForBrush( dc
))
113 XSetArcMode( display
, dc
->u
.x
.gc
, (lines
==1) ? ArcChord
: ArcPieSlice
);
114 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
115 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
116 right
-left
-1, bottom
-top
-1, istart_angle
, idiff_angle
);
119 /* Draw arc and lines */
121 if (!DC_SetupGCForPen( dc
)) return TRUE
;
122 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
123 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
124 right
-left
-1, bottom
-top
-1, istart_angle
, idiff_angle
);
125 if (!lines
) return TRUE
;
127 points
[0].x
= dc
->w
.DCOrgX
+ xcenter
+ (int)(cos(start_angle
) * (right
-left
) / 2);
128 points
[0].y
= dc
->w
.DCOrgY
+ ycenter
- (int)(sin(start_angle
) * (bottom
-top
) / 2);
129 points
[1].x
= dc
->w
.DCOrgX
+ xcenter
+ (int)(cos(end_angle
) * (right
-left
) / 2);
130 points
[1].y
= dc
->w
.DCOrgY
+ ycenter
- (int)(sin(end_angle
) * (bottom
-top
) / 2);
133 points
[2] = points
[1];
134 points
[1].x
= dc
->w
.DCOrgX
+ xcenter
;
135 points
[1].y
= dc
->w
.DCOrgY
+ ycenter
;
137 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
138 points
, lines
+1, CoordModeOrigin
);
143 /***********************************************************************
147 X11DRV_Arc( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
148 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
150 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
151 xstart
, ystart
, xend
, yend
, 0 );
155 /***********************************************************************
159 X11DRV_Pie( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
160 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
162 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
163 xstart
, ystart
, xend
, yend
, 2 );
166 /***********************************************************************
170 X11DRV_Chord( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
,
171 INT32 xstart
, INT32 ystart
, INT32 xend
, INT32 yend
)
173 return X11DRV_DrawArc( dc
, left
, top
, right
, bottom
,
174 xstart
, ystart
, xend
, yend
, 1 );
178 /***********************************************************************
182 X11DRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
184 left
= XLPTODP( dc
, left
);
185 top
= YLPTODP( dc
, top
);
186 right
= XLPTODP( dc
, right
);
187 bottom
= YLPTODP( dc
, bottom
);
188 if ((left
== right
) || (top
== bottom
)) return FALSE
;
190 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
191 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
193 if ((dc
->u
.x
.pen
.style
== PS_INSIDEFRAME
) &&
194 (dc
->u
.x
.pen
.width
< right
-left
-1) &&
195 (dc
->u
.x
.pen
.width
< bottom
-top
-1))
197 left
+= dc
->u
.x
.pen
.width
/ 2;
198 right
-= (dc
->u
.x
.pen
.width
+ 1) / 2;
199 top
+= dc
->u
.x
.pen
.width
/ 2;
200 bottom
-= (dc
->u
.x
.pen
.width
+ 1) / 2;
203 if (DC_SetupGCForBrush( dc
))
204 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
205 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
206 right
-left
-1, bottom
-top
-1, 0, 360*64 );
207 if (DC_SetupGCForPen( dc
))
208 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
209 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
210 right
-left
-1, bottom
-top
-1, 0, 360*64 );
215 /***********************************************************************
219 X11DRV_Rectangle(DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
222 left
= XLPTODP( dc
, left
);
223 top
= YLPTODP( dc
, top
);
224 right
= XLPTODP( dc
, right
);
225 bottom
= YLPTODP( dc
, bottom
);
227 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
228 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
230 if ((left
== right
) || (top
== bottom
))
232 if (DC_SetupGCForPen( dc
))
233 XDrawLine(display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
236 dc
->w
.DCOrgX
+ right
,
237 dc
->w
.DCOrgY
+ bottom
);
240 width
= dc
->u
.x
.pen
.width
;
241 if (!width
) width
= 1;
242 if(dc
->u
.x
.pen
.style
== PS_NULL
) width
= 0;
244 if ((dc
->u
.x
.pen
.style
== PS_INSIDEFRAME
) &&
245 (width
< right
-left
) && (width
< bottom
-top
))
248 right
-= (width
+ 1) / 2;
250 bottom
-= (width
+ 1) / 2;
253 if (DC_SetupGCForBrush( dc
))
254 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
255 dc
->w
.DCOrgX
+ left
+ (width
+ 1) / 2,
256 dc
->w
.DCOrgY
+ top
+ (width
+ 1) / 2,
257 right
-left
-width
-1, bottom
-top
-width
-1);
258 if (DC_SetupGCForPen( dc
))
259 XDrawRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
260 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
261 right
-left
-1, bottom
-top
-1 );
265 /***********************************************************************
269 X11DRV_RoundRect( DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
270 INT32 bottom
, INT32 ell_width
, INT32 ell_height
)
272 dprintf_graphics(stddeb
, "X11DRV_RoundRect(%d %d %d %d %d %d\n",
273 left
, top
, right
, bottom
, ell_width
, ell_height
);
275 left
= XLPTODP( dc
, left
);
276 top
= YLPTODP( dc
, top
);
277 right
= XLPTODP( dc
, right
);
278 bottom
= YLPTODP( dc
, bottom
);
279 ell_width
= abs( ell_width
* dc
->vportExtX
/ dc
->wndExtX
);
280 ell_height
= abs( ell_height
* dc
->vportExtY
/ dc
->wndExtY
);
282 /* Fix the coordinates */
284 if (right
< left
) { INT32 tmp
= right
; right
= left
; left
= tmp
; }
285 if (bottom
< top
) { INT32 tmp
= bottom
; bottom
= top
; top
= tmp
; }
286 if (ell_width
> right
- left
) ell_width
= right
- left
;
287 if (ell_height
> bottom
- top
) ell_height
= bottom
- top
;
289 if (DC_SetupGCForBrush( dc
))
291 if (ell_width
&& ell_height
)
293 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
294 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
295 ell_width
, ell_height
, 90 * 64, 90 * 64 );
296 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
297 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ bottom
- ell_height
,
298 ell_width
, ell_height
, 180 * 64, 90 * 64 );
299 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
300 dc
->w
.DCOrgX
+ right
- ell_width
,
301 dc
->w
.DCOrgY
+ bottom
- ell_height
,
302 ell_width
, ell_height
, 270 * 64, 90 * 64 );
303 XFillArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
304 dc
->w
.DCOrgX
+ right
- ell_width
, dc
->w
.DCOrgY
+ top
,
305 ell_width
, ell_height
, 0, 90 * 64 );
307 if (ell_width
< right
- left
)
309 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
310 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
312 right
- left
- ell_width
, ell_height
/ 2 );
313 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
314 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
315 dc
->w
.DCOrgY
+ bottom
- (ell_height
+1) / 2,
316 right
- left
- ell_width
, (ell_height
+1) / 2 );
318 if (ell_height
< bottom
- top
)
320 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
322 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
323 right
- left
, bottom
- top
- ell_height
);
326 if (DC_SetupGCForPen(dc
))
328 if (ell_width
&& ell_height
)
330 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
331 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ top
,
332 ell_width
, ell_height
, 90 * 64, 90 * 64 );
333 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
334 dc
->w
.DCOrgX
+ left
, dc
->w
.DCOrgY
+ bottom
- ell_height
,
335 ell_width
, ell_height
, 180 * 64, 90 * 64 );
336 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
337 dc
->w
.DCOrgX
+ right
- ell_width
,
338 dc
->w
.DCOrgY
+ bottom
- ell_height
,
339 ell_width
, ell_height
, 270 * 64, 90 * 64 );
340 XDrawArc( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
341 dc
->w
.DCOrgX
+ right
- ell_width
, dc
->w
.DCOrgY
+ top
,
342 ell_width
, ell_height
, 0, 90 * 64 );
344 if (ell_width
< right
- left
)
346 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
347 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
349 dc
->w
.DCOrgX
+ right
- ell_width
/ 2,
350 dc
->w
.DCOrgY
+ top
);
351 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
352 dc
->w
.DCOrgX
+ left
+ ell_width
/ 2,
353 dc
->w
.DCOrgY
+ bottom
,
354 dc
->w
.DCOrgX
+ right
- ell_width
/ 2,
355 dc
->w
.DCOrgY
+ bottom
);
357 if (ell_height
< bottom
- top
)
359 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
360 dc
->w
.DCOrgX
+ right
,
361 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
362 dc
->w
.DCOrgX
+ right
,
363 dc
->w
.DCOrgY
+ bottom
- ell_height
/ 2 );
364 XDrawLine( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
366 dc
->w
.DCOrgY
+ top
+ ell_height
/ 2,
368 dc
->w
.DCOrgY
+ bottom
- ell_height
/ 2 );
375 /***********************************************************************
379 X11DRV_SetPixel( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
)
383 x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, x
);
384 y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, y
);
385 pixel
= COLOR_ToPhysical( dc
, color
);
387 XSetForeground( display
, dc
->u
.x
.gc
, pixel
);
388 XSetFunction( display
, dc
->u
.x
.gc
, GXcopy
);
389 XDrawPoint( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
, x
, y
);
391 /* inefficient but simple... */
393 return COLOR_ToLogical(pixel
);
397 /***********************************************************************
401 X11DRV_GetPixel( DC
*dc
, INT32 x
, INT32 y
)
403 static Pixmap pixmap
= 0;
407 x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, x
);
408 y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, y
);
409 if (dc
->w
.flags
& DC_MEMORY
)
411 image
= XGetImage( display
, dc
->u
.x
.drawable
, x
, y
, 1, 1,
412 AllPlanes
, ZPixmap
);
416 /* If we are reading from the screen, use a temporary copy */
417 /* to avoid a BadMatch error */
418 if (!pixmap
) pixmap
= XCreatePixmap( display
, rootWindow
,
419 1, 1, dc
->w
.bitsPerPixel
);
420 XCopyArea( display
, dc
->u
.x
.drawable
, pixmap
, BITMAP_colorGC
,
422 image
= XGetImage( display
, pixmap
, 0, 0, 1, 1, AllPlanes
, ZPixmap
);
424 pixel
= XGetPixel( image
, 0, 0 );
425 XDestroyImage( image
);
427 return COLOR_ToLogical(pixel
);
431 /***********************************************************************
435 X11DRV_PaintRgn( DC
*dc
, HRGN32 hrgn
)
438 HRGN32 tmpVisRgn
, prevVisRgn
;
439 HDC32 hdc
= dc
->hSelf
; /* FIXME: should not mix dc/hdc this way */
441 /* Modify visible region */
443 if (!(prevVisRgn
= SaveVisRgn( hdc
))) return FALSE
;
444 if (!(tmpVisRgn
= CreateRectRgn32( 0, 0, 0, 0 )))
446 RestoreVisRgn( hdc
);
449 CombineRgn32( tmpVisRgn
, prevVisRgn
, hrgn
, RGN_AND
);
450 SelectVisRgn( hdc
, tmpVisRgn
);
451 DeleteObject32( tmpVisRgn
);
453 /* Fill the region */
455 GetRgnBox32( dc
->w
.hGCClipRgn
, &box
);
456 if (DC_SetupGCForBrush( dc
))
457 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
458 dc
->w
.DCOrgX
+ box
.left
, dc
->w
.DCOrgY
+ box
.top
,
459 box
.right
-box
.left
, box
.bottom
-box
.top
);
461 /* Restore the visible region */
463 RestoreVisRgn( hdc
);
467 /**********************************************************************
471 X11DRV_Polyline( DC
*dc
, const LPPOINT32 pt
, INT32 count
)
475 if (DC_SetupGCForPen( dc
))
476 for (i
= 0; i
< count
-1; i
++)
477 XDrawLine (display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
478 dc
->w
.DCOrgX
+ XLPTODP(dc
, pt
[i
].x
),
479 dc
->w
.DCOrgY
+ YLPTODP(dc
, pt
[i
].y
),
480 dc
->w
.DCOrgX
+ XLPTODP(dc
, pt
[i
+1].x
),
481 dc
->w
.DCOrgY
+ YLPTODP(dc
, pt
[i
+1].y
));
486 /**********************************************************************
490 X11DRV_Polygon( DC
*dc
, LPPOINT32 pt
, INT32 count
)
495 points
= (XPoint
*) xmalloc (sizeof (XPoint
) * (count
+1));
496 for (i
= 0; i
< count
; i
++)
498 points
[i
].x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, pt
[i
].x
);
499 points
[i
].y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, pt
[i
].y
);
501 points
[count
] = points
[0];
503 if (DC_SetupGCForBrush( dc
))
504 XFillPolygon( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
505 points
, count
+1, Complex
, CoordModeOrigin
);
507 if (DC_SetupGCForPen ( dc
))
508 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
509 points
, count
+1, CoordModeOrigin
);
516 /**********************************************************************
520 X11DRV_PolyPolygon( DC
*dc
, LPPOINT32 pt
, LPINT32 counts
, UINT32 polygons
)
524 /* FIXME: The points should be converted to device coords before */
525 /* creating the region. But as CreatePolyPolygonRgn is not */
526 /* really correct either, it doesn't matter much... */
527 /* At least the outline will be correct :-) */
528 hrgn
= CreatePolyPolygonRgn32( pt
, counts
, polygons
, dc
->w
.polyFillMode
);
529 X11DRV_PaintRgn( dc
, hrgn
);
530 DeleteObject32( hrgn
);
532 /* Draw the outline of the polygons */
534 if (DC_SetupGCForPen ( dc
))
539 for (i
= 0; i
< polygons
; i
++) if (counts
[i
] > max
) max
= counts
[i
];
540 points
= (XPoint
*) xmalloc( sizeof(XPoint
) * (max
+1) );
542 for (i
= 0; i
< polygons
; i
++)
544 for (j
= 0; j
< counts
[i
]; j
++)
546 points
[j
].x
= dc
->w
.DCOrgX
+ XLPTODP( dc
, pt
->x
);
547 points
[j
].y
= dc
->w
.DCOrgY
+ YLPTODP( dc
, pt
->y
);
550 points
[j
] = points
[0];
551 XDrawLines( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
552 points
, j
+ 1, CoordModeOrigin
);
560 /**********************************************************************
561 * X11DRV_InternalFloodFill
563 * Internal helper function for flood fill.
564 * (xorg,yorg) is the origin of the X image relative to the drawable.
565 * (x,y) is relative to the origin of the X image.
567 static void X11DRV_InternalFloodFill(XImage
*image
, DC
*dc
,
570 Pixel pixel
, WORD fillType
)
574 #define TO_FLOOD(x,y) ((fillType == FLOODFILLBORDER) ? \
575 (XGetPixel(image,x,y) != pixel) : \
576 (XGetPixel(image,x,y) == pixel))
578 if (!TO_FLOOD(x
,y
)) return;
580 /* Find left and right boundaries */
583 while ((left
> 0) && TO_FLOOD( left
-1, y
)) left
--;
584 while ((right
< image
->width
) && TO_FLOOD( right
, y
)) right
++;
585 XFillRectangle( display
, dc
->u
.x
.drawable
, dc
->u
.x
.gc
,
586 xOrg
+ left
, yOrg
+ y
, right
-left
, 1 );
588 /* Set the pixels of this line so we don't fill it again */
590 for (x
= left
; x
< right
; x
++)
592 if (fillType
== FLOODFILLBORDER
) XPutPixel( image
, x
, y
, pixel
);
593 else XPutPixel( image
, x
, y
, ~pixel
);
596 /* Fill the line above */
603 while ((x
< right
) && !TO_FLOOD(x
,y
)) x
++;
604 if (x
>= right
) break;
605 while ((x
< right
) && TO_FLOOD(x
,y
)) x
++;
606 X11DRV_InternalFloodFill(image
, dc
, x
-1, y
,
607 xOrg
, yOrg
, pixel
, fillType
);
611 /* Fill the line below */
613 if ((y
+= 2) < image
->height
)
618 while ((x
< right
) && !TO_FLOOD(x
,y
)) x
++;
619 if (x
>= right
) break;
620 while ((x
< right
) && TO_FLOOD(x
,y
)) x
++;
621 X11DRV_InternalFloodFill(image
, dc
, x
-1, y
,
622 xOrg
, yOrg
, pixel
, fillType
);
629 /**********************************************************************
632 * Main flood-fill routine.
634 static BOOL32
X11DRV_DoFloodFill( DC
*dc
, RECT32
*rect
, INT32 x
, INT32 y
,
635 COLORREF color
, UINT32 fillType
)
639 if (!(image
= XGetImage( display
, dc
->u
.x
.drawable
,
640 dc
->w
.DCOrgX
+ rect
->left
,
641 dc
->w
.DCOrgY
+ rect
->top
,
642 rect
->right
- rect
->left
,
643 rect
->bottom
- rect
->top
,
644 AllPlanes
, ZPixmap
))) return FALSE
;
646 if (DC_SetupGCForBrush( dc
))
648 /* ROP mode is always GXcopy for flood-fill */
649 XSetFunction( display
, dc
->u
.x
.gc
, GXcopy
);
650 X11DRV_InternalFloodFill(image
, dc
,
651 XLPTODP(dc
,x
) - rect
->left
,
652 YLPTODP(dc
,y
) - rect
->top
,
653 dc
->w
.DCOrgX
+ rect
->left
,
654 dc
->w
.DCOrgY
+ rect
->top
,
655 COLOR_ToPhysical( dc
, color
), fillType
);
658 XDestroyImage( image
);
663 /**********************************************************************
664 * X11DRV_ExtFloodFill
667 X11DRV_ExtFloodFill( DC
*dc
, INT32 x
, INT32 y
, COLORREF color
,
671 HDC32 hdc
= dc
->hSelf
; /* FIXME */
673 dprintf_graphics( stddeb
, "X11DRV_ExtFloodFill %d,%d %06lx %d\n",
674 x
, y
, color
, fillType
);
676 if (!PtVisible32( hdc
, x
, y
)) return FALSE
;
677 if (GetRgnBox32( dc
->w
.hGCClipRgn
, &rect
) == ERROR
) return FALSE
;
679 return CallTo32_LargeStack( (int(*)())X11DRV_DoFloodFill
, 6,
680 dc
, &rect
, x
, y
, color
, fillType
);