xcb: Check if traps are supported before using them

This code tried to optimize the clip away by intersecting the boxes with the
clip polygon. However, it also did so when the server didn't support traps.

Fixes: clip-stroke-unbounded clip-fill-nz-unbounded clip-fill-eo-unbounded
clip-fill clip-fill-rule a1-clip-fill-rule clip-group-shapes-circles
clip-intersect clip-nesting clip-operator clip-push-group clip-polygons
clip-shape clip-text clip-twice inverted-clip mask random-clip
rotate-clip-image-surface-paint trap-clip unantialiased-shapes

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2012-09-25 11:34:52 +02:00
parent 0ccbb83eb8
commit b264ae76bd

View file

@ -3106,7 +3106,8 @@ _clip_and_composite_boxes (cairo_xcb_surface_t *dst,
}
/* Can we reduce drawing through a clip-mask to simply drawing the clip? */
if (extents->clip->path != NULL && extents->is_bounded) {
if (dst->connection->flags & CAIRO_XCB_RENDER_HAS_COMPOSITE_TRAPEZOIDS &&
extents->clip->path != NULL && extents->is_bounded) {
cairo_polygon_t polygon;
cairo_fill_rule_t fill_rule;
cairo_antialias_t antialias;