diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-08-02 03:03:48 -0400 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@redhat.com> | 2011-08-11 03:32:14 -0400 |
commit | e5d85ce6629c84b9dad5a9c76bd9f895157c5a74 (patch) | |
tree | 29ab35dc78197d0c8b8cdafe25f7a07fe9f55e1b | |
parent | 04bd4bdca622f060d7d39caddeaa495d3e6eb0cb (diff) |
Use find_box_for_y() in pixman_region_contains_point() too
The same binary search from the previous commit can be used in this
function too.
V2: Remove check from loop that is not needed anymore, pointed out by
Andrea Canciani.
-rw-r--r-- | pixman/pixman-region.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c index 71995fd..9ff5157 100644 --- a/pixman/pixman-region.c +++ b/pixman/pixman-region.c @@ -2378,13 +2378,13 @@ PREFIX (_contains_point) (region_type_t * region, return(TRUE); } - for (pbox = PIXREGION_BOXPTR (region), pbox_end = pbox + numRects; - pbox != pbox_end; - pbox++) - { - if (y >= pbox->y2) - continue; /* not there yet */ + pbox = PIXREGION_BOXPTR (region); + pbox_end = pbox + numRects; + + pbox = find_box_for_y (pbox, pbox_end, y); + for (;pbox != pbox_end; pbox++) + { if ((y < pbox->y1) || (x < pbox->x1)) break; /* missed it */ |