diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index 03458cb03f6..e9551475f7d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -698,12 +698,39 @@ static void | |||
| 698 | x_fill_rectangle (struct frame *f, GC gc, int x, int y, int width, int height) | 698 | x_fill_rectangle (struct frame *f, GC gc, int x, int y, int width, int height) |
| 699 | { | 699 | { |
| 700 | #ifdef USE_CAIRO | 700 | #ifdef USE_CAIRO |
| 701 | Display *dpy = FRAME_X_DISPLAY (f); | ||
| 701 | cairo_t *cr; | 702 | cairo_t *cr; |
| 703 | XGCValues xgcv; | ||
| 702 | 704 | ||
| 703 | cr = x_begin_cr_clip (f, gc); | 705 | cr = x_begin_cr_clip (f, gc); |
| 704 | x_set_cr_source_with_gc_foreground (f, gc); | 706 | XGetGCValues (dpy, gc, GCFillStyle | GCStipple, &xgcv); |
| 705 | cairo_rectangle (cr, x, y, width, height); | 707 | if (xgcv.fill_style == FillSolid |
| 706 | cairo_fill (cr); | 708 | /* Invalid resource ID (one or more of the three most |
| 709 | significant bits set to 1) is obtained if the GCStipple | ||
| 710 | component has never been explicitly set. It should be | ||
| 711 | regarded as Pixmap of unspecified size filled with ones. */ | ||
| 712 | || (xgcv.stipple & ((Pixmap) 7 << (sizeof (Pixmap) * CHAR_BIT - 3)))) | ||
| 713 | { | ||
| 714 | x_set_cr_source_with_gc_foreground (f, gc); | ||
| 715 | cairo_rectangle (cr, x, y, width, height); | ||
| 716 | cairo_fill (cr); | ||
| 717 | } | ||
| 718 | else | ||
| 719 | { | ||
| 720 | eassert (xgcv.fill_style == FillOpaqueStippled); | ||
| 721 | eassert (xgcv.stipple != None); | ||
| 722 | x_set_cr_source_with_gc_background (f, gc); | ||
| 723 | cairo_rectangle (cr, x, y, width, height); | ||
| 724 | cairo_fill_preserve (cr); | ||
| 725 | |||
| 726 | cairo_pattern_t *pattern = x_bitmap_stipple (f, xgcv.stipple); | ||
| 727 | if (pattern) | ||
| 728 | { | ||
| 729 | x_set_cr_source_with_gc_foreground (f, gc); | ||
| 730 | cairo_clip (cr); | ||
| 731 | cairo_mask (cr, pattern); | ||
| 732 | } | ||
| 733 | } | ||
| 707 | x_end_cr_clip (f); | 734 | x_end_cr_clip (f); |
| 708 | #else | 735 | #else |
| 709 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f), | 736 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_DRAWABLE (f), |