1 /* -*- Mode: c; tab-width: 8; c-basic-offset: 4; indent-tabs-mode: t; -*- */
2 /* cairo - a vector graphics library with display and print output
4 * Copyright © 2011 Intel Corporation
6 * This library is free software; you can redistribute it and/or
7 * modify it either under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation
9 * (the "LGPL") or, at your option, under the terms of the Mozilla
10 * Public License Version 1.1 (the "MPL"). If you do not alter this
11 * notice, a recipient may use your version of this file under either
12 * the MPL or the LGPL.
14 * You should have received a copy of the LGPL along with this library
15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
17 * You should have received a copy of the MPL along with this library
18 * in the file COPYING-MPL-1.1
20 * The contents of this file are subject to the Mozilla Public License
21 * Version 1.1 (the "License"); you may not use this file except in
22 * compliance with the License. You may obtain a copy of the License at
23 * http://www.mozilla.org/MPL/
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27 * the specific language governing rights and limitations.
29 * The Original Code is the cairo graphics library.
31 * The Initial Developer of the Original Code is University of Southern
35 * Chris Wilson <chris@chris-wilson.co.uk>
38 #ifndef CAIRO_SPANS_COMPOSITOR_PRIVATE_H
39 #define CAIRO_SPANS_COMPOSITOR_PRIVATE_H
41 #include "cairo-compositor-private.h"
42 #include "cairo-types-private.h"
43 #include "cairo-spans-private.h"
47 typedef struct _cairo_abstract_span_renderer {
48 cairo_span_renderer_t base;
50 } cairo_abstract_span_renderer_t;
52 struct cairo_spans_compositor {
53 cairo_compositor_t base;
56 #define CAIRO_SPANS_COMPOSITOR_HAS_LERP 0x1
58 /* pixel-aligned fast paths */
59 cairo_int_status_t (*fill_boxes) (void *surface,
61 const cairo_color_t *color,
62 cairo_boxes_t *boxes);
64 cairo_int_status_t (*draw_image_boxes) (void *surface,
65 cairo_image_surface_t *image,
69 cairo_int_status_t (*copy_boxes) (void *surface,
72 const cairo_rectangle_int_t *extents,
75 cairo_surface_t * (*pattern_to_surface) (cairo_surface_t *dst,
76 const cairo_pattern_t *pattern,
78 const cairo_rectangle_int_t *extents,
79 const cairo_rectangle_int_t *sample,
80 int *src_x, int *src_y);
82 cairo_int_status_t (*composite_boxes) (void *surface,
84 cairo_surface_t *source,
85 cairo_surface_t *mask,
93 const cairo_rectangle_int_t *extents);
95 /* general shape masks using a span renderer */
96 cairo_int_status_t (*renderer_init) (cairo_abstract_span_renderer_t *renderer,
97 const cairo_composite_rectangles_t *extents,
98 cairo_antialias_t antialias,
99 cairo_bool_t needs_clip);
101 void (*renderer_fini) (cairo_abstract_span_renderer_t *renderer,
102 cairo_int_status_t status);
106 _cairo_spans_compositor_init (cairo_spans_compositor_t *compositor,
107 const cairo_compositor_t *delegate);
111 #endif /* CAIRO_SPANS_COMPOSITOR_PRIVATE_H */