commit 64bdb1f

Michael Forney  ·  2013-09-05 07:49:13 +0000 UTC
parent 2ad8b5b
Add pitch field to wld_drawable
4 files changed,  +11, -8
M wld.h
+8, -7
 1@@ -69,7 +69,7 @@ static void intel_destroy(struct wld_drawable * drawable);
 2 static struct wld_intel_context * intel_create_context(int drm_fd);
 3 static void intel_destroy_context(struct wld_intel_context * context);
 4 static bool intel_device_supported(uint32_t vendor_id, uint32_t device_id);
 5-static struct drm_drawable * intel_create_drawable
 6+static struct wld_drawable * intel_create_drawable
 7     (struct wld_intel_context * context, uint32_t width, uint32_t height,
 8      uint32_t format);
 9 
10@@ -135,7 +135,7 @@ struct wld_drawable * intel_create_drawable
11     intel->context = context;
12     intel->bo = drm_intel_bo_alloc_tiled(context->bufmgr, "drawable",
13                                          width, height, 4,
14-                                         &tiling_mode, &intel->drm.pitch, 0);
15+                                         &tiling_mode, &intel->drm.base.pitch, 0);
16     drm_intel_bo_gem_export_to_prime(intel->bo, &intel->drm.fd);
17 
18     return &intel->drm.base;
19@@ -147,7 +147,7 @@ static void intel_fill_rectangle(struct wld_drawable * drawable, uint32_t color,
20 {
21     struct intel_drawable * intel = (void *) drawable;
22 
23-    xy_color_blt(&intel->context->batch, intel->bo, intel->drm.pitch,
24+    xy_color_blt(&intel->context->batch, intel->bo, intel->drm.base.pitch,
25                  x, y, x + width, y + height, color);
26 }
27 
28@@ -160,8 +160,9 @@ static void intel_copy_rectangle(struct wld_drawable * src_drawable,
29     struct intel_drawable * src = (void *) src_drawable;
30     struct intel_drawable * dst = (void *) dst_drawable;
31 
32-    xy_src_copy_blt(&dst->context->batch, src->bo, src->drm.pitch, src_x, src_y,
33-                    dst->bo, dst->drm.pitch, dst_x, dst_y, width, height);
34+    xy_src_copy_blt(&dst->context->batch,
35+                    src->bo, src->drm.base.pitch, src_x, src_y,
36+                    dst->bo, dst->drm.base.pitch, dst_x, dst_y, width, height);
37 }
38 
39 static void intel_draw_text_utf8(struct wld_drawable * drawable,
40@@ -182,7 +183,7 @@ static void intel_draw_text_utf8(struct wld_drawable * drawable,
41     int32_t origin_x = x;
42 
43     xy_setup_blt(&intel->context->batch, true, INTEL_BLT_RASTER_OPERATION_SRC,
44-                 0, color, intel->bo, intel->drm.pitch);
45+                 0, color, intel->bo, intel->drm.base.pitch);
46 
47     while ((ret = FcUtf8ToUcs4((FcChar8 *) text, &c, length)) > 0 && c != '\0')
48     {
49@@ -221,7 +222,7 @@ static void intel_draw_text_utf8(struct wld_drawable * drawable,
50             intel_batch_flush(&intel->context->batch);
51             xy_setup_blt(&intel->context->batch, true,
52                          INTEL_BLT_RASTER_OPERATION_SRC, 0, color,
53-                         intel->bo, intel->drm.pitch);
54+                         intel->bo, intel->drm.base.pitch);
55             goto retry;
56         }
57 
+1, -0
1@@ -125,6 +125,7 @@ struct wld_drawable * wld_pixman_create_drawable
2     pixman->base.interface = &pixman_draw;
3     pixman->base.width = width;
4     pixman->base.height = height;
5+    pixman->base.pitch = pitch;
6 
7     pixman->context = context;
8     pixman->image = pixman_image_create_bits(pixman_format(format),
+1, -1
1@@ -255,7 +255,7 @@ struct wld_drawable * wld_drm_create_drawable(struct wld_drm_context * drm,
2     {
3         *buffer = wl_drm_create_prime_buffer(drm->wl, drawable->fd,
4                                              width, height, format,
5-                                             0, drawable->pitch, 0, 0, 0, 0);
6+                                             0, drawable->base.pitch, 0, 0, 0, 0);
7     }
8 
9     return &drawable->base;
M wld.h
+1, -0
1@@ -115,6 +115,7 @@ static inline void wld_font_text_extents_utf8(struct wld_font * font,
2 struct wld_drawable
3 {
4     uint32_t width, height;
5+    unsigned long pitch;
6 
7     const struct wld_draw_interface * interface;
8 };