aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/w32term.c46
1 files changed, 33 insertions, 13 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 0affbcc72af..9ba602fe7ca 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1694,12 +1694,30 @@ static INLINE void
1694x_set_glyph_string_clipping (s) 1694x_set_glyph_string_clipping (s)
1695 struct glyph_string *s; 1695 struct glyph_string *s;
1696{ 1696{
1697 RECT r;
1698 get_glyph_string_clip_rect (s, &r);
1699 w32_set_clip_rectangle (s->hdc, &r);
1700#ifdef USE_FONT_BACKEND 1697#ifdef USE_FONT_BACKEND
1701 s->clip_x = r.left, s->clip_y = r.top; 1698 RECT *r = s->clip;
1702 s->clip_width = r.right - r.left, s->clip_height = r.bottom - r.top; 1699#else
1700 RECT r[2];
1701#endif
1702 int n = get_glyph_string_clip_rects (s, r, 2);
1703
1704 if (n == 1)
1705 w32_set_clip_rectangle (s->hdc, r);
1706 else if (n > 1)
1707 {
1708 HRGN full_clip, clip1, clip2;
1709 clip1 = CreateRectRgnIndirect (r);
1710 clip2 = CreateRectRgnIndirect (r + 1);
1711 if (CombineRgn (full_clip, clip1, clip2, RGN_OR) != ERROR)
1712 {
1713 SelectClipRgn (s->hdc, full_clip);
1714 }
1715 DeleteObject (clip1);
1716 DeleteObject (clip2);
1717 DeleteObject (full_clip);
1718 }
1719#ifdef USE_FONT_BACKEND
1720 s->num_clips = n;
1703#endif /* USE_FONT_BACKEND */ 1721#endif /* USE_FONT_BACKEND */
1704} 1722}
1705 1723
@@ -1716,10 +1734,12 @@ x_set_glyph_string_clipping_exactly (src, dst)
1716#ifdef USE_FONT_BACKEND 1734#ifdef USE_FONT_BACKEND
1717 if (enable_font_backend) 1735 if (enable_font_backend)
1718 { 1736 {
1719 r.left = dst->clip_x = src->x; 1737 r.left = src->x;
1720 r.right = r.left + (dst->clip_width = src->width); 1738 r.right = r.left + src->width;
1721 r.top = dst->clip_y = src->y; 1739 r.top = src->y;
1722 r.bottom = r.top + (dst->clip_height = src->height); 1740 r.bottom = r.top + src->height;
1741 dst->clip[0] = r;
1742 dst->num_clips = 1;
1723 } 1743 }
1724 else 1744 else
1725 { 1745 {
@@ -2850,7 +2870,7 @@ x_draw_glyph_string (s)
2850 x_set_glyph_string_clipping (next); 2870 x_set_glyph_string_clipping (next);
2851 x_draw_glyph_string_background (next, 1); 2871 x_draw_glyph_string_background (next, 1);
2852#ifdef USE_FONT_BACKEND 2872#ifdef USE_FONT_BACKEND
2853 next->clip_width = 0; 2873 next->num_clips = 0;
2854#endif /* USE_FONT_BACKEND */ 2874#endif /* USE_FONT_BACKEND */
2855 } 2875 }
2856 } 2876 }
@@ -3027,7 +3047,7 @@ x_draw_glyph_string (s)
3027 w32_set_clip_rectangle (prev->hdc, NULL); 3047 w32_set_clip_rectangle (prev->hdc, NULL);
3028 prev->hl = save; 3048 prev->hl = save;
3029#ifdef USE_FONT_BACKEND 3049#ifdef USE_FONT_BACKEND
3030 prev->clip_width = 0; 3050 prev->num_clips = 0;
3031#endif /* USE_FONT_BACKEND */ 3051#endif /* USE_FONT_BACKEND */
3032 } 3052 }
3033 } 3053 }
@@ -3054,7 +3074,7 @@ x_draw_glyph_string (s)
3054 w32_set_clip_rectangle (next->hdc, NULL); 3074 w32_set_clip_rectangle (next->hdc, NULL);
3055 next->hl = save; 3075 next->hl = save;
3056#ifdef USE_FONT_BACKEND 3076#ifdef USE_FONT_BACKEND
3057 next->clip_width = 0; 3077 next->num_clips = 0;
3058#endif /* USE_FONT_BACKEND */ 3078#endif /* USE_FONT_BACKEND */
3059 } 3079 }
3060 } 3080 }
@@ -3063,7 +3083,7 @@ x_draw_glyph_string (s)
3063 /* Reset clipping. */ 3083 /* Reset clipping. */
3064 w32_set_clip_rectangle (s->hdc, NULL); 3084 w32_set_clip_rectangle (s->hdc, NULL);
3065#ifdef USE_FONT_BACKEND 3085#ifdef USE_FONT_BACKEND
3066 s->clip_width = 0; 3086 s->num_clips = 0;
3067#endif /* USE_FONT_BACKEND */ 3087#endif /* USE_FONT_BACKEND */
3068} 3088}
3069 3089