diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-08-12 20:36:13 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-08-12 20:36:13 +0100 |
commit | be1ff2f45fdbc69537e513834fcffa0435e63073 (patch) | |
tree | 150034c204a19d05dd23bfc7c96510df83ce2d8e /src/cairo-xlib-surface.c | |
parent | e7fcbed63ac19d894cb94fd0a7589f4580a072f1 (diff) |
xlib: Set the clip_region for glyphs
Broken (never set!) since the clipping overhaul. We could emulate the
xcb code to avoid setting it unnecessarily...
Fixes partial-clip-test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-xlib-surface.c')
-rw-r--r-- | src/cairo-xlib-surface.c | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 57b2604c4..dc3aac83a 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -4767,7 +4767,6 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst, composite_operation_t operation; cairo_surface_attributes_t attributes; cairo_xlib_surface_t *src = NULL; - cairo_region_t *clip_region = NULL; cairo_xlib_display_t *display; if (! CAIRO_SURFACE_RENDER_HAS_COMPOSITE_TEXT (dst)) @@ -4807,30 +4806,8 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst, X_DEBUG ((display->display, "show_glyphs (dst=%x)", (unsigned int) dst->drawable)); - if (clip_region != NULL && - cairo_region_num_rectangles (clip_region) == 1) - { - cairo_rectangle_int_t glyph_extents; - const cairo_rectangle_int_t *clip_extents; - - /* Can we do without the clip? - * Around 50% of the time the clip is redundant (firefox). - */ - _cairo_scaled_font_glyph_approximate_extents (scaled_font, - glyphs, num_glyphs, - &glyph_extents); - - clip_extents = &clip->path->extents; - if (clip_extents->x <= glyph_extents.x && - clip_extents->y <= glyph_extents.y && - clip_extents->x + clip_extents->width >= glyph_extents.x + glyph_extents.width && - clip_extents->y + clip_extents->height >= glyph_extents.y + glyph_extents.height) - { - clip_region = NULL; - } - } - - status = _cairo_xlib_surface_set_clip_region (dst, clip_region); + status = _cairo_xlib_surface_set_clip_region (dst, + _cairo_clip_get_region (clip)); if (unlikely (status)) goto BAIL0; @@ -4869,14 +4846,6 @@ _cairo_xlib_surface_show_glyphs (void *abstract_dst, if (unlikely (status)) goto BAIL0; - if (clip != NULL) { - if (! _cairo_rectangle_intersect (&glyph_extents, - _cairo_clip_get_extents (clip))) - { - goto BAIL0; - } - } - status = _cairo_xlib_surface_acquire_pattern_surface (display, dst, src_pattern, glyph_extents.x, |