mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-25 19:00:42 +02:00
bo-rectangular: handle in==out specifically for the single box case
In this case we do not need to copy anything, but may still need to re-orientate the box. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
0e135d9f5a
commit
5ab1eced5f
1 changed files with 20 additions and 10 deletions
|
|
@ -739,18 +739,28 @@ _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (unlikely (in->num_boxes == 1)) {
|
||||
cairo_box_t box = in->chunks.base[0];
|
||||
_cairo_boxes_clear (out);
|
||||
if (in->num_boxes == 1) {
|
||||
if (in == out) {
|
||||
cairo_box_t *box = &in->chunks.base[0];
|
||||
|
||||
if (box.p1.x > box.p2.x) {
|
||||
cairo_fixed_t tmp = box.p1.x;
|
||||
box.p1.x = box.p2.x;
|
||||
box.p2.x = tmp;
|
||||
if (box->p1.x > box->p2.x) {
|
||||
cairo_fixed_t tmp = box->p1.x;
|
||||
box->p1.x = box->p2.x;
|
||||
box->p2.x = tmp;
|
||||
}
|
||||
} else {
|
||||
cairo_box_t box = in->chunks.base[0];
|
||||
|
||||
if (box.p1.x > box.p2.x) {
|
||||
cairo_fixed_t tmp = box.p1.x;
|
||||
box.p1.x = box.p2.x;
|
||||
box.p2.x = tmp;
|
||||
}
|
||||
|
||||
_cairo_boxes_clear (out);
|
||||
status = _cairo_boxes_add (out, CAIRO_ANTIALIAS_DEFAULT, &box);
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
status = _cairo_boxes_add (out, CAIRO_ANTIALIAS_DEFAULT, &box);
|
||||
assert (status == CAIRO_STATUS_SUCCESS);
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue