[Pixman] [PATCH 4/4] Use find_box_for_y in pixman_region_contains_point() too

Søren Sandmann sandmann at cs.au.dk
Wed Aug 3 19:21:20 PDT 2011


From: Søren Sandmann Pedersen <ssp at redhat.com>

The same binary search from the previous commit can be used in this
function too.
---
 pixman/pixman-region.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/pixman/pixman-region.c b/pixman/pixman-region.c
index a199405..35fefc4 100644
--- a/pixman/pixman-region.c
+++ b/pixman/pixman-region.c
@@ -2376,9 +2376,12 @@ PREFIX (_contains_point) (region_type_t * region,
         return(TRUE);
     }
 
-    for (pbox = PIXREGION_BOXPTR (region), pbox_end = pbox + numRects;
-	 pbox != pbox_end;
-	 pbox++)
+    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->y2)
 	    continue;           /* not there yet */
-- 
1.7.4



More information about the Pixman mailing list