Release 970120
[wine/multimedia.git] / graphics / x11drv / graphics.c
blob2619425d6c68175a9545b515c220f45e8421c341
1 /*
2 * X11 graphics driver graphics functions
4 * Copyright 1993,1994 Alexandre Julliard
5 */
7 #include <math.h>
8 #if defined(__EMX__)
9 #include <float.h>
10 #endif
11 #include <stdlib.h>
12 #include <X11/Xlib.h>
13 #include <X11/Xutil.h>
14 #include <X11/Intrinsic.h>
15 #ifndef PI
16 #define PI M_PI
17 #endif
18 #include <string.h>
20 #include "x11drv.h"
21 #include "bitmap.h"
22 #include "gdi.h"
23 #include "graphics.h"
24 #include "dc.h"
25 #include "bitmap.h"
26 #include "callback.h"
27 #include "metafile.h"
28 #include "syscolor.h"
29 #include "stddebug.h"
30 #include "palette.h"
31 #include "color.h"
32 #include "region.h"
33 #include "struct32.h"
34 #include "debug.h"
35 #include "xmalloc.h"
38 /**********************************************************************
39 * X11DRV_MoveToEx
41 BOOL32
42 X11DRV_MoveToEx(DC *dc,INT32 x,INT32 y,LPPOINT32 pt) {
43 if (pt)
45 pt->x = dc->w.CursPosX;
46 pt->y = dc->w.CursPosY;
48 dc->w.CursPosX = x;
49 dc->w.CursPosY = y;
50 return TRUE;
53 /***********************************************************************
54 * X11DRV_LineTo
56 BOOL32
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 ) );
65 dc->w.CursPosX = x;
66 dc->w.CursPosY = y;
67 return TRUE;
72 /***********************************************************************
73 * GRAPH_DrawArc
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.
78 static BOOL32
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;
85 XPoint points[3];
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);
131 if (lines == 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 );
139 return TRUE;
143 /***********************************************************************
144 * X11DRV_Arc
146 BOOL32
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 /***********************************************************************
156 * X11DRV_Pie
158 BOOL32
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 /***********************************************************************
167 * X11DRV_Chord
169 BOOL32
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 /***********************************************************************
179 * X11DRV_Ellipse
181 BOOL32
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 );
211 return TRUE;
215 /***********************************************************************
216 * X11DRV_Rectangle
218 BOOL32
219 X11DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
221 INT32 width;
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,
234 dc->w.DCOrgX + left,
235 dc->w.DCOrgY + top,
236 dc->w.DCOrgX + right,
237 dc->w.DCOrgY + bottom);
238 return TRUE;
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))
247 left += width / 2;
248 right -= (width + 1) / 2;
249 top += width / 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 );
262 return TRUE;
265 /***********************************************************************
266 * X11DRV_RoundRect
268 BOOL32
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,
311 dc->w.DCOrgY + top,
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,
321 dc->w.DCOrgX + left,
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,
348 dc->w.DCOrgY + top,
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,
365 dc->w.DCOrgX + left,
366 dc->w.DCOrgY + top + ell_height / 2,
367 dc->w.DCOrgX + left,
368 dc->w.DCOrgY + bottom - ell_height / 2 );
371 return TRUE;
375 /***********************************************************************
376 * X11DRV_SetPixel
378 COLORREF
379 X11DRV_SetPixel( DC *dc, INT32 x, INT32 y, COLORREF color )
381 Pixel pixel;
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 /***********************************************************************
398 * X11DRV_GetPixel
400 COLORREF
401 X11DRV_GetPixel( DC *dc, INT32 x, INT32 y )
403 static Pixmap pixmap = 0;
404 XImage * image;
405 int pixel;
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 );
414 else
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,
421 x, y, 1, 1, 0, 0 );
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 /***********************************************************************
432 * X11DRV_PaintRgn
434 BOOL32
435 X11DRV_PaintRgn( DC *dc, HRGN32 hrgn )
437 RECT32 box;
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 );
447 return FALSE;
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 );
464 return TRUE;
467 /**********************************************************************
468 * X11DRV_Polyline
470 BOOL32
471 X11DRV_Polyline( DC *dc, const LPPOINT32 pt, INT32 count )
473 register int i;
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));
482 return TRUE;
486 /**********************************************************************
487 * X11DRV_Polygon
489 BOOL32
490 X11DRV_Polygon( DC *dc, LPPOINT32 pt, INT32 count )
492 register int i;
493 XPoint *points;
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 );
511 free( points );
512 return TRUE;
516 /**********************************************************************
517 * X11DRV_PolyPolygon
519 BOOL32
520 X11DRV_PolyPolygon( DC *dc, LPPOINT32 pt, LPINT32 counts, UINT32 polygons)
522 HRGN32 hrgn;
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 ))
536 int i, j, max = 0;
537 XPoint *points;
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 );
548 pt++;
550 points[j] = points[0];
551 XDrawLines( display, dc->u.x.drawable, dc->u.x.gc,
552 points, j + 1, CoordModeOrigin );
554 free( points );
556 return TRUE;
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,
568 int x, int y,
569 int xOrg, int yOrg,
570 Pixel pixel, WORD fillType )
572 int left, right;
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 */
582 left = right = x;
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 */
598 if (--y >= 0)
600 x = left;
601 while (x < right)
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)
615 x = left;
616 while (x < right)
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 );
625 #undef TO_FLOOD
629 /**********************************************************************
630 * X11DRV_DoFloodFill
632 * Main flood-fill routine.
634 static BOOL32 X11DRV_DoFloodFill( DC *dc, RECT32 *rect, INT32 x, INT32 y,
635 COLORREF color, UINT32 fillType )
637 XImage *image;
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 );
659 return TRUE;
663 /**********************************************************************
664 * X11DRV_ExtFloodFill
666 BOOL32
667 X11DRV_ExtFloodFill( DC *dc, INT32 x, INT32 y, COLORREF color,
668 UINT32 fillType )
670 RECT32 rect;
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 );