[cairo] [PATCH 39/41] drm/i965: fixed _cairo_clip_*() calls
Enrico Weigelt, metux IT consult
enrico.weigelt at gr13.net
Thu Dec 10 14:17:15 PST 2015
With commit b132fae5e843c329d1414d1a65b2e8d66b99852f, the memory
handling of clip objects has changed - they're now managed in an
object pool. Therefore consumers need to be updated.
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
---
src/drm/cairo-drm-i965-glyphs.c | 16 ++++------------
src/drm/cairo-drm-i965-surface.c | 24 ++++++++++++------------
2 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/src/drm/cairo-drm-i965-glyphs.c b/src/drm/cairo-drm-i965-glyphs.c
index c66a63d..8c08a0f 100644
--- a/src/drm/cairo-drm-i965-glyphs.c
+++ b/src/drm/cairo-drm-i965-glyphs.c
@@ -230,8 +230,7 @@ i965_surface_glyphs (void *abstract_surface,
i965_device_t *device;
i965_glyphs_t glyphs;
cairo_composite_rectangles_t extents;
- cairo_clip_t local_clip;
- cairo_bool_t have_clip = FALSE;
+ cairo_clip_t *local_clip;
cairo_bool_t overlap;
cairo_region_t *clip_region = NULL;
intel_bo_t *last_bo = NULL;
@@ -255,14 +254,8 @@ i965_surface_glyphs (void *abstract_surface,
if (clip != NULL && _cairo_clip_contains_rectangle (clip, &extents.mask))
clip = NULL;
- if (clip != NULL && extents.is_bounded) {
- clip = _cairo_clip_init_copy (&local_clip, clip);
- status = _cairo_clip_rectangle (clip, &extents.bounded);
- if (unlikely (status))
- return status;
-
- have_clip = TRUE;
- }
+ if (clip != NULL && extents.is_bounded)
+ clip = local_clip = _cairo_clip_copy_intersect_rectangle (clip, &extents.bounded);
if (overlap || ! extents.is_bounded) {
cairo_format_t format;
@@ -497,8 +490,7 @@ i965_surface_glyphs (void *abstract_surface,
cairo_surface_destroy (&mask->intel.drm.base);
}
- if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (local_clip);
return status;
}
diff --git a/src/drm/cairo-drm-i965-surface.c b/src/drm/cairo-drm-i965-surface.c
index ec7b595..6870e79 100644
--- a/src/drm/cairo-drm-i965-surface.c
+++ b/src/drm/cairo-drm-i965-surface.c
@@ -1118,14 +1118,14 @@ i965_surface_paint (void *abstract_dst,
clip = NULL;
if (clip != NULL) {
- clip = _cairo_clip_init_copy (&local_clip, clip);
+ clip = _cairo_clip_copy (&local_clip);
have_clip = TRUE;
}
status = _cairo_clip_to_boxes (&clip, &extents, &clip_boxes, &num_boxes);
if (unlikely (status)) {
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1138,7 +1138,7 @@ i965_surface_paint (void *abstract_dst,
free (clip_boxes);
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1171,10 +1171,10 @@ i965_surface_mask (void *abstract_dst,
clip = NULL;
if (clip != NULL && extents.is_bounded) {
- clip = _cairo_clip_init_copy (&local_clip, clip);
+ clip = _cairo_clip_copy (&local_clip);
status = _cairo_clip_rectangle (clip, &extents.bounded);
if (unlikely (status)) {
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1243,7 +1243,7 @@ i965_surface_mask (void *abstract_dst,
err_shader:
i965_shader_fini (&shader);
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1314,14 +1314,14 @@ i965_surface_stroke (void *abstract_dst,
clip = NULL;
if (clip != NULL) {
- clip = _cairo_clip_init_copy (&local_clip, clip);
+ clip = _cairo_clip_copy (&local_clip);
have_clip = TRUE;
}
status = _cairo_clip_to_boxes (&clip, &extents, &clip_boxes, &num_boxes);
if (unlikely (status)) {
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1384,7 +1384,7 @@ CLEANUP_BOXES:
free (clip_boxes);
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1420,14 +1420,14 @@ i965_surface_fill (void *abstract_dst,
clip = NULL;
if (clip != NULL) {
- clip = _cairo_clip_init_copy (&local_clip, clip);
+ clip = _cairo_clip_copy (&local_clip);
have_clip = TRUE;
}
status = _cairo_clip_to_boxes (&clip, &extents, &clip_boxes, &num_boxes);
if (unlikely (status)) {
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
@@ -1487,7 +1487,7 @@ CLEANUP_BOXES:
free (clip_boxes);
if (have_clip)
- _cairo_clip_fini (&local_clip);
+ _cairo_clip_reset (&local_clip);
return status;
}
--
2.6.4.442.g545299f
More information about the cairo
mailing list