[cairo] [PATCH 53/71] drm/i915: fixup call to _cairo_boxes_extents()

Enrico Weigelt, metux IT consult enrico.weigelt at gr13.net
Mon Apr 17 16:57:32 UTC 2017


This function operates with boxes, not rects.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
---
 src/drm/cairo-drm-i915-surface.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/drm/cairo-drm-i915-surface.c b/src/drm/cairo-drm-i915-surface.c
index f8c81104a..57e1b3e46 100644
--- a/src/drm/cairo-drm-i915-surface.c
+++ b/src/drm/cairo-drm-i915-surface.c
@@ -110,6 +110,7 @@
 #include "cairo-region-private.h"
 #include "cairo-surface-offset-private.h"
 #include "cairo-image-surface-private.h"
+#include "cairo-box-inline.h"
 
 #include <sys/ioctl.h>
 #include <sys/mman.h>
@@ -1196,7 +1197,7 @@ RELEASE:
 static cairo_status_t
 i915_surface_extract_X_from_Y (i915_device_t *device,
 			       i915_surface_t *src,
-			       const cairo_rectangle_int_t *extents,
+			       const cairo_box_t box,
 			       i915_surface_t **clone_out)
 {
     i915_surface_t *clone;
@@ -1212,8 +1213,8 @@ i915_surface_extract_X_from_Y (i915_device_t *device,
     clone = (i915_surface_t *)
 	i915_surface_create_internal (&device->intel.base,
 				      src->intel.drm.format,
-				      extents->width,
-				      extents->height,
+				      _CAIRO_BOX_WIDTH(box),
+				      _CAIRO_BOX_HEIGHT(box),
 				      I915_TILING_X, TRUE);
     if (unlikely (clone->intel.drm.base.status))
 	return clone->intel.drm.base.status;
@@ -1222,11 +1223,11 @@ i915_surface_extract_X_from_Y (i915_device_t *device,
 
     _cairo_pattern_init_for_surface (&pattern, &src->intel.drm.base);
     pattern.base.filter = CAIRO_FILTER_NEAREST;
-    cairo_matrix_init_translate (&pattern.base.matrix, extents->x, extents->y);
+    cairo_matrix_init_translate (&pattern.base.matrix, box.p1.x, box.p1.y);
 
     rect.x = rect.y = 0;
-    rect.width = extents->width;
-    rect.height = extents->height;
+    rect.width = _CAIRO_BOX_WIDTH(box);
+    rect.height = _CAIRO_BOX_HEIGHT(box);
     status = i915_shader_acquire_pattern (&shader, &shader.source, &pattern.base, &rect);
     _cairo_pattern_fini (&pattern.base);
 
@@ -1241,7 +1242,7 @@ i915_surface_extract_X_from_Y (i915_device_t *device,
     if (unlikely (status))
 	goto err_device;
 
-    shader.add_rectangle (&shader, 0, 0, extents->width, extents->height);
+    shader.add_rectangle (&shader, 0, 0, _CAIRO_BOX_WIDTH(box), _CAIRO_BOX_HEIGHT(box));
 
     cairo_device_release (&device->intel.base.base);
     i915_shader_fini (&shader);
@@ -1300,19 +1301,19 @@ i915_blt_boxes (i915_surface_t *dst,
 
     device = i915_device (dst);
     if (i915_surface_get_bo (src)->tiling == I915_TILING_Y) {
-	cairo_rectangle_int_t extents;
+	cairo_box_t b;
 
-	_cairo_boxes_extents (boxes, &extents);
-	extents.x += tx;
-	extents.y += ty;
+	_cairo_boxes_extents (boxes, &b);
+	b.p1.x += tx;
+	b.p1.y += ty;
 
-	status = i915_surface_extract_X_from_Y (device, src, &extents, &src);
+	status = i915_surface_extract_X_from_Y (device, src, b, &src);
 	if (unlikely (status))
 	    return status;
 
 	free_me = &src->intel.drm.base;
-	tx = -extents.x;
-	ty = -extents.y;
+	tx = -b.p1.x;
+	ty = -b.p1.y;
     }
 
     bo_array[0] = i915_surface_get_bo (dst);
-- 
2.11.0.rc0.7.gbe5a750



More information about the cairo mailing list