[cairo] [PATCH 51/51] core: changed retval of _cairo_composite_rectangles_init_for_paint() to cairo_bool_t
Enrico Weigelt, metux IT consult
enrico.weigelt at gr13.net
Fri Dec 18 05:29:30 PST 2015
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt at gr13.net>
---
src/cairo-composite-rectangles-private.h | 2 +-
src/cairo-composite-rectangles.c | 10 +++++-----
src/cairo-compositor.c | 7 +++----
src/cairo-pdf-surface.c | 7 +++----
src/cairo-ps-surface.c | 7 +++----
src/cairo-recording-surface.c | 7 +++----
src/cairo-surface-observer.c | 8 ++++----
src/drm/cairo-drm-i915-surface.c | 7 +++----
src/drm/cairo-drm-i965-surface.c | 7 +++----
src/win32/cairo-win32-printing-surface.c | 7 +++----
10 files changed, 31 insertions(+), 38 deletions(-)
diff --git a/src/cairo-composite-rectangles-private.h b/src/cairo-composite-rectangles-private.h
index 911ef8b..7a23930 100644
--- a/src/cairo-composite-rectangles-private.h
+++ b/src/cairo-composite-rectangles-private.h
@@ -75,7 +75,7 @@ struct _cairo_composite_rectangles {
cairo_clip_t *clip; /* clip will be reduced to the minimal container */
};
-cairo_private cairo_int_status_t
+cairo_private cairo_bool_t
_cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extents,
cairo_surface_t *surface,
cairo_operator_t op,
diff --git a/src/cairo-composite-rectangles.c b/src/cairo-composite-rectangles.c
index d0d32c7..1d153cd 100644
--- a/src/cairo-composite-rectangles.c
+++ b/src/cairo-composite-rectangles.c
@@ -111,7 +111,7 @@ _cairo_composite_rectangles_init (cairo_composite_rectangles_t *extents,
return TRUE;
}
-cairo_int_status_t
+cairo_bool_t
_cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extents,
cairo_surface_t *surface,
cairo_operator_t op,
@@ -121,25 +121,25 @@ _cairo_composite_rectangles_init_for_paint (cairo_composite_rectangles_t *extent
if (! _cairo_composite_rectangles_init (extents,
surface, op, source, clip))
{
- return CAIRO_INT_STATUS_NOTHING_TO_DO;
+ return 0;
}
extents->mask = extents->destination;
extents->clip = _cairo_clip_reduce_for_composite (clip, extents);
if (_cairo_clip_is_all_clipped (extents->clip))
- return CAIRO_INT_STATUS_NOTHING_TO_DO;
+ return 0;
if (! _cairo_rectangle_intersect (&extents->unbounded,
_cairo_clip_get_extents (extents->clip)))
- return CAIRO_INT_STATUS_NOTHING_TO_DO;
+ return 0;
if (extents->source_pattern.base.type != CAIRO_PATTERN_TYPE_SOLID)
_cairo_pattern_sampled_area (&extents->source_pattern.base,
&extents->bounded,
&extents->source_sample_area);
- return CAIRO_STATUS_SUCCESS;
+ return 1;
}
static cairo_bool_t
diff --git a/src/cairo-compositor.c b/src/cairo-compositor.c
index 235e54c..deb729a 100644
--- a/src/cairo-compositor.c
+++ b/src/cairo-compositor.c
@@ -52,11 +52,10 @@ _cairo_compositor_paint (const cairo_compositor_t *compositor,
cairo_int_status_t status;
TRACE ((stderr, "%s\n", __FUNCTION__));
- status = _cairo_composite_rectangles_init_for_paint (&extents, surface,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents, surface,
op, source,
- clip);
- if (unlikely (status))
- return status;
+ clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
do {
while (compositor->paint == NULL)
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 2ba2ffb..86fae88 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -6954,11 +6954,10 @@ _cairo_pdf_surface_paint (void *abstract_surface,
cairo_composite_rectangles_t extents;
cairo_int_status_t status;
- status = _cairo_composite_rectangles_init_for_paint (&extents,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents,
&surface->base,
- op, source, clip);
- if (unlikely (status))
- return status;
+ op, source, clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
status = _cairo_pdf_surface_analyze_operation (surface, op, source, &extents.bounded);
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 70663a2..0034514 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -4122,11 +4122,10 @@ _cairo_ps_surface_paint (void *abstract_surface,
cairo_composite_rectangles_t extents;
cairo_status_t status;
- status = _cairo_composite_rectangles_init_for_paint (&extents,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents,
&surface->base,
- op, source, clip);
- if (unlikely (status))
- return status;
+ op, source, clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
if (surface->paginated_mode == CAIRO_PAGINATED_MODE_ANALYZE) {
status = _cairo_ps_surface_analyze_operation (surface, op, source, NULL, &extents.bounded);
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index e53e56c..9c9d211 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -731,12 +731,11 @@ _cairo_recording_surface_paint (void *abstract_surface,
}
}
- status = _cairo_composite_rectangles_init_for_paint (&composite,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&composite,
&surface->base,
op, source,
- clip);
- if (unlikely (status))
- return status;
+ clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
command = malloc (sizeof (cairo_command_paint_t));
if (unlikely (command == NULL)) {
diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c
index 9d12fcd..3751eba 100644
--- a/src/cairo-surface-observer.c
+++ b/src/cairo-surface-observer.c
@@ -729,14 +729,14 @@ _cairo_surface_observer_paint (void *abstract_surface,
add_pattern (&device->log.paint.source, source, surface->target);
add_clip (&device->log.paint.clip, clip);
- status = _cairo_composite_rectangles_init_for_paint (&composite,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&composite,
surface->target,
op, source,
- clip);
- if (unlikely (status)) {
+ clip)))
+ {
surface->log.paint.noop++;
device->log.paint.noop++;
- return status;
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
}
midpt (&composite, &x, &y);
diff --git a/src/drm/cairo-drm-i915-surface.c b/src/drm/cairo-drm-i915-surface.c
index f8277ae..842593e 100644
--- a/src/drm/cairo-drm-i915-surface.c
+++ b/src/drm/cairo-drm-i915-surface.c
@@ -1988,13 +1988,12 @@ i915_surface_paint_with_alpha (void *abstract_dst,
cairo_clip_path_t *clip_path;
cairo_status_t status;
- status = _cairo_composite_rectangles_init_for_paint (&extents,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents,
&(dst->intel.drm.base),
op,
source,
- clip);
- if (unlikely (status))
- return status;
+ clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
if (_cairo_clip_contains_extents (clip, &extents))
clip = NULL;
diff --git a/src/drm/cairo-drm-i965-surface.c b/src/drm/cairo-drm-i965-surface.c
index c2c0dfc..723b926 100644
--- a/src/drm/cairo-drm-i965-surface.c
+++ b/src/drm/cairo-drm-i965-surface.c
@@ -1095,12 +1095,11 @@ i965_surface_paint (void *abstract_dst,
/* XXX unsupported operators? use pixel shader blending, eventually */
- status = _cairo_composite_rectangles_init_for_paint (&extents,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents,
&(dst->intel.drm.base),
op, source,
- clip);
- if (unlikely (status))
- return status;
+ clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
if (clip != NULL && _cairo_clip_contains_extents (clip, &extents))
clip = NULL;
diff --git a/src/win32/cairo-win32-printing-surface.c b/src/win32/cairo-win32-printing-surface.c
index afc0b11..2d2ae37 100644
--- a/src/win32/cairo-win32-printing-surface.c
+++ b/src/win32/cairo-win32-printing-surface.c
@@ -1362,11 +1362,10 @@ _cairo_win32_printing_surface_paint (void *abstract_surface,
cairo_composite_rectangles_t extents;
cairo_status_t status;
- status = _cairo_composite_rectangles_init_for_paint (&extents,
+ if (unlikely(!_cairo_composite_rectangles_init_for_paint (&extents,
&surface->win32.base,
- op, source, clip);
- if (unlikely (status))
- return status;
+ op, source, clip)))
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
status = _cairo_surface_clipper_set_clip (&surface->clipper, clip);
if (unlikely (status))
--
2.6.4.442.g545299f
More information about the cairo
mailing list