commit e00bf11

Michael Forney  ·  2014-01-01 07:56:50 +0000 UTC
parent 56a5508
wld_draw_interface -> wld_drawable_impl
12 files changed,  +36, -36
M drm.c
M dumb.c
M wld.h
+19, -19
  1@@ -35,9 +35,9 @@ void default_fill_region(struct wld_drawable * drawable, uint32_t color,
  2 
  3     while (num_boxes--)
  4     {
  5-        drawable->interface->fill_rectangle(drawable, color, box->x1, box->y1,
  6-                                            box->x2 - box->x1,
  7-                                            box->y2 - box->y1);
  8+        drawable->impl->fill_rectangle(drawable, color, box->x1, box->y1,
  9+                                       box->x2 - box->x1,
 10+                                       box->y2 - box->y1);
 11         ++box;
 12     }
 13 }
 14@@ -53,9 +53,9 @@ void default_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
 15 
 16     while (num_boxes--)
 17     {
 18-        dst->interface->copy_rectangle(src, dst, box->x1, box->y1,
 19-                                       dst_x + box->x1, dst_y + box->y1,
 20-                                       box->x2 - box->x1, box->y2 - box->y1);
 21+        dst->impl->copy_rectangle(src, dst, box->x1, box->y1,
 22+                                  dst_x + box->x1, dst_y + box->y1,
 23+                                  box->x2 - box->x1, box->y2 - box->y1);
 24         ++box;
 25     }
 26 }
 27@@ -64,14 +64,14 @@ EXPORT
 28 void wld_fill_rectangle(struct wld_drawable * drawable, uint32_t color,
 29                         int32_t x, int32_t y, uint32_t width, uint32_t height)
 30 {
 31-    drawable->interface->fill_rectangle(drawable, color, x, y, width, height);
 32+    drawable->impl->fill_rectangle(drawable, color, x, y, width, height);
 33 }
 34 
 35 EXPORT
 36 void wld_fill_region(struct wld_drawable * drawable, uint32_t color,
 37                      pixman_region32_t * region)
 38 {
 39-    drawable->interface->fill_region(drawable, color, region);
 40+    drawable->impl->fill_region(drawable, color, region);
 41 }
 42 
 43 EXPORT
 44@@ -80,17 +80,17 @@ void wld_copy_rectangle(struct wld_drawable * src, struct wld_drawable * dst,
 45                         int32_t dst_x, int32_t dst_y,
 46                         uint32_t width, uint32_t height)
 47 {
 48-    assert(src->interface == dst->interface);
 49-    dst->interface->copy_rectangle(src, dst, src_x, src_y, dst_x, dst_y,
 50-                                   width, height);
 51+    assert(src->impl == dst->impl);
 52+    dst->impl->copy_rectangle(src, dst, src_x, src_y, dst_x, dst_y,
 53+                              width, height);
 54 }
 55 
 56 EXPORT
 57 void wld_copy_region(struct wld_drawable * src, struct wld_drawable * dst,
 58                      pixman_region32_t * region, int32_t dst_x, int32_t dst_y)
 59 {
 60-    assert(src->interface == dst->interface);
 61-    dst->interface->copy_region(src, dst, region, dst_x, dst_y);
 62+    assert(src->impl == dst->impl);
 63+    dst->impl->copy_region(src, dst, region, dst_x, dst_y);
 64 }
 65 
 66 EXPORT
 67@@ -102,31 +102,31 @@ void wld_draw_text_utf8_n(struct wld_drawable * drawable,
 68 {
 69     struct font * font = (void *) font_base;
 70 
 71-    drawable->interface->draw_text_utf8(drawable, font, color, x, y,
 72-                                        text, length, extents);
 73+    drawable->impl->draw_text_utf8(drawable, font, color, x, y,
 74+                                   text, length, extents);
 75 }
 76 
 77 EXPORT
 78 void wld_destroy_drawable(struct wld_drawable * drawable)
 79 {
 80-    drawable->interface->destroy(drawable);
 81+    drawable->impl->destroy(drawable);
 82 }
 83 
 84 EXPORT
 85 void wld_write(struct wld_drawable * drawable, const void * data, size_t size)
 86 {
 87-    drawable->interface->write(drawable, data, size);
 88+    drawable->impl->write(drawable, data, size);
 89 }
 90 
 91 EXPORT
 92 pixman_image_t * wld_map(struct wld_drawable * drawable)
 93 {
 94-    return drawable->interface->map(drawable);
 95+    return drawable->impl->map(drawable);
 96 }
 97 
 98 EXPORT
 99 void wld_flush(struct wld_drawable * drawable)
100 {
101-    drawable->interface->flush(drawable);
102+    drawable->impl->flush(drawable);
103 }
104 
+2, -2
 1@@ -35,9 +35,9 @@ struct wld_drm_interface
 2     struct wld_context * (* create_context)(int drm_fd);
 3 };
 4 
 5-struct drm_draw_interface
 6+struct drm_drawable_impl
 7 {
 8-    struct wld_draw_interface base;
 9+    struct wld_drawable_impl base;
10     drm_export_func_t export;
11     drm_get_handle_func_t get_handle;
12 };
M drm.c
+2, -2
 1@@ -88,12 +88,12 @@ bool wld_drm_is_dumb(struct wld_context * context)
 2 EXPORT
 3 int wld_drm_export(struct wld_drawable * drawable)
 4 {
 5-    return ((struct drm_draw_interface *) drawable->interface)->export(drawable);
 6+    return ((struct drm_drawable_impl *) drawable->impl)->export(drawable);
 7 }
 8 
 9 EXPORT
10 uint32_t wld_drm_get_handle(struct wld_drawable * drawable)
11 {
12-    return ((struct drm_draw_interface *) drawable->interface)->get_handle(drawable);
13+    return ((struct drm_drawable_impl *) drawable->impl)->get_handle(drawable);
14 }
15 
M dumb.c
+3, -3
 1@@ -57,7 +57,7 @@ const struct wld_context_impl * dumb_context_impl = &context_impl;
 2 static int drawable_export(struct wld_drawable * drawable);
 3 static uint32_t drawable_get_handle(struct wld_drawable * drawable);
 4 
 5-static struct drm_draw_interface draw_interface = {
 6+static struct drm_drawable_impl drawable_impl = {
 7     .export = &drawable_export,
 8     .get_handle = &drawable_get_handle
 9 };
10@@ -83,7 +83,7 @@ struct wld_context * drm_create_context(int drm_fd)
11 
12     if (!draw_initialized)
13     {
14-        draw_interface.base = *pixman_draw;
15+        drawable_impl.base = *pixman_drawable_impl;
16         draw_initialized = true;
17     }
18 
19@@ -126,7 +126,7 @@ static struct wld_drawable * new_drawable(struct dumb_context * context,
20         goto error2;
21     }
22 
23-    drawable->pixman.base.interface = &draw_interface.base;
24+    drawable->pixman.base.impl = &drawable_impl.base;
25     drawable->context = context;
26     drawable->handle = handle;
27 
+1, -1
1@@ -96,7 +96,7 @@ static struct intel_drawable * new_drawable(struct intel_context * context,
2     if (!(intel = malloc(sizeof *intel)))
3         return NULL;
4 
5-    intel->base.interface = &draw_interface.base;
6+    intel->base.impl = &drawable_impl.base;
7     intel->base.width = width;
8     intel->base.height = height;
9     intel->base.format = format;
+1, -1
1@@ -48,7 +48,7 @@ static pixman_image_t * drawable_map(struct wld_drawable * drawable);
2 static void drawable_flush(struct wld_drawable * drawable);
3 static void drawable_destroy(struct wld_drawable * drawable);
4 
5-static const struct wld_draw_interface draw_interface = {
6+static const struct wld_drawable_impl drawable_impl = {
7     .fill_rectangle = &drawable_fill_rectangle,
8     .copy_rectangle = &drawable_copy_rectangle,
9 #ifdef DRAWABLE_IMPLEMENTS_REGION
+1, -1
1@@ -51,7 +51,7 @@ static void drawable_destroy(struct wld_drawable * drawable);
2 static int drawable_export(struct wld_drawable * drawable);
3 static uint32_t drawable_get_handle(struct wld_drawable * drawable);
4 
5-static const struct drm_draw_interface draw_interface = {
6+static const struct drm_drawable_impl drawable_impl = {
7     .base = {
8         .fill_rectangle = &drawable_fill_rectangle,
9         .copy_rectangle = &drawable_copy_rectangle,
+1, -1
1@@ -35,7 +35,7 @@ struct pixman_drawable
2     struct pixman_context * context;
3 };
4 
5-extern const struct wld_draw_interface * const pixman_draw;
6+extern const struct wld_drawable_impl * const pixman_drawable_impl;
7 
8 bool pixman_initialize_drawable
9     (struct wld_context * context, struct pixman_drawable * drawable,
+3, -3
 1@@ -42,7 +42,7 @@ struct pixman_context
 2 #define DRAWABLE_IMPLEMENTS_REGION
 3 #include "interface/drawable.h"
 4 
 5-const struct wld_draw_interface * const pixman_draw = &draw_interface;
 6+const struct wld_drawable_impl * const pixman_drawable_impl = &drawable_impl;
 7 
 8 EXPORT
 9 struct wld_context * wld_pixman_create_context()
10@@ -68,7 +68,7 @@ bool pixman_initialize_drawable
11      uint32_t width, uint32_t height,
12      void * data, uint32_t pitch, uint32_t format)
13 {
14-    drawable->base.interface = &draw_interface;
15+    drawable->base.impl = &drawable_impl;
16     drawable->base.width = width;
17     drawable->base.height = height;
18     drawable->base.format = format;
19@@ -90,7 +90,7 @@ struct wld_drawable * new_drawable(struct pixman_context * context,
20     if (!(drawable = malloc(sizeof *drawable)))
21         return NULL;
22 
23-    drawable->base.interface = &draw_interface;
24+    drawable->base.impl = &drawable_impl;
25     drawable->base.width = pixman_image_get_width(image);
26     drawable->base.height = pixman_image_get_height(image);
27     drawable->base.format = format_pixman_to_wld
+1, -1
1@@ -199,7 +199,7 @@ struct wld_drawable * wld_wayland_create_drawable
2     wayland->surface = surface;
3     wayland->damage_tracking = damage_flags;
4 
5-    wayland->base.interface = &draw_interface;
6+    wayland->base.impl = &drawable_impl;
7     wayland->base.width = width;
8     wayland->base.height = height;
9 
+1, -1
1@@ -95,7 +95,7 @@ struct wld_context_impl
2     void (* destroy)(struct wld_context * context);
3 };
4 
5-struct wld_draw_interface
6+struct wld_drawable_impl
7 {
8     void (* fill_rectangle)(struct wld_drawable * drawable, uint32_t color,
9                             int32_t x, int32_t y,
M wld.h
+1, -1
1@@ -150,7 +150,7 @@ struct wld_drawable
2     unsigned long pitch;
3     enum wld_format format;
4 
5-    const struct wld_draw_interface * interface;
6+    const struct wld_drawable_impl * impl;
7 };
8 
9 /**