commit b7ea96a

Michael Forney  ·  2014-01-18 01:32:15 +0000 UTC
parent a36513f
Use swc_rectangle instead of pixman_rectangle32_t
4 files changed,  +9, -6
+1, -1
1@@ -49,7 +49,7 @@ struct view
2 struct render_target
3 {
4     struct wld_buffer * buffer;
5-    pixman_rectangle32_t geometry;
6+    struct swc_rectangle geometry;
7 };
8 
9 static void repaint_surface(struct render_target * target,
+1, -1
1@@ -17,7 +17,7 @@ struct swc_output
2     uint32_t id;
3 
4     /* The geometry of this output */
5-    pixman_rectangle32_t geometry;
6+    struct swc_rectangle geometry;
7     uint32_t physical_width, physical_height;
8 
9     struct wl_array modes;
+3, -2
 1@@ -24,7 +24,8 @@
 2 #ifndef SWC_SURFACE_H
 3 #define SWC_SURFACE_H
 4 
 5-#include <stdbool.h>
 6+#include "swc.h"
 7+
 8 #include <wayland-server.h>
 9 #include <pixman.h>
10 
11@@ -90,7 +91,7 @@ struct swc_surface
12     void * view_state;
13 
14     uint32_t outputs;
15-    pixman_rectangle32_t geometry;
16+    struct swc_rectangle geometry;
17 
18     struct wl_signal event_signal;
19     struct wl_list link;
+4, -2
 1@@ -1,6 +1,8 @@
 2 #ifndef SWC_UTIL_H
 3 #define SWC_UTIL_H
 4 
 5+#include "swc.h"
 6+
 7 #include <stdlib.h>
 8 #include <stdio.h>
 9 #include <stdbool.h>
10@@ -59,14 +61,14 @@ static inline uint32_t swc_time()
11 extern pixman_box32_t infinite_extents;
12 
13 static inline bool swc_rectangle_contains_point
14-    (const pixman_rectangle32_t * rectangle, int32_t x, int32_t y)
15+    (const struct swc_rectangle * rectangle, int32_t x, int32_t y)
16 {
17     return x > rectangle->x && x < rectangle->x + rectangle->width
18         && y > rectangle->y && y < rectangle->y + rectangle->height;
19 }
20 
21 static inline bool swc_rectangle_overlap
22-    (const pixman_rectangle32_t * r1, const pixman_rectangle32_t * r2)
23+    (const struct swc_rectangle * r1, const struct swc_rectangle * r2)
24 {
25     return (MAX(r1->x + r1->width, r2->x + r2->width) - MIN(r1->x, r2->x)
26             < r1->width + r2->width)