case CAIRO_OPERATOR_SOURCE: return PIXMAN_OP_SRC; case CAIRO_OPERATOR_OVER: return PIXMAN_OP_OVER; case CAIRO_OPERATOR_IN: return PIXMAN_OP_IN; case CAIRO_OPERATOR_OUT: return PIXMAN_OP_OUT; case CAIRO_OPERATOR_ATOP: return PIXMAN_OP_ATOP;
case CAIRO_OPERATOR_DEST: return PIXMAN_OP_DST; case CAIRO_OPERATOR_DEST_OVER: return PIXMAN_OP_OVER_REVERSE; case CAIRO_OPERATOR_DEST_IN: return PIXMAN_OP_IN_REVERSE; case CAIRO_OPERATOR_DEST_OUT: return PIXMAN_OP_OUT_REVERSE; case CAIRO_OPERATOR_DEST_ATOP: return PIXMAN_OP_ATOP_REVERSE;
case CAIRO_OPERATOR_XOR: return PIXMAN_OP_XOR; case CAIRO_OPERATOR_ADD: return PIXMAN_OP_ADD; case CAIRO_OPERATOR_SATURATE: return PIXMAN_OP_SATURATE;
case CAIRO_OPERATOR_MULTIPLY: return PIXMAN_OP_MULTIPLY; case CAIRO_OPERATOR_SCREEN: return PIXMAN_OP_SCREEN; case CAIRO_OPERATOR_OVERLAY: return PIXMAN_OP_OVERLAY; case CAIRO_OPERATOR_DARKEN: return PIXMAN_OP_DARKEN; case CAIRO_OPERATOR_LIGHTEN: return PIXMAN_OP_LIGHTEN; case CAIRO_OPERATOR_COLOR_DODGE: return PIXMAN_OP_COLOR_DODGE; case CAIRO_OPERATOR_COLOR_BURN: return PIXMAN_OP_COLOR_BURN; case CAIRO_OPERATOR_HARD_LIGHT: return PIXMAN_OP_HARD_LIGHT; case CAIRO_OPERATOR_SOFT_LIGHT: return PIXMAN_OP_SOFT_LIGHT; case CAIRO_OPERATOR_DIFFERENCE: return PIXMAN_OP_DIFFERENCE; case CAIRO_OPERATOR_EXCLUSION: return PIXMAN_OP_EXCLUSION; case CAIRO_OPERATOR_HSL_HUE: return PIXMAN_OP_HSL_HUE; case CAIRO_OPERATOR_HSL_SATURATION: return PIXMAN_OP_HSL_SATURATION; case CAIRO_OPERATOR_HSL_COLOR: return PIXMAN_OP_HSL_COLOR; case CAIRO_OPERATOR_HSL_LUMINOSITY: return PIXMAN_OP_HSL_LUMINOSITY;
/* Handles compositing with a clip surface when the operator allows * us to combine the clip with the mask
*/ static cairo_status_t
clip_and_composite_with_mask (const cairo_composite_rectangles_t*extents,
draw_func_t draw_func, void *draw_closure)
{
cairo_image_surface_t *dst = (cairo_image_surface_t *)extents->surface;
cairo_image_surface_t *mask;
pixman_image_t *src;
cairo_status_t status = CAIRO_STATUS_SUCCESS; int src_x, src_y;
/* Handles compositing with a clip surface when we have to do the operation * in two pieces and combine them together.
*/ static cairo_status_t
clip_and_composite_combine (const cairo_composite_rectangles_t*extents,
draw_func_t draw_func, void *draw_closure)
{
cairo_image_surface_t *dst = (cairo_image_surface_t *)extents->surface;
cairo_image_surface_t *tmp, *clip; int clip_x, clip_y;
cairo_status_t status;
/* Handles compositing for %CAIRO_OPERATOR_SOURCE, which is special; it's * defined as (src IN mask IN clip) ADD (dst OUT (mask IN clip))
*/ static cairo_status_t
clip_and_composite_source (const cairo_composite_rectangles_t *extents,
draw_func_t draw_func, void *draw_closure)
{
cairo_image_surface_t *dst = (cairo_image_surface_t *)extents->surface;
cairo_image_surface_t *mask;
pixman_image_t *src; int src_x, src_y;
cairo_status_t status = CAIRO_STATUS_SUCCESS;
/* top */ if (extents->bounded.y != extents->unbounded.y) { int x = extents->unbounded.x; int y = extents->unbounded.y; int width = extents->unbounded.width; int height = extents->bounded.y - y;
pixman_image_composite32 (PIXMAN_OP_OUT_REVERSE,
mask, NULL, dst->pixman_image,
x - mask_x, y - mask_y,
0, 0,
x, y,
width, height);
}
/* left */ if (extents->bounded.x != extents->unbounded.x) { int x = extents->unbounded.x; int y = extents->bounded.y; int width = extents->bounded.x - x; int height = extents->bounded.height;
pixman_image_composite32 (PIXMAN_OP_OUT_REVERSE,
mask, NULL, dst->pixman_image,
x - mask_x, y - mask_y,
0, 0,
x, y,
width, height);
}
/* right */ if (extents->bounded.x + extents->bounded.width != extents->unbounded.x + extents->unbounded.width) { int x = extents->bounded.x + extents->bounded.width; int y = extents->bounded.y; int width = extents->unbounded.x + extents->unbounded.width - x; int height = extents->bounded.height;
pixman_image_composite32 (PIXMAN_OP_OUT_REVERSE,
mask, NULL, dst->pixman_image,
x - mask_x, y - mask_y,
0, 0,
x, y,
width, height);
}
/* bottom */ if (extents->bounded.y + extents->bounded.height != extents->unbounded.y + extents->unbounded.height) { int x = extents->unbounded.x; int y = extents->bounded.y + extents->bounded.height; int width = extents->unbounded.width; int height = extents->unbounded.y + extents->unbounded.height - y;
pixman_image_composite32 (PIXMAN_OP_OUT_REVERSE,
mask, NULL, dst->pixman_image,
x - mask_x, y - mask_y,
0, 0,
x, y,
width, height);
}
/* X trims the affected area to the extents of the trapezoids, so * we need to compensate when fixing up the unbounded area.
*/
_cairo_traps_extents (traps, &box); return _cairo_composite_rectangles_intersect_mask_extents (extents, &box);
}
status = CAIRO_STATUS_SUCCESS;
_cairo_scaled_font_freeze_cache (info->font); for (i = 0; i < info->num_glyphs; i++) {
cairo_image_surface_t *glyph_surface;
cairo_scaled_glyph_t *scaled_glyph; unsignedlong glyph_index = info->glyphs[i].index; int x, y;
status = _cairo_scaled_glyph_lookup (info->font, glyph_index,
CAIRO_SCALED_GLYPH_INFO_SURFACE,
NULL, /* foreground color */
&scaled_glyph);
if (unlikely (status)) break;
glyph_surface = scaled_glyph->surface; if (glyph_surface->width && glyph_surface->height) { /* round glyph locations to the nearest pixel */ /* XXX: FRAGILE: We're ignoring device_transform scaling here. A bug? */
x = _cairo_lround (info->glyphs[i].x -
glyph_surface->base.device_transform.x0);
y = _cairo_lround (info->glyphs[i].y -
glyph_surface->base.device_transform.y0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.