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
3  *
4  * Copyright © 2002 University of Southern California
5  * Copyright © 2005 Red Hat, Inc.
6  * Copyright © 2011 Intel Corporation
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it either under the terms of the GNU Lesser General Public
10  * License version 2.1 as published by the Free Software Foundation
11  * (the "LGPL") or, at your option, under the terms of the Mozilla
12  * Public License Version 1.1 (the "MPL"). If you do not alter this
13  * notice, a recipient may use your version of this file under either
14  * the MPL or the LGPL.
15  *
16  * You should have received a copy of the LGPL along with this library
17  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
19  * You should have received a copy of the MPL along with this library
20  * in the file COPYING-MPL-1.1
21  *
22  * The contents of this file are subject to the Mozilla Public License
23  * Version 1.1 (the "License"); you may not use this file except in
24  * compliance with the License. You may obtain a copy of the License at
25  * http://www.mozilla.org/MPL/
26  *
27  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
28  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
29  * the specific language governing rights and limitations.
30  *
31  * The Original Code is the cairo graphics library.
32  *
33  * The Initial Developer of the Original Code is University of Southern
34  * California.
35  *
36  * Contributor(s):
37  *	Carl D. Worth <cworth@cworth.org>
38  *      Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
39  *	Chris Wilson <chris@chris-wilson.co.uk>
40  */
41 
42 #include "cairoint.h"
43 
44 #include "cairo-compositor-private.h"
45 #include "cairo-surface-fallback-private.h"
46 
47 cairo_int_status_t
_cairo_surface_fallback_paint(void * surface,cairo_operator_t op,const cairo_pattern_t * source,const cairo_clip_t * clip)48 _cairo_surface_fallback_paint (void			*surface,
49 			       cairo_operator_t		 op,
50 			       const cairo_pattern_t	*source,
51 			       const cairo_clip_t	*clip)
52 {
53     return _cairo_compositor_paint (&_cairo_fallback_compositor,
54 				    surface, op, source, clip);
55 }
56 
57 cairo_int_status_t
_cairo_surface_fallback_mask(void * surface,cairo_operator_t op,const cairo_pattern_t * source,const cairo_pattern_t * mask,const cairo_clip_t * clip)58 _cairo_surface_fallback_mask (void			*surface,
59 			      cairo_operator_t		 op,
60 			      const cairo_pattern_t	*source,
61 			      const cairo_pattern_t	*mask,
62 			      const cairo_clip_t	*clip)
63 {
64     return _cairo_compositor_mask (&_cairo_fallback_compositor,
65 				   surface, op, source, mask, clip);
66 }
67 
68 cairo_int_status_t
_cairo_surface_fallback_stroke(void * surface,cairo_operator_t op,const cairo_pattern_t * source,const cairo_path_fixed_t * path,const cairo_stroke_style_t * style,const cairo_matrix_t * ctm,const cairo_matrix_t * ctm_inverse,double tolerance,cairo_antialias_t antialias,const cairo_clip_t * clip)69 _cairo_surface_fallback_stroke (void			*surface,
70 				cairo_operator_t	 op,
71 				const cairo_pattern_t	*source,
72 				const cairo_path_fixed_t*path,
73 				const cairo_stroke_style_t*style,
74 				const cairo_matrix_t	*ctm,
75 				const cairo_matrix_t	*ctm_inverse,
76 				double			 tolerance,
77 				cairo_antialias_t	 antialias,
78 				const cairo_clip_t	*clip)
79 {
80     return _cairo_compositor_stroke (&_cairo_fallback_compositor,
81 				     surface, op, source, path,
82 				     style, ctm,ctm_inverse,
83 				     tolerance, antialias, clip);
84 }
85 
86 cairo_int_status_t
_cairo_surface_fallback_fill(void * surface,cairo_operator_t op,const cairo_pattern_t * source,const cairo_path_fixed_t * path,cairo_fill_rule_t fill_rule,double tolerance,cairo_antialias_t antialias,const cairo_clip_t * clip)87 _cairo_surface_fallback_fill (void			*surface,
88 			     cairo_operator_t		 op,
89 			     const cairo_pattern_t	*source,
90 			     const cairo_path_fixed_t	*path,
91 			     cairo_fill_rule_t		 fill_rule,
92 			     double			 tolerance,
93 			     cairo_antialias_t		 antialias,
94 			     const cairo_clip_t		*clip)
95 {
96     return _cairo_compositor_fill (&_cairo_fallback_compositor,
97 				   surface, op, source, path,
98 				   fill_rule, tolerance, antialias,
99 				   clip);
100 }
101 
102 cairo_int_status_t
_cairo_surface_fallback_glyphs(void * surface,cairo_operator_t op,const cairo_pattern_t * source,cairo_glyph_t * glyphs,int num_glyphs,cairo_scaled_font_t * scaled_font,const cairo_clip_t * clip)103 _cairo_surface_fallback_glyphs (void			*surface,
104 				cairo_operator_t	 op,
105 				const cairo_pattern_t	*source,
106 				cairo_glyph_t		*glyphs,
107 				int			 num_glyphs,
108 				cairo_scaled_font_t	*scaled_font,
109 				const cairo_clip_t	*clip)
110 {
111     return _cairo_compositor_glyphs (&_cairo_fallback_compositor,
112 				     surface, op, source,
113 				     glyphs, num_glyphs, scaled_font,
114 				     clip);
115 }
116