commit 13a9267

Michael Forney  ·  2013-07-25 06:47:48 +0000 UTC
parent be5d6d3
Use simpler region iteration
1 files changed,  +7, -8
+7, -8
 1@@ -26,18 +26,17 @@
 2 void default_fill_region(struct wld_drawable * drawable, uint32_t color,
 3                          pixman_region32_t * region)
 4 {
 5-    pixman_box32_t * boxes;
 6+    pixman_box32_t * box;
 7     int num_boxes;
 8-    uint32_t index;
 9 
10-    boxes = pixman_region32_rectangles(region, &num_boxes);
11+    box = pixman_region32_rectangles(region, &num_boxes);
12 
13-    for (index = 0; index < num_boxes; ++index)
14+    while (num_boxes--)
15     {
16-        drawable->interface->fill_rectangle
17-            (drawable, color, boxes[index].x1, boxes[index].y1,
18-             boxes[index].x2 - boxes[index].x1,
19-             boxes[index].y2 - boxes[index].y1);
20+        drawable->interface->fill_rectangle(drawable, color, box->x1, box->y1,
21+                                            box->x2 - box->x1,
22+                                            box->y2 - box->y1);
23+        ++box;
24     }
25 }
26