Skip to content

Commit

Permalink
traps,xcb: Set the box count after filtering
Browse files Browse the repository at this point in the history
After converting, the number of boxes should only count the number of
non-zero boxes and forget about the zero-sized boxes we skipped over.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
  • Loading branch information
Chris Wilson committed Aug 25, 2014
1 parent 13a0952 commit a5f5158
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cairo-traps-compositor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1417,9 +1417,7 @@ boxes_for_traps (cairo_boxes_t *boxes,

_cairo_boxes_init (boxes);

boxes->num_boxes = traps->num_traps;
boxes->chunks.base = (cairo_box_t *) traps->traps;
boxes->chunks.count = traps->num_traps;
boxes->chunks.size = traps->num_traps;

if (antialias != CAIRO_ANTIALIAS_NONE) {
Expand Down Expand Up @@ -1464,6 +1462,8 @@ boxes_for_traps (cairo_boxes_t *boxes,
boxes->chunks.base[j].p1.y != boxes->chunks.base[j].p2.y);
}
}
boxes->chunks.count = j;
boxes->num_boxes = j;

return CAIRO_INT_STATUS_SUCCESS;
}
Expand Down
5 changes: 3 additions & 2 deletions src/cairo-xcb-surface-render.c
Original file line number Diff line number Diff line change
Expand Up @@ -2906,9 +2906,7 @@ _boxes_for_traps (cairo_boxes_t *boxes,

_cairo_boxes_init (boxes);

boxes->num_boxes = traps->num_traps;
boxes->chunks.base = (cairo_box_t *) traps->traps;
boxes->chunks.count = traps->num_traps;
boxes->chunks.size = traps->num_traps;

if (antialias != CAIRO_ANTIALIAS_NONE) {
Expand Down Expand Up @@ -2954,6 +2952,9 @@ _boxes_for_traps (cairo_boxes_t *boxes,
boxes->chunks.base[j].p1.y != boxes->chunks.base[j].p2.y);
}
}

boxes->num_boxes = j;
boxes->chunks.count = j;
}

static cairo_status_t
Expand Down

0 comments on commit a5f5158

Please sign in to comment.