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

"Enrico Weigelt, metux IT consult" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
This function operates with boxes, not rects.

Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
---
 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

-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.