comparison src/w32term.c @ 91028:d41ffb650865

(x_set_glyph_string_clipping): Use get_glyph_string_clip_rects. (x_set_glyph_string_clipping_exactly): Adjusted for the change of struct glyph_string. (x_draw_glyph_string): Likewise.
author Jason Rumney <jasonr@gnu.org>
date Thu, 13 Sep 2007 13:36:39 +0000
parents 424b655804ca
children bdb3fe0ba9fa
comparison
equal deleted inserted replaced
91027:04b81a720da9 91028:d41ffb650865
1692 1692
1693 static INLINE void 1693 static INLINE void
1694 x_set_glyph_string_clipping (s) 1694 x_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
1706 /* Set SRC's clipping for output of glyph string DST. This is called 1724 /* Set SRC's clipping for output of glyph string DST. This is called
1707 when we are drawing DST's left_overhang or right_overhang only in 1725 when we are drawing DST's left_overhang or right_overhang only in
1714 RECT r; 1732 RECT r;
1715 1733
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 {
1726 #endif /* USE_FONT_BACKEND */ 1746 #endif /* USE_FONT_BACKEND */
1727 struct glyph_string *clip_head = src->clip_head; 1747 struct glyph_string *clip_head = src->clip_head;
2848 { 2868 {
2849 x_set_glyph_string_gc (next); 2869 x_set_glyph_string_gc (next);
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 }
2857 2877
2858 /* Set up S->gc, set clipping and draw S. */ 2878 /* Set up S->gc, set clipping and draw S. */
3025 else 3045 else
3026 x_draw_composite_glyph_string_foreground (prev); 3046 x_draw_composite_glyph_string_foreground (prev);
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 }
3034 3054
3035 if (s->next) 3055 if (s->next)
3052 else 3072 else
3053 x_draw_composite_glyph_string_foreground (next); 3073 x_draw_composite_glyph_string_foreground (next);
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 }
3061 } 3081 }
3062 3082
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
3070 3090
3071 /* Shift display to make room for inserted glyphs. */ 3091 /* Shift display to make room for inserted glyphs. */