summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-20 16:47:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-20 23:20:23 +0100
commit55bb7087b0236fe27980efda829f7b72e047b316 (patch)
treecfaadea94c8c7d266e4ee53c0da203ab5eafa45e /src
parentedb65213ec975e517165bc3b623f676a12917d0c (diff)
[directfb] Tweak _categorize_operation().
Explicitly list the extend modes that are supported/unsupported and immediately check for an unsupported operation.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-directfb-surface.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/cairo-directfb-surface.c b/src/cairo-directfb-surface.c
index ef31ad64..7efc8638 100644
--- a/src/cairo-directfb-surface.c
+++ b/src/cairo-directfb-surface.c
@@ -840,13 +840,16 @@ _directfb_categorize_operation (cairo_surface_attributes_t *src_attr)
return DFXL_STRETCHBLIT;
}
- if (src_attr->extend != CAIRO_EXTEND_NONE &&
- src_attr->extend != CAIRO_EXTEND_REPEAT)
- {
+ switch (src_attr->extend) {
+ case CAIRO_EXTEND_NONE:
+ case CAIRO_EXTEND_REPEAT:
+ return DFXL_BLIT;
+
+ default:
+ case CAIRO_EXTEND_REFLECT:
+ case CAIRO_EXTEND_PAD:
return DFXL_NONE;
}
-
- return DFXL_BLIT;
}
static cairo_int_status_t
@@ -880,8 +883,14 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
return status;
accel = _directfb_categorize_operation (&src_attr);
+ if (accel == DFXL_NONE) {
+ _directfb_finish_composite (dst, src_pattern, &src->base, &src_attr);
+ return CAIRO_INT_STATUS_UNSUPPORTED;
+ }
- dst->dfbsurface->GetAccelerationMask (dst->dfbsurface, src->dfbsurface, &mask);
+ dst->dfbsurface->GetAccelerationMask (dst->dfbsurface,
+ src->dfbsurface,
+ &mask);
if ((mask & accel) == 0) {
D_DEBUG_AT (CairoDFB_Render, "No acceleration (%08x)!\n", accel);
if (accel != DFXL_BLIT) {
@@ -908,7 +917,9 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
RUN_CLIPPED (dst, NULL,
dst->dfbsurface->Blit (dst->dfbsurface,
- src->dfbsurface, &sr, dst_x, dst_y));
+ src->dfbsurface,
+ &sr,
+ dst_x, dst_y));
} else if (src_attr.extend == CAIRO_EXTEND_REPEAT) {
DFBRegion clip;
@@ -921,7 +932,9 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
RUN_CLIPPED (dst, &clip,
dst->dfbsurface->TileBlit (dst->dfbsurface,
- src->dfbsurface, &sr, dst_x, dst_y));
+ src->dfbsurface,
+ &sr,
+ dst_x, dst_y));
}
break;
}
@@ -965,10 +978,10 @@ _cairo_directfb_surface_composite (cairo_operator_t op,
/* guaranteed by cairo_pattern_set_matrix (); */
assert (status == CAIRO_STATUS_SUCCESS);
- x1 = src_attr.x_offset;
- y1 = src_attr.y_offset;
- x2 = src->width - x1;
- y2 = src->height - y1;
+ x1 = src_x;
+ y1 = src_y;
+ x2 = width + x1;
+ y2 = height + y1;
src->dfbsurface->GetSize (src->dfbsurface, &w, &h);