Rev 1892 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1892 | Rev 3959 | ||
---|---|---|---|
1 | /* cairo - a vector graphics library with display and print output |
1 | /* cairo - a vector graphics library with display and print output |
2 | * |
2 | * |
3 | * Copyright © 2002 University of Southern California |
3 | * Copyright © 2002 University of Southern California |
4 | * Copyright © 2005 Red Hat, Inc. |
4 | * Copyright © 2005 Red Hat, Inc. |
5 | * |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
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 |
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 |
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 |
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 |
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 |
11 | * notice, a recipient may use your version of this file under either |
12 | * the MPL or the LGPL. |
12 | * the MPL or the LGPL. |
13 | * |
13 | * |
14 | * You should have received a copy of the LGPL along with this library |
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 |
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 |
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 |
17 | * You should have received a copy of the MPL along with this library |
18 | * in the file COPYING-MPL-1.1 |
18 | * in the file COPYING-MPL-1.1 |
19 | * |
19 | * |
20 | * The contents of this file are subject to the Mozilla Public License |
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 |
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 |
22 | * compliance with the License. You may obtain a copy of the License at |
23 | * http://www.mozilla.org/MPL/ |
23 | * http://www.mozilla.org/MPL/ |
24 | * |
24 | * |
25 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY |
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 |
26 | * OF ANY KIND, either express or implied. See the LGPL or the MPL for |
27 | * the specific language governing rights and limitations. |
27 | * the specific language governing rights and limitations. |
28 | * |
28 | * |
29 | * The Original Code is the cairo graphics library. |
29 | * The Original Code is the cairo graphics library. |
30 | * |
30 | * |
31 | * The Initial Developer of the Original Code is University of Southern |
31 | * The Initial Developer of the Original Code is University of Southern |
32 | * California. |
32 | * California. |
33 | * |
33 | * |
34 | * Contributor(s): |
34 | * Contributor(s): |
35 | * Carl D. Worth |
35 | * Carl D. Worth |
36 | */ |
36 | */ |
37 | 37 | ||
38 | /* |
38 | /* |
39 | * These definitions are solely for use by the implementation of cairo |
39 | * These definitions are solely for use by the implementation of cairo |
40 | * and constitute no kind of standard. If you need any of these |
40 | * and constitute no kind of standard. If you need any of these |
41 | * functions, please drop me a note. Either the library needs new |
41 | * functions, please drop me a note. Either the library needs new |
42 | * functionality, or there's a way to do what you need using the |
42 | * functionality, or there's a way to do what you need using the |
43 | * existing published interfaces. cworth@cworth.org |
43 | * existing published interfaces. cworth@cworth.org |
44 | */ |
44 | */ |
45 | 45 | ||
46 | #ifndef _CAIROINT_H_ |
46 | #ifndef _CAIROINT_H_ |
47 | #define _CAIROINT_H_ |
47 | #define _CAIROINT_H_ |
48 | 48 | ||
49 | #if HAVE_CONFIG_H |
49 | #if HAVE_CONFIG_H |
50 | #include "config.h" |
50 | #include "config.h" |
51 | #endif |
51 | #endif |
52 | 52 | ||
53 | #ifdef _MSC_VER |
53 | #ifdef _MSC_VER |
54 | #define cairo_public __declspec(dllexport) |
54 | #define cairo_public __declspec(dllexport) |
55 | #endif |
55 | #endif |
56 | 56 | ||
57 | #include |
57 | #include |
58 | #include |
58 | #include |
59 | #include |
59 | #include |
60 | #include |
60 | #include |
61 | #include |
61 | #include |
62 | 62 | ||
63 | #ifdef _MSC_VER |
63 | #ifdef _MSC_VER |
64 | #define _USE_MATH_DEFINES |
64 | #define _USE_MATH_DEFINES |
65 | #endif |
65 | #endif |
66 | #include |
66 | #include |
67 | #include |
67 | #include |
68 | #include |
68 | #include |
69 | 69 | ||
70 | #include "cairo.h" |
70 | #include "cairo.h" |
71 | #include |
71 | #include |
72 | 72 | ||
73 | #include "cairo-compiler-private.h" |
73 | #include "cairo-compiler-private.h" |
- | 74 | #include "cairo-error-private.h" |
|
- | 75 | ||
- | 76 | #if CAIRO_HAS_PDF_SURFACE || \ |
|
- | 77 | CAIRO_HAS_PS_SURFACE || \ |
|
- | 78 | CAIRO_HAS_SCRIPT_SURFACE || \ |
|
- | 79 | CAIRO_HAS_XML_SURFACE |
|
- | 80 | #define CAIRO_HAS_DEFLATE_STREAM 1 |
|
- | 81 | #endif |
|
74 | 82 | ||
75 | #if CAIRO_HAS_PS_SURFACE || \ |
83 | #if CAIRO_HAS_PS_SURFACE || \ |
76 | CAIRO_HAS_PDF_SURFACE || \ |
84 | CAIRO_HAS_PDF_SURFACE || \ |
77 | CAIRO_HAS_SVG_SURFACE || \ |
85 | CAIRO_HAS_SVG_SURFACE || \ |
78 | CAIRO_HAS_WIN32_SURFACE |
86 | CAIRO_HAS_WIN32_SURFACE |
79 | #define CAIRO_HAS_FONT_SUBSET 1 |
87 | #define CAIRO_HAS_FONT_SUBSET 1 |
80 | #endif |
88 | #endif |
81 | 89 | ||
- | 90 | #if CAIRO_HAS_PS_SURFACE || \ |
|
- | 91 | CAIRO_HAS_PDF_SURFACE || \ |
|
82 | #if CAIRO_HAS_PS_SURFACE || CAIRO_HAS_PDF_SURFACE || CAIRO_HAS_FONT_SUBSET |
92 | CAIRO_HAS_FONT_SUBSET |
83 | #define CAIRO_HAS_PDF_OPERATORS 1 |
93 | #define CAIRO_HAS_PDF_OPERATORS 1 |
84 | #endif |
94 | #endif |
85 | 95 | ||
86 | CAIRO_BEGIN_DECLS |
96 | CAIRO_BEGIN_DECLS |
87 | 97 | ||
88 | #if _WIN32 && !_WIN32_WCE /* Permissions on WinCE? No worries! */ |
98 | #if _WIN32 && !_WIN32_WCE /* Permissions on WinCE? No worries! */ |
89 | cairo_private FILE * |
99 | cairo_private FILE * |
90 | _cairo_win32_tmpfile (void); |
100 | _cairo_win32_tmpfile (void); |
91 | #define tmpfile() _cairo_win32_tmpfile() |
101 | #define tmpfile() _cairo_win32_tmpfile() |
92 | #endif |
102 | #endif |
93 | 103 | ||
94 | #undef MIN |
104 | #undef MIN |
95 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
105 | #define MIN(a, b) ((a) < (b) ? (a) : (b)) |
96 | 106 | ||
97 | #undef MAX |
107 | #undef MAX |
98 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
108 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) |
99 | 109 | ||
100 | #ifndef FALSE |
110 | #ifndef FALSE |
101 | #define FALSE 0 |
111 | #define FALSE 0 |
102 | #endif |
112 | #endif |
103 | 113 | ||
104 | #ifndef TRUE |
114 | #ifndef TRUE |
105 | #define TRUE 1 |
115 | #define TRUE 1 |
106 | #endif |
116 | #endif |
107 | 117 | ||
108 | #ifndef M_PI |
118 | #ifndef M_PI |
109 | #define M_PI 3.14159265358979323846 |
119 | #define M_PI 3.14159265358979323846 |
110 | #endif |
120 | #endif |
111 | 121 | ||
112 | #ifndef M_SQRT2 |
122 | #ifndef M_SQRT2 |
113 | #define M_SQRT2 1.41421356237309504880 |
123 | #define M_SQRT2 1.41421356237309504880 |
114 | #endif |
124 | #endif |
115 | 125 | ||
116 | #ifndef M_SQRT1_2 |
126 | #ifndef M_SQRT1_2 |
117 | #define M_SQRT1_2 0.707106781186547524400844362104849039 |
127 | #define M_SQRT1_2 0.707106781186547524400844362104849039 |
118 | #endif |
128 | #endif |
119 | 129 | ||
120 | #undef ARRAY_LENGTH |
130 | #undef ARRAY_LENGTH |
121 | #define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0]))) |
131 | #define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0]))) |
122 | 132 | ||
123 | #undef STRINGIFY |
133 | #undef STRINGIFY |
124 | #undef STRINGIFY_ARG |
134 | #undef STRINGIFY_ARG |
125 | #define STRINGIFY(macro_or_string) STRINGIFY_ARG (macro_or_string) |
135 | #define STRINGIFY(macro_or_string) STRINGIFY_ARG (macro_or_string) |
126 | #define STRINGIFY_ARG(contents) #contents |
136 | #define STRINGIFY_ARG(contents) #contents |
127 | 137 | ||
128 | #if defined (__GNUC__) |
138 | #if defined (__GNUC__) |
129 | #define cairo_container_of(ptr, type, member) ({ \ |
139 | #define cairo_container_of(ptr, type, member) ({ \ |
130 | const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \ |
140 | const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \ |
131 | (type *) ((char *) mptr__ - offsetof (type, member)); \ |
141 | (type *) ((char *) mptr__ - offsetof (type, member)); \ |
132 | }) |
142 | }) |
133 | #else |
143 | #else |
134 | #define cairo_container_of(ptr, type, member) \ |
144 | #define cairo_container_of(ptr, type, member) \ |
135 | ((type *)((char *) (ptr) - (char *) &((type *)0)->member)) |
145 | ((type *)((char *) (ptr) - (char *) &((type *)0)->member)) |
136 | #endif |
146 | #endif |
137 | 147 | ||
138 | 148 | ||
139 | #define ASSERT_NOT_REACHED \ |
149 | #define ASSERT_NOT_REACHED \ |
140 | do { \ |
150 | do { \ |
141 | assert (!"reached"); \ |
151 | assert (!"reached"); \ |
142 | } while (0) |
152 | } while (0) |
143 | #define COMPILE_TIME_ASSERT1(condition, line) \ |
153 | #define COMPILE_TIME_ASSERT1(condition, line) \ |
144 | typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1] |
154 | typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1] |
145 | #define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line) |
155 | #define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line) |
146 | #define COMPILE_TIME_ASSERT(condition) COMPILE_TIME_ASSERT0(condition, __LINE__) |
156 | #define COMPILE_TIME_ASSERT(condition) COMPILE_TIME_ASSERT0(condition, __LINE__) |
147 | 157 | ||
148 | #define CAIRO_ALPHA_IS_CLEAR(alpha) ((alpha) <= ((double)0x00ff / (double)0xffff)) |
158 | #define CAIRO_ALPHA_IS_CLEAR(alpha) ((alpha) <= ((double)0x00ff / (double)0xffff)) |
149 | #define CAIRO_ALPHA_SHORT_IS_CLEAR(alpha) ((alpha) <= 0x00ff) |
159 | #define CAIRO_ALPHA_SHORT_IS_CLEAR(alpha) ((alpha) <= 0x00ff) |
150 | 160 | ||
151 | #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff)) |
161 | #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff)) |
152 | #define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00) |
162 | #define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00) |
153 | #define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0) |
163 | #define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0) |
154 | 164 | ||
155 | #define CAIRO_COLOR_IS_CLEAR(color) CAIRO_ALPHA_SHORT_IS_CLEAR ((color)->alpha_short) |
165 | #define CAIRO_COLOR_IS_CLEAR(color) CAIRO_ALPHA_SHORT_IS_CLEAR ((color)->alpha_short) |
156 | #define CAIRO_COLOR_IS_OPAQUE(color) CAIRO_ALPHA_SHORT_IS_OPAQUE ((color)->alpha_short) |
166 | #define CAIRO_COLOR_IS_OPAQUE(color) CAIRO_ALPHA_SHORT_IS_OPAQUE ((color)->alpha_short) |
157 | 167 | ||
158 | /* Reverse the bits in a byte with 7 operations (no 64-bit): |
168 | /* Reverse the bits in a byte with 7 operations (no 64-bit): |
159 | * Devised by Sean Anderson, July 13, 2001. |
169 | * Devised by Sean Anderson, July 13, 2001. |
160 | * Source: http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith32Bits |
170 | * Source: http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith32Bits |
161 | */ |
171 | */ |
162 | #define CAIRO_BITSWAP8(c) ((((c) * 0x0802LU & 0x22110LU) | ((c) * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16) |
172 | #define CAIRO_BITSWAP8(c) ((((c) * 0x0802LU & 0x22110LU) | ((c) * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16) |
163 | 173 | ||
164 | /* Return the number of 1 bits in mask. |
174 | /* Return the number of 1 bits in mask. |
165 | * |
175 | * |
166 | * GCC 3.4 supports a "population count" builtin, which on many targets is |
176 | * GCC 3.4 supports a "population count" builtin, which on many targets is |
167 | * implemented with a single instruction. There is a fallback definition |
177 | * implemented with a single instruction. There is a fallback definition |
168 | * in libgcc in case a target does not have one, which should be just as |
178 | * in libgcc in case a target does not have one, which should be just as |
169 | * good as the open-coded solution below, (which is "HACKMEM 169"). |
179 | * good as the open-coded solution below, (which is "HACKMEM 169"). |
170 | */ |
180 | */ |
171 | static inline int cairo_const |
181 | static inline int cairo_const |
172 | _cairo_popcount (uint32_t mask) |
182 | _cairo_popcount (uint32_t mask) |
173 | { |
183 | { |
174 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) |
184 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) |
175 | return __builtin_popcount (mask); |
185 | return __builtin_popcount (mask); |
176 | #else |
186 | #else |
177 | register int y; |
187 | register int y; |
178 | 188 | ||
179 | y = (mask >> 1) &033333333333; |
189 | y = (mask >> 1) &033333333333; |
180 | y = mask - y - ((y >>1) & 033333333333); |
190 | y = mask - y - ((y >>1) & 033333333333); |
181 | return (((y + (y >> 3)) & 030707070707) % 077); |
191 | return (((y + (y >> 3)) & 030707070707) % 077); |
182 | #endif |
192 | #endif |
183 | } |
193 | } |
- | 194 | ||
- | 195 | static cairo_always_inline cairo_bool_t |
|
- | 196 | _cairo_is_little_endian (void) |
|
- | 197 | { |
|
- | 198 | static const int i = 1; |
|
- | 199 | return *((char *) &i) == 0x01; |
|
- | 200 | } |
|
184 | 201 | ||
185 | #ifdef WORDS_BIGENDIAN |
202 | #ifdef WORDS_BIGENDIAN |
186 | #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) (c) |
203 | #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) (c) |
187 | #else |
204 | #else |
188 | #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) CAIRO_BITSWAP8(c) |
205 | #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) CAIRO_BITSWAP8(c) |
189 | #endif |
206 | #endif |
190 | 207 | ||
191 | #ifdef WORDS_BIGENDIAN |
208 | #ifdef WORDS_BIGENDIAN |
192 | 209 | ||
193 | #define cpu_to_be16(v) (v) |
210 | #define cpu_to_be16(v) (v) |
194 | #define be16_to_cpu(v) (v) |
211 | #define be16_to_cpu(v) (v) |
195 | #define cpu_to_be32(v) (v) |
212 | #define cpu_to_be32(v) (v) |
196 | #define be32_to_cpu(v) (v) |
213 | #define be32_to_cpu(v) (v) |
197 | 214 | ||
198 | #else |
215 | #else |
199 | 216 | ||
200 | static inline uint16_t cairo_const |
217 | static inline uint16_t cairo_const |
201 | cpu_to_be16(uint16_t v) |
218 | cpu_to_be16(uint16_t v) |
202 | { |
219 | { |
203 | return (v << 8) | (v >> 8); |
220 | return (v << 8) | (v >> 8); |
204 | } |
221 | } |
205 | 222 | ||
206 | static inline uint16_t cairo_const |
223 | static inline uint16_t cairo_const |
207 | be16_to_cpu(uint16_t v) |
224 | be16_to_cpu(uint16_t v) |
208 | { |
225 | { |
209 | return cpu_to_be16 (v); |
226 | return cpu_to_be16 (v); |
210 | } |
227 | } |
211 | 228 | ||
212 | static inline uint32_t cairo_const |
229 | static inline uint32_t cairo_const |
213 | cpu_to_be32(uint32_t v) |
230 | cpu_to_be32(uint32_t v) |
214 | { |
231 | { |
215 | return (cpu_to_be16 (v) << 16) | cpu_to_be16 (v >> 16); |
232 | return (cpu_to_be16 (v) << 16) | cpu_to_be16 (v >> 16); |
216 | } |
233 | } |
217 | 234 | ||
218 | static inline uint32_t cairo_const |
235 | static inline uint32_t cairo_const |
219 | be32_to_cpu(uint32_t v) |
236 | be32_to_cpu(uint32_t v) |
220 | { |
237 | { |
221 | return cpu_to_be32 (v); |
238 | return cpu_to_be32 (v); |
222 | } |
239 | } |
223 | 240 | ||
224 | #endif |
241 | #endif |
225 | 242 | ||
226 | 243 | ||
227 | /* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales. |
244 | /* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales. |
228 | */ |
245 | */ |
229 | 246 | ||
230 | static inline int cairo_const |
247 | static inline int cairo_const |
231 | _cairo_isspace (int c) |
248 | _cairo_isspace (int c) |
232 | { |
249 | { |
233 | return (c == 0x20 || (c >= 0x09 && c <= 0x0d)); |
250 | return (c == 0x20 || (c >= 0x09 && c <= 0x0d)); |
234 | } |
251 | } |
235 | 252 | ||
236 | static inline int cairo_const |
253 | static inline int cairo_const |
237 | _cairo_isdigit (int c) |
254 | _cairo_isdigit (int c) |
238 | { |
255 | { |
239 | return (c >= '0' && c <= '9'); |
256 | return (c >= '0' && c <= '9'); |
240 | } |
257 | } |
241 | 258 | ||
242 | #include "cairo-types-private.h" |
259 | #include "cairo-types-private.h" |
243 | #include "cairo-cache-private.h" |
260 | #include "cairo-cache-private.h" |
244 | #include "cairo-reference-count-private.h" |
261 | #include "cairo-reference-count-private.h" |
245 | #include "cairo-spans-private.h" |
262 | #include "cairo-spans-private.h" |
- | 263 | #include "cairo-surface-private.h" |
|
246 | 264 | ||
247 | cairo_private void |
265 | cairo_private void |
248 | _cairo_box_from_doubles (cairo_box_t *box, |
266 | _cairo_box_from_doubles (cairo_box_t *box, |
249 | double *x1, double *y1, |
267 | double *x1, double *y1, |
250 | double *x2, double *y2); |
268 | double *x2, double *y2); |
251 | 269 | ||
252 | cairo_private void |
270 | cairo_private void |
253 | _cairo_box_to_doubles (const cairo_box_t *box, |
271 | _cairo_box_to_doubles (const cairo_box_t *box, |
254 | double *x1, double *y1, |
272 | double *x1, double *y1, |
255 | double *x2, double *y2); |
273 | double *x2, double *y2); |
256 | 274 | ||
257 | cairo_private void |
275 | cairo_private void |
258 | _cairo_box_from_rectangle (cairo_box_t *box, |
276 | _cairo_box_from_rectangle (cairo_box_t *box, |
259 | const cairo_rectangle_int_t *rectangle); |
277 | const cairo_rectangle_int_t *rectangle); |
260 | 278 | ||
261 | cairo_private void |
279 | cairo_private void |
262 | _cairo_box_round_to_rectangle (const cairo_box_t *box, |
280 | _cairo_box_round_to_rectangle (const cairo_box_t *box, |
263 | cairo_rectangle_int_t *rectangle); |
281 | cairo_rectangle_int_t *rectangle); |
264 | 282 | ||
265 | cairo_private void |
283 | cairo_private void |
- | 284 | _cairo_box_add_curve_to (cairo_box_t *extents, |
|
- | 285 | const cairo_point_t *a, |
|
- | 286 | const cairo_point_t *b, |
|
- | 287 | const cairo_point_t *c, |
|
- | 288 | const cairo_point_t *d); |
|
- | 289 | ||
- | 290 | cairo_private void |
|
266 | _cairo_boxes_get_extents (const cairo_box_t *boxes, |
291 | _cairo_boxes_get_extents (const cairo_box_t *boxes, |
267 | int num_boxes, |
292 | int num_boxes, |
268 | cairo_box_t *extents); |
293 | cairo_box_t *extents); |
- | 294 | ||
- | 295 | cairo_private extern const cairo_rectangle_int_t _cairo_empty_rectangle; |
|
- | 296 | cairo_private extern const cairo_rectangle_int_t _cairo_unbounded_rectangle; |
|
269 | 297 | ||
270 | static inline void |
298 | static inline void |
271 | _cairo_unbounded_rectangle_init (cairo_rectangle_int_t *rect) |
299 | _cairo_unbounded_rectangle_init (cairo_rectangle_int_t *rect) |
272 | { |
300 | { |
273 | rect->x = CAIRO_RECT_INT_MIN; |
- | |
274 | rect->y = CAIRO_RECT_INT_MIN; |
301 | *rect = _cairo_unbounded_rectangle; |
275 | rect->width = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN; |
- | |
276 | rect->height = CAIRO_RECT_INT_MAX - CAIRO_RECT_INT_MIN; |
- | |
277 | } |
302 | } |
278 | 303 | ||
279 | cairo_private cairo_bool_t |
304 | cairo_private_no_warn cairo_bool_t |
280 | _cairo_rectangle_intersect (cairo_rectangle_int_t *dst, |
305 | _cairo_rectangle_intersect (cairo_rectangle_int_t *dst, |
281 | const cairo_rectangle_int_t *src); |
306 | const cairo_rectangle_int_t *src); |
282 | 307 | ||
283 | cairo_private cairo_bool_t |
308 | static inline cairo_bool_t |
284 | _cairo_box_intersects_line_segment (cairo_box_t *box, |
- | |
285 | cairo_line_t *line) cairo_pure; |
- | |
286 | - | ||
287 | cairo_private cairo_bool_t |
- | |
288 | _cairo_box_contains_point (cairo_box_t *box, |
309 | _cairo_rectangle_intersects (const cairo_rectangle_int_t *dst, |
289 | const cairo_point_t *point) cairo_pure; |
310 | const cairo_rectangle_int_t *src) |
290 | 311 | { |
|
291 | /* cairo-array.c structures and functions */ |
- | |
292 | - | ||
293 | cairo_private void |
312 | return !(src->x >= dst->x + (int) dst->width || |
294 | _cairo_array_init (cairo_array_t *array, int element_size); |
- | |
295 | - | ||
296 | cairo_private void |
313 | src->x + (int) src->width <= dst->x || |
297 | _cairo_array_init_snapshot (cairo_array_t *array, |
314 | src->y >= dst->y + (int) dst->height || |
298 | const cairo_array_t *other); |
315 | src->y + (int) src->height <= dst->y); |
299 | - | ||
300 | cairo_private void |
- | |
301 | _cairo_array_fini (cairo_array_t *array); |
316 | } |
302 | 317 | ||
- | 318 | static inline cairo_bool_t |
|
- | 319 | _cairo_rectangle_contains_rectangle (const cairo_rectangle_int_t *a, |
|
- | 320 | const cairo_rectangle_int_t *b) |
|
- | 321 | { |
|
- | 322 | return (a->x <= b->x && |
|
- | 323 | a->x + (int) a->width >= b->x + (int) b->width && |
|
- | 324 | a->y <= b->y && |
|
303 | cairo_private cairo_status_t |
325 | a->y + (int) a->height >= b->y + (int) b->height); |
304 | _cairo_array_grow_by (cairo_array_t *array, unsigned int additional); |
- | |
305 | - | ||
306 | cairo_private void |
- | |
307 | _cairo_array_truncate (cairo_array_t *array, unsigned int num_elements); |
- | |
308 | - | ||
309 | cairo_private cairo_status_t |
- | |
310 | _cairo_array_append (cairo_array_t *array, const void *element); |
326 | } |
311 | 327 | ||
312 | cairo_private cairo_status_t |
- | |
313 | _cairo_array_append_multiple (cairo_array_t *array, |
- | |
314 | const void *elements, |
- | |
315 | int num_elements); |
- | |
316 | - | ||
317 | cairo_private cairo_status_t |
- | |
318 | _cairo_array_allocate (cairo_array_t *array, |
- | |
319 | unsigned int num_elements, |
- | |
320 | void **elements); |
- | |
- | 328 | cairo_private void |
|
- | 329 | _cairo_rectangle_int_from_double (cairo_rectangle_int_t *recti, |
|
- | 330 | const cairo_rectangle_t *rectf); |
|
321 | 331 | ||
322 | cairo_private void * |
332 | /* Extends the dst rectangle to also contain src. |
- | 333 | * If one of the rectangles is empty, the result is undefined |
|
323 | _cairo_array_index (cairo_array_t *array, unsigned int index); |
334 | */ |
324 | 335 | cairo_private void |
|
- | 336 | _cairo_rectangle_union (cairo_rectangle_int_t *dst, |
|
325 | cairo_private void |
337 | const cairo_rectangle_int_t *src); |
326 | _cairo_array_copy_element (cairo_array_t *array, int index, void *dst); |
338 | |
- | 339 | cairo_private cairo_bool_t |
|
- | 340 | _cairo_box_intersects_line_segment (const cairo_box_t *box, |
|
- | 341 | cairo_line_t *line) cairo_pure; |
|
- | 342 | ||
327 | 343 | cairo_private cairo_bool_t |
|
328 | cairo_private int |
344 | _cairo_spline_intersects (const cairo_point_t *a, |
329 | _cairo_array_num_elements (cairo_array_t *array); |
345 | const cairo_point_t *b, |
330 | 346 | const cairo_point_t *c, |
|
331 | cairo_private int |
347 | const cairo_point_t *d, |
332 | _cairo_array_size (cairo_array_t *array); |
348 | const cairo_box_t *box) cairo_pure; |
333 | 349 | ||
334 | typedef struct { |
350 | typedef struct { |
335 | const cairo_user_data_key_t *key; |
351 | const cairo_user_data_key_t *key; |
336 | void *user_data; |
352 | void *user_data; |
337 | cairo_destroy_func_t destroy; |
353 | cairo_destroy_func_t destroy; |
338 | } cairo_user_data_slot_t; |
354 | } cairo_user_data_slot_t; |
339 | 355 | ||
340 | cairo_private void |
356 | cairo_private void |
341 | _cairo_user_data_array_init (cairo_user_data_array_t *array); |
357 | _cairo_user_data_array_init (cairo_user_data_array_t *array); |
342 | 358 | ||
343 | cairo_private void |
359 | cairo_private void |
344 | _cairo_user_data_array_fini (cairo_user_data_array_t *array); |
360 | _cairo_user_data_array_fini (cairo_user_data_array_t *array); |
345 | 361 | ||
346 | cairo_private void * |
362 | cairo_private void * |
347 | _cairo_user_data_array_get_data (cairo_user_data_array_t *array, |
363 | _cairo_user_data_array_get_data (cairo_user_data_array_t *array, |
348 | const cairo_user_data_key_t *key); |
364 | const cairo_user_data_key_t *key); |
349 | 365 | ||
350 | cairo_private cairo_status_t |
366 | cairo_private cairo_status_t |
351 | _cairo_user_data_array_set_data (cairo_user_data_array_t *array, |
367 | _cairo_user_data_array_set_data (cairo_user_data_array_t *array, |
352 | const cairo_user_data_key_t *key, |
368 | const cairo_user_data_key_t *key, |
353 | void *user_data, |
369 | void *user_data, |
354 | cairo_destroy_func_t destroy); |
370 | cairo_destroy_func_t destroy); |
355 | 371 | ||
356 | cairo_private cairo_status_t |
372 | cairo_private cairo_status_t |
357 | _cairo_user_data_array_copy (cairo_user_data_array_t *dst, |
373 | _cairo_user_data_array_copy (cairo_user_data_array_t *dst, |
358 | cairo_user_data_array_t *src); |
374 | const cairo_user_data_array_t *src); |
359 | 375 | ||
360 | cairo_private void |
376 | cairo_private void |
361 | _cairo_user_data_array_foreach (cairo_user_data_array_t *array, |
377 | _cairo_user_data_array_foreach (cairo_user_data_array_t *array, |
362 | void (*func) (const void *key, |
378 | void (*func) (const void *key, |
363 | void *elt, |
379 | void *elt, |
364 | void *closure), |
380 | void *closure), |
365 | void *closure); |
381 | void *closure); |
366 | 382 | ||
367 | #define _CAIRO_HASH_INIT_VALUE 5381 |
383 | #define _CAIRO_HASH_INIT_VALUE 5381 |
368 | 384 | ||
369 | cairo_private unsigned long |
385 | cairo_private unsigned long |
370 | _cairo_hash_string (const char *c); |
386 | _cairo_hash_string (const char *c); |
371 | 387 | ||
372 | cairo_private unsigned long |
388 | cairo_private unsigned long |
373 | _cairo_hash_bytes (unsigned long hash, |
389 | _cairo_hash_bytes (unsigned long hash, |
374 | const void *bytes, |
390 | const void *bytes, |
375 | unsigned int length); |
391 | unsigned int length); |
376 | 392 | ||
377 | #define _cairo_scaled_glyph_index(g) ((g)->hash_entry.hash) |
393 | #define _cairo_scaled_glyph_index(g) ((g)->hash_entry.hash) |
378 | #define _cairo_scaled_glyph_set_index(g, i) ((g)->hash_entry.hash = (i)) |
394 | #define _cairo_scaled_glyph_set_index(g, i) ((g)->hash_entry.hash = (i)) |
379 | 395 | ||
380 | #include "cairo-scaled-font-private.h" |
396 | #include "cairo-scaled-font-private.h" |
381 | 397 | ||
382 | struct _cairo_font_face { |
398 | struct _cairo_font_face { |
383 | /* hash_entry must be first */ |
399 | /* hash_entry must be first */ |
384 | cairo_hash_entry_t hash_entry; |
400 | cairo_hash_entry_t hash_entry; |
385 | cairo_status_t status; |
401 | cairo_status_t status; |
386 | cairo_reference_count_t ref_count; |
402 | cairo_reference_count_t ref_count; |
387 | cairo_user_data_array_t user_data; |
403 | cairo_user_data_array_t user_data; |
388 | const cairo_font_face_backend_t *backend; |
404 | const cairo_font_face_backend_t *backend; |
389 | }; |
405 | }; |
390 | 406 | ||
391 | cairo_private void |
407 | cairo_private void |
392 | _cairo_reset_static_data (void); |
408 | _cairo_default_context_reset_static_data (void); |
393 | 409 | ||
394 | cairo_private void |
410 | cairo_private void |
395 | _cairo_toy_font_face_reset_static_data (void); |
411 | _cairo_toy_font_face_reset_static_data (void); |
396 | 412 | ||
397 | cairo_private void |
413 | cairo_private void |
398 | _cairo_ft_font_reset_static_data (void); |
414 | _cairo_ft_font_reset_static_data (void); |
- | 415 | ||
- | 416 | cairo_private void |
|
- | 417 | _cairo_win32_font_reset_static_data (void); |
|
- | 418 | ||
- | 419 | #if CAIRO_HAS_COGL_SURFACE |
|
- | 420 | void |
|
- | 421 | _cairo_cogl_context_reset_static_data (void); |
|
- | 422 | #endif |
|
399 | 423 | ||
400 | /* the font backend interface */ |
424 | /* the font backend interface */ |
401 | 425 | ||
402 | struct _cairo_unscaled_font_backend { |
426 | struct _cairo_unscaled_font_backend { |
403 | void (*destroy) (void *unscaled_font); |
427 | void (*destroy) (void *unscaled_font); |
404 | }; |
428 | }; |
405 | 429 | ||
406 | /* #cairo_toy_font_face_t - simple family/slant/weight font faces used for |
430 | /* #cairo_toy_font_face_t - simple family/slant/weight font faces used for |
407 | * the built-in font API |
431 | * the built-in font API |
408 | */ |
432 | */ |
409 | 433 | ||
410 | typedef struct _cairo_toy_font_face { |
434 | typedef struct _cairo_toy_font_face { |
411 | cairo_font_face_t base; |
435 | cairo_font_face_t base; |
412 | const char *family; |
436 | const char *family; |
413 | cairo_bool_t owns_family; |
437 | cairo_bool_t owns_family; |
414 | cairo_font_slant_t slant; |
438 | cairo_font_slant_t slant; |
415 | cairo_font_weight_t weight; |
439 | cairo_font_weight_t weight; |
416 | 440 | ||
417 | cairo_font_face_t *impl_face; /* The non-toy font face this actually uses */ |
441 | cairo_font_face_t *impl_face; /* The non-toy font face this actually uses */ |
418 | } cairo_toy_font_face_t; |
442 | } cairo_toy_font_face_t; |
419 | 443 | ||
420 | typedef enum _cairo_scaled_glyph_info { |
444 | typedef enum _cairo_scaled_glyph_info { |
421 | CAIRO_SCALED_GLYPH_INFO_METRICS = (1 << 0), |
445 | CAIRO_SCALED_GLYPH_INFO_METRICS = (1 << 0), |
422 | CAIRO_SCALED_GLYPH_INFO_SURFACE = (1 << 1), |
446 | CAIRO_SCALED_GLYPH_INFO_SURFACE = (1 << 1), |
423 | CAIRO_SCALED_GLYPH_INFO_PATH = (1 << 2), |
447 | CAIRO_SCALED_GLYPH_INFO_PATH = (1 << 2), |
424 | CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE = (1 << 3) |
448 | CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE = (1 << 3) |
425 | } cairo_scaled_glyph_info_t; |
449 | } cairo_scaled_glyph_info_t; |
426 | 450 | ||
427 | typedef struct _cairo_scaled_font_subset { |
451 | typedef struct _cairo_scaled_font_subset { |
428 | cairo_scaled_font_t *scaled_font; |
452 | cairo_scaled_font_t *scaled_font; |
429 | unsigned int font_id; |
453 | unsigned int font_id; |
430 | unsigned int subset_id; |
454 | unsigned int subset_id; |
431 | 455 | ||
432 | /* Index of glyphs array is subset_glyph_index. |
456 | /* Index of glyphs array is subset_glyph_index. |
433 | * Value of glyphs array is scaled_font_glyph_index. |
457 | * Value of glyphs array is scaled_font_glyph_index. |
434 | */ |
458 | */ |
435 | unsigned long *glyphs; |
459 | unsigned long *glyphs; |
436 | unsigned long *to_unicode; |
- | |
437 | char **utf8; |
460 | char **utf8; |
438 | char **glyph_names; |
461 | char **glyph_names; |
- | 462 | int *to_latin_char; |
|
- | 463 | unsigned long *latin_to_subset_glyph_index; |
|
439 | unsigned int num_glyphs; |
464 | unsigned int num_glyphs; |
440 | cairo_bool_t is_composite; |
465 | cairo_bool_t is_composite; |
441 | cairo_bool_t is_scaled; |
466 | cairo_bool_t is_scaled; |
- | 467 | cairo_bool_t is_latin; |
|
442 | } cairo_scaled_font_subset_t; |
468 | } cairo_scaled_font_subset_t; |
443 | 469 | ||
444 | struct _cairo_scaled_font_backend { |
470 | struct _cairo_scaled_font_backend { |
445 | cairo_font_type_t type; |
471 | cairo_font_type_t type; |
446 | 472 | ||
447 | void |
473 | void |
448 | (*fini) (void *scaled_font); |
474 | (*fini) (void *scaled_font); |
449 | 475 | ||
450 | cairo_warn cairo_int_status_t |
476 | cairo_warn cairo_int_status_t |
451 | (*scaled_glyph_init) (void *scaled_font, |
477 | (*scaled_glyph_init) (void *scaled_font, |
452 | cairo_scaled_glyph_t *scaled_glyph, |
478 | cairo_scaled_glyph_t *scaled_glyph, |
453 | cairo_scaled_glyph_info_t info); |
479 | cairo_scaled_glyph_info_t info); |
454 | 480 | ||
455 | /* A backend only needs to implement this or ucs4_to_index(), not |
481 | /* A backend only needs to implement this or ucs4_to_index(), not |
456 | * both. This allows the backend to do something more sophisticated |
482 | * both. This allows the backend to do something more sophisticated |
457 | * then just converting characters one by one. |
483 | * then just converting characters one by one. |
458 | */ |
484 | */ |
459 | cairo_warn cairo_int_status_t |
485 | cairo_warn cairo_int_status_t |
460 | (*text_to_glyphs) (void *scaled_font, |
486 | (*text_to_glyphs) (void *scaled_font, |
461 | double x, |
487 | double x, |
462 | double y, |
488 | double y, |
463 | const char *utf8, |
489 | const char *utf8, |
464 | int utf8_len, |
490 | int utf8_len, |
465 | cairo_glyph_t **glyphs, |
491 | cairo_glyph_t **glyphs, |
466 | int *num_glyphs, |
492 | int *num_glyphs, |
467 | cairo_text_cluster_t **clusters, |
493 | cairo_text_cluster_t **clusters, |
468 | int *num_clusters, |
494 | int *num_clusters, |
469 | cairo_text_cluster_flags_t *cluster_flags); |
495 | cairo_text_cluster_flags_t *cluster_flags); |
470 | 496 | ||
471 | unsigned long |
497 | unsigned long |
472 | (*ucs4_to_index) (void *scaled_font, |
498 | (*ucs4_to_index) (void *scaled_font, |
473 | uint32_t ucs4); |
499 | uint32_t ucs4); |
474 | cairo_warn cairo_int_status_t |
- | |
475 | (*show_glyphs) (void *scaled_font, |
- | |
476 | cairo_operator_t op, |
- | |
477 | const cairo_pattern_t *pattern, |
- | |
478 | cairo_surface_t *surface, |
- | |
479 | int source_x, |
- | |
480 | int source_y, |
- | |
481 | int dest_x, |
- | |
482 | int dest_y, |
- | |
483 | unsigned int width, |
- | |
484 | unsigned int height, |
- | |
485 | cairo_glyph_t *glyphs, |
- | |
486 | int num_glyphs, |
- | |
487 | cairo_region_t *clip_region, |
- | |
488 | int *remaining_glyphs); |
- | |
- | 500 | ||
- | 501 | /* Read data from a sfnt font table. |
|
- | 502 | * @scaled_font: font |
|
- | 503 | * @tag: 4 byte table name specifying the table to read. |
|
- | 504 | * @offset: offset into the table |
|
- | 505 | * @buffer: buffer to write data into. Caller must ensure there is sufficient space. |
|
- | 506 | * If NULL, return the size of the table in @length. |
|
- | 507 | * @length: If @buffer is NULL, the size of the table will be returned in @length. |
|
- | 508 | * If @buffer is not null, @length specifies the number of bytes to read. |
|
- | 509 | * |
|
- | 510 | * If less than @length bytes are available to read this function |
|
- | 511 | * returns CAIRO_INT_STATUS_UNSUPPORTED. Note that requesting more |
|
- | 512 | * bytes than are available in the table may continue reading data |
|
- | 513 | * from the following table and return success. If this is |
|
- | 514 | * undesirable the caller should first query the table size. If an |
|
- | 515 | * error occurs the output value of @length is undefined. |
|
- | 516 | * |
|
- | 517 | * Returns CAIRO_INT_STATUS_UNSUPPORTED if not a sfnt style font or table not found. |
|
489 | 518 | */ |
|
490 | cairo_warn cairo_int_status_t |
519 | cairo_warn cairo_int_status_t |
491 | (*load_truetype_table)(void *scaled_font, |
520 | (*load_truetype_table)(void *scaled_font, |
492 | unsigned long tag, |
521 | unsigned long tag, |
493 | long offset, |
522 | long offset, |
494 | unsigned char *buffer, |
523 | unsigned char *buffer, |
495 | unsigned long *length); |
524 | unsigned long *length); |
496 | 525 | ||
497 | /* ucs4 is set to -1 if the unicode character could not be found |
526 | /* ucs4 is set to -1 if the unicode character could not be found |
498 | * for the glyph */ |
527 | * for the glyph */ |
499 | cairo_warn cairo_int_status_t |
528 | cairo_warn cairo_int_status_t |
500 | (*index_to_ucs4)(void *scaled_font, |
529 | (*index_to_ucs4)(void *scaled_font, |
501 | unsigned long index, |
530 | unsigned long index, |
502 | uint32_t *ucs4); |
531 | uint32_t *ucs4); |
- | 532 | ||
- | 533 | cairo_warn cairo_bool_t |
|
- | 534 | (*is_synthetic)(void *scaled_font); |
|
- | 535 | ||
- | 536 | /* For type 1 fonts, return the glyph name for a given glyph index. |
|
- | 537 | * A glyph index and list of glyph names in the Type 1 fonts is provided. |
|
- | 538 | * The function returns the index of the glyph in the list of glyph names. |
|
- | 539 | * @scaled_font: font |
|
- | 540 | * @glyph_names: the names of each glyph in the Type 1 font in the |
|
- | 541 | * order they appear in the CharStrings array |
|
- | 542 | * @num_glyph_names: the number of names in the glyph_names array |
|
- | 543 | * @glyph_index: the given glyph index |
|
- | 544 | * @glyph_array_index: (index into glyph_names) the glyph name corresponding |
|
- | 545 | * to the glyph_index |
|
- | 546 | */ |
|
- | 547 | ||
- | 548 | cairo_warn cairo_int_status_t |
|
- | 549 | (*index_to_glyph_name)(void *scaled_font, |
|
- | 550 | char **glyph_names, |
|
- | 551 | int num_glyph_names, |
|
- | 552 | unsigned long glyph_index, |
|
- | 553 | unsigned long *glyph_array_index); |
|
- | 554 | ||
- | 555 | /* Read data from a PostScript font. |
|
- | 556 | * @scaled_font: font |
|
- | 557 | * @offset: offset into the table |
|
- | 558 | * @buffer: buffer to write data into. Caller must ensure there is sufficient space. |
|
- | 559 | * If NULL, return the size of the table in @length. |
|
- | 560 | * @length: If @buffer is NULL, the size of the table will be returned in @length. |
|
- | 561 | * If @buffer is not null, @length specifies the number of bytes to read. |
|
- | 562 | * |
|
- | 563 | * If less than @length bytes are available to read this function |
|
- | 564 | * returns CAIRO_INT_STATUS_UNSUPPORTED. If an error occurs the |
|
- | 565 | * output value of @length is undefined. |
|
- | 566 | * |
|
- | 567 | * Returns CAIRO_INT_STATUS_UNSUPPORTED if not a Type 1 font. |
|
- | 568 | */ |
|
- | 569 | cairo_warn cairo_int_status_t |
|
- | 570 | (*load_type1_data) (void *scaled_font, |
|
- | 571 | long offset, |
|
- | 572 | unsigned char *buffer, |
|
- | 573 | unsigned long *length); |
|
503 | }; |
574 | }; |
504 | 575 | ||
505 | struct _cairo_font_face_backend { |
576 | struct _cairo_font_face_backend { |
506 | cairo_font_type_t type; |
577 | cairo_font_type_t type; |
507 | 578 | ||
508 | cairo_warn cairo_status_t |
579 | cairo_warn cairo_status_t |
509 | (*create_for_toy) (cairo_toy_font_face_t *toy_face, |
580 | (*create_for_toy) (cairo_toy_font_face_t *toy_face, |
510 | cairo_font_face_t **font_face); |
581 | cairo_font_face_t **font_face); |
511 | 582 | ||
512 | /* The destroy() function is allowed to resurrect the font face |
583 | /* The destroy() function is allowed to resurrect the font face |
513 | * by re-referencing. This is needed for the FreeType backend. |
584 | * by re-referencing. This is needed for the FreeType backend. |
514 | */ |
585 | */ |
515 | void |
586 | void |
516 | (*destroy) (void *font_face); |
587 | (*destroy) (void *font_face); |
517 | 588 | ||
518 | cairo_warn cairo_status_t |
589 | cairo_warn cairo_status_t |
519 | (*scaled_font_create) (void *font_face, |
590 | (*scaled_font_create) (void *font_face, |
520 | const cairo_matrix_t *font_matrix, |
591 | const cairo_matrix_t *font_matrix, |
521 | const cairo_matrix_t *ctm, |
592 | const cairo_matrix_t *ctm, |
522 | const cairo_font_options_t *options, |
593 | const cairo_font_options_t *options, |
523 | cairo_scaled_font_t **scaled_font); |
594 | cairo_scaled_font_t **scaled_font); |
524 | 595 | ||
525 | cairo_font_face_t * |
596 | cairo_font_face_t * |
526 | (*get_implementation) (void *font_face, |
597 | (*get_implementation) (void *font_face, |
527 | const cairo_matrix_t *font_matrix, |
598 | const cairo_matrix_t *font_matrix, |
528 | const cairo_matrix_t *ctm, |
599 | const cairo_matrix_t *ctm, |
529 | const cairo_font_options_t *options); |
600 | const cairo_font_options_t *options); |
530 | }; |
601 | }; |
531 | 602 | ||
532 | extern const cairo_private struct _cairo_font_face_backend _cairo_user_font_face_backend; |
603 | extern const cairo_private struct _cairo_font_face_backend _cairo_user_font_face_backend; |
533 | 604 | ||
534 | /* concrete font backends */ |
605 | /* concrete font backends */ |
535 | #if CAIRO_HAS_FT_FONT |
606 | #if CAIRO_HAS_FT_FONT |
536 | 607 | ||
537 | extern const cairo_private struct _cairo_font_face_backend _cairo_ft_font_face_backend; |
608 | extern const cairo_private struct _cairo_font_face_backend _cairo_ft_font_face_backend; |
538 | 609 | ||
539 | #endif |
610 | #endif |
540 | 611 | ||
541 | #if CAIRO_HAS_WIN32_FONT |
612 | #if CAIRO_HAS_WIN32_FONT |
542 | 613 | ||
543 | extern const cairo_private struct _cairo_font_face_backend _cairo_win32_font_face_backend; |
614 | extern const cairo_private struct _cairo_font_face_backend _cairo_win32_font_face_backend; |
544 | 615 | ||
545 | #endif |
616 | #endif |
546 | 617 | ||
547 | #if CAIRO_HAS_QUARTZ_FONT |
618 | #if CAIRO_HAS_QUARTZ_FONT |
548 | 619 | ||
549 | extern const cairo_private struct _cairo_font_face_backend _cairo_quartz_font_face_backend; |
620 | extern const cairo_private struct _cairo_font_face_backend _cairo_quartz_font_face_backend; |
550 | 621 | ||
551 | #endif |
622 | #endif |
552 | - | ||
553 | struct _cairo_surface_backend { |
- | |
554 | cairo_surface_type_t type; |
- | |
555 | - | ||
556 | cairo_surface_t * |
- | |
557 | (*create_similar) (void *surface, |
- | |
558 | cairo_content_t content, |
- | |
559 | int width, |
- | |
560 | int height); |
- | |
561 | - | ||
562 | cairo_warn cairo_status_t |
- | |
563 | (*finish) (void *surface); |
- | |
564 | - | ||
565 | cairo_warn cairo_status_t |
- | |
566 | (*acquire_source_image) (void *abstract_surface, |
- | |
567 | cairo_image_surface_t **image_out, |
- | |
568 | void **image_extra); |
- | |
569 | - | ||
570 | void |
- | |
571 | (*release_source_image) (void *abstract_surface, |
- | |
572 | cairo_image_surface_t *image, |
- | |
573 | void *image_extra); |
- | |
574 | - | ||
575 | cairo_warn cairo_status_t |
- | |
576 | (*acquire_dest_image) (void *abstract_surface, |
- | |
577 | cairo_rectangle_int_t *interest_rect, |
- | |
578 | cairo_image_surface_t **image_out, |
- | |
579 | cairo_rectangle_int_t *image_rect, |
- | |
580 | void **image_extra); |
- | |
581 | - | ||
582 | void |
- | |
583 | (*release_dest_image) (void *abstract_surface, |
- | |
584 | cairo_rectangle_int_t *interest_rect, |
- | |
585 | cairo_image_surface_t *image, |
- | |
586 | cairo_rectangle_int_t *image_rect, |
- | |
587 | void *image_extra); |
- | |
588 | - | ||
589 | /* Create a new surface (@clone_out) with the following |
- | |
590 | * characteristics: |
- | |
591 | * |
- | |
592 | * 1. It is as compatible as possible with @surface (in terms of |
- | |
593 | * efficiency) |
- | |
594 | * |
- | |
595 | * 2. It has the same contents as @src within the given rectangle. |
- | |
596 | * |
- | |
597 | * 3. The offset of the similar surface with respect to the original |
- | |
598 | * surface is returned in the clone_offset vector. |
- | |
599 | * - if you clone the entire surface, this vector is zero. |
- | |
600 | * - if you clone (src_x, src_y)x(w, h) the vector is (src_x, src_y); |
- | |
601 | */ |
- | |
602 | cairo_warn cairo_status_t |
- | |
603 | (*clone_similar) (void *surface, |
- | |
604 | cairo_surface_t *src, |
- | |
605 | int src_x, |
- | |
606 | int src_y, |
- | |
607 | int width, |
- | |
608 | int height, |
- | |
609 | int *clone_offset_x, |
- | |
610 | int *clone_offset_y, |
- | |
611 | cairo_surface_t **clone_out); |
- | |
612 | - | ||
613 | /* XXX remove to a separate cairo_surface_compositor_t */ |
- | |
614 | /* XXX: dst should be the first argument for consistency */ |
- | |
615 | cairo_warn cairo_int_status_t |
- | |
616 | (*composite) (cairo_operator_t op, |
- | |
617 | const cairo_pattern_t *src, |
- | |
618 | const cairo_pattern_t *mask, |
- | |
619 | void *dst, |
- | |
620 | int src_x, |
- | |
621 | int src_y, |
- | |
622 | int mask_x, |
- | |
623 | int mask_y, |
- | |
624 | int dst_x, |
- | |
625 | int dst_y, |
- | |
626 | unsigned int width, |
- | |
627 | unsigned int height, |
- | |
628 | cairo_region_t *clip_region); |
- | |
629 | - | ||
630 | cairo_warn cairo_int_status_t |
- | |
631 | (*fill_rectangles) (void *surface, |
- | |
632 | cairo_operator_t op, |
- | |
633 | const cairo_color_t *color, |
- | |
634 | cairo_rectangle_int_t *rects, |
- | |
635 | int num_rects); |
- | |
636 | - | ||
637 | /* XXX: dst should be the first argument for consistency */ |
- | |
638 | cairo_warn cairo_int_status_t |
- | |
639 | (*composite_trapezoids) (cairo_operator_t op, |
- | |
640 | const cairo_pattern_t *pattern, |
- | |
641 | void *dst, |
- | |
642 | cairo_antialias_t antialias, |
- | |
643 | int src_x, |
- | |
644 | int src_y, |
- | |
645 | int dst_x, |
- | |
646 | int dst_y, |
- | |
647 | unsigned int width, |
- | |
648 | unsigned int height, |
- | |
649 | cairo_trapezoid_t *traps, |
- | |
650 | int num_traps, |
- | |
651 | cairo_region_t *region); |
- | |
652 | - | ||
653 | cairo_warn cairo_span_renderer_t * |
- | |
654 | (*create_span_renderer) (cairo_operator_t op, |
- | |
655 | const cairo_pattern_t *pattern, |
- | |
656 | void *dst, |
- | |
657 | cairo_antialias_t antialias, |
- | |
658 | const cairo_composite_rectangles_t *rects, |
- | |
659 | cairo_region_t *clip_region); |
- | |
660 | - | ||
661 | cairo_warn cairo_bool_t |
- | |
662 | (*check_span_renderer) (cairo_operator_t op, |
- | |
663 | const cairo_pattern_t *pattern, |
- | |
664 | void *dst, |
- | |
665 | cairo_antialias_t antialias); |
- | |
666 | - | ||
667 | cairo_warn cairo_int_status_t |
- | |
668 | (*copy_page) (void *surface); |
- | |
669 | - | ||
670 | cairo_warn cairo_int_status_t |
- | |
671 | (*show_page) (void *surface); |
- | |
672 | - | ||
673 | /* Get the extents of the current surface. For many surface types |
- | |
674 | * this will be as simple as { x=0, y=0, width=surface->width, |
- | |
675 | * height=surface->height}. |
- | |
676 | * |
- | |
677 | * If this function is not implemented, or if it returns |
- | |
678 | * FALSE the surface is considered to be |
- | |
679 | * boundless and infinite bounds are used for it. |
- | |
680 | */ |
- | |
681 | cairo_warn cairo_bool_t |
- | |
682 | (*get_extents) (void *surface, |
- | |
683 | cairo_rectangle_int_t *extents); |
- | |
684 | - | ||
685 | /* |
- | |
686 | * This is an optional entry to let the surface manage its own glyph |
- | |
687 | * resources. If null, render against this surface, using image |
- | |
688 | * surfaces as glyphs. |
- | |
689 | */ |
- | |
690 | cairo_warn cairo_int_status_t |
- | |
691 | (*old_show_glyphs) (cairo_scaled_font_t *font, |
- | |
692 | cairo_operator_t op, |
- | |
693 | const cairo_pattern_t *pattern, |
- | |
694 | void *surface, |
- | |
695 | int source_x, |
- | |
696 | int source_y, |
- | |
697 | int dest_x, |
- | |
698 | int dest_y, |
- | |
699 | unsigned int width, |
- | |
700 | unsigned int height, |
- | |
701 | cairo_glyph_t *glyphs, |
- | |
702 | int num_glyphs, |
- | |
703 | cairo_region_t *clip_region); |
- | |
704 | - | ||
705 | void |
- | |
706 | (*get_font_options) (void *surface, |
- | |
707 | cairo_font_options_t *options); |
- | |
708 | - | ||
709 | cairo_warn cairo_status_t |
- | |
710 | (*flush) (void *surface); |
- | |
711 | - | ||
712 | cairo_warn cairo_status_t |
- | |
713 | (*mark_dirty_rectangle) (void *surface, |
- | |
714 | int x, |
- | |
715 | int y, |
- | |
716 | int width, |
- | |
717 | int height); |
- | |
718 | - | ||
719 | void |
- | |
720 | (*scaled_font_fini) (cairo_scaled_font_t *scaled_font); |
- | |
721 | - | ||
722 | void |
- | |
723 | (*scaled_glyph_fini) (cairo_scaled_glyph_t *scaled_glyph, |
- | |
724 | cairo_scaled_font_t *scaled_font); |
- | |
725 | - | ||
726 | /* OK, I'm starting over somewhat by defining the 5 top-level |
- | |
727 | * drawing operators for the surface backend here with consistent |
- | |
728 | * naming and argument-order conventions. */ |
- | |
729 | cairo_warn cairo_int_status_t |
- | |
730 | (*paint) (void *surface, |
- | |
731 | cairo_operator_t op, |
- | |
732 | const cairo_pattern_t *source, |
- | |
733 | cairo_clip_t *clip); |
- | |
734 | - | ||
735 | cairo_warn cairo_int_status_t |
- | |
736 | (*mask) (void *surface, |
- | |
737 | cairo_operator_t op, |
- | |
738 | const cairo_pattern_t *source, |
- | |
739 | const cairo_pattern_t *mask, |
- | |
740 | cairo_clip_t *clip); |
- | |
741 | - | ||
742 | cairo_warn cairo_int_status_t |
- | |
743 | (*stroke) (void *surface, |
- | |
744 | cairo_operator_t op, |
- | |
745 | const cairo_pattern_t *source, |
- | |
746 | cairo_path_fixed_t *path, |
- | |
747 | const cairo_stroke_style_t *style, |
- | |
748 | const cairo_matrix_t *ctm, |
- | |
749 | const cairo_matrix_t *ctm_inverse, |
- | |
750 | double tolerance, |
- | |
751 | cairo_antialias_t antialias, |
- | |
752 | cairo_clip_t *clip); |
- | |
753 | - | ||
754 | cairo_warn cairo_int_status_t |
- | |
755 | (*fill) (void *surface, |
- | |
756 | cairo_operator_t op, |
- | |
757 | const cairo_pattern_t *source, |
- | |
758 | cairo_path_fixed_t *path, |
- | |
759 | cairo_fill_rule_t fill_rule, |
- | |
760 | double tolerance, |
- | |
761 | cairo_antialias_t antialias, |
- | |
762 | cairo_clip_t *clip); |
- | |
763 | - | ||
764 | cairo_warn cairo_int_status_t |
- | |
765 | (*show_glyphs) (void *surface, |
- | |
766 | cairo_operator_t op, |
- | |
767 | const cairo_pattern_t *source, |
- | |
768 | cairo_glyph_t *glyphs, |
- | |
769 | int num_glyphs, |
- | |
770 | cairo_scaled_font_t *scaled_font, |
- | |
771 | cairo_clip_t *clip, |
- | |
772 | int *remaining_glyphs); |
- | |
773 | - | ||
774 | cairo_surface_t * |
- | |
775 | (*snapshot) (void *surface); |
- | |
776 | - | ||
777 | cairo_bool_t |
- | |
778 | (*is_similar) (void *surface_a, |
- | |
779 | void *surface_b); |
- | |
780 | - | ||
781 | cairo_warn cairo_int_status_t |
- | |
782 | (*fill_stroke) (void *surface, |
- | |
783 | cairo_operator_t fill_op, |
- | |
784 | const cairo_pattern_t *fill_source, |
- | |
785 | cairo_fill_rule_t fill_rule, |
- | |
786 | double fill_tolerance, |
- | |
787 | cairo_antialias_t fill_antialias, |
- | |
788 | cairo_path_fixed_t *path, |
- | |
789 | cairo_operator_t stroke_op, |
- | |
790 | const cairo_pattern_t *stroke_source, |
- | |
791 | const cairo_stroke_style_t *stroke_style, |
- | |
792 | const cairo_matrix_t *stroke_ctm, |
- | |
793 | const cairo_matrix_t *stroke_ctm_inverse, |
- | |
794 | double stroke_tolerance, |
- | |
795 | cairo_antialias_t stroke_antialias, |
- | |
796 | cairo_clip_t *clip); |
- | |
797 | - | ||
798 | cairo_surface_t * |
- | |
799 | (*create_solid_pattern_surface) |
- | |
800 | (void *surface, |
- | |
801 | const cairo_solid_pattern_t *solid_pattern); |
- | |
802 | - | ||
803 | cairo_bool_t |
- | |
804 | (*can_repaint_solid_pattern_surface) |
- | |
805 | (void *surface, |
- | |
806 | const cairo_solid_pattern_t *solid_pattern); |
- | |
807 | - | ||
808 | cairo_bool_t |
- | |
809 | (*has_show_text_glyphs) (void *surface); |
- | |
810 | - | ||
811 | cairo_warn cairo_int_status_t |
- | |
812 | (*show_text_glyphs) (void *surface, |
- | |
813 | cairo_operator_t op, |
- | |
814 | const cairo_pattern_t *source, |
- | |
815 | const char *utf8, |
- | |
816 | int utf8_len, |
- | |
817 | cairo_glyph_t *glyphs, |
- | |
818 | int num_glyphs, |
- | |
819 | const cairo_text_cluster_t *clusters, |
- | |
820 | int num_clusters, |
- | |
821 | cairo_text_cluster_flags_t cluster_flags, |
- | |
822 | cairo_scaled_font_t *scaled_font, |
- | |
823 | cairo_clip_t *clip); |
- | |
824 | }; |
- | |
825 | - | ||
826 | #include "cairo-surface-private.h" |
- | |
827 | - | ||
828 | struct _cairo_image_surface { |
- | |
829 | cairo_surface_t base; |
- | |
830 | - | ||
831 | pixman_format_code_t pixman_format; |
- | |
832 | cairo_format_t format; |
- | |
833 | unsigned char *data; |
- | |
834 | - | ||
835 | int width; |
- | |
836 | int height; |
- | |
837 | int stride; |
- | |
838 | int depth; |
- | |
839 | - | ||
840 | pixman_image_t *pixman_image; |
- | |
841 | - | ||
842 | unsigned owns_data : 1; |
- | |
843 | unsigned transparency : 2; |
- | |
844 | }; |
- | |
845 | - | ||
846 | extern const cairo_private cairo_surface_backend_t _cairo_image_surface_backend; |
- | |
847 | 623 | ||
848 | #define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE |
624 | #define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE |
849 | #define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD |
625 | #define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD |
850 | #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_GOOD |
626 | #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_GOOD |
851 | 627 | ||
852 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_clear; |
628 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_clear; |
853 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_black; |
629 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_black; |
854 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_white; |
630 | extern const cairo_private cairo_solid_pattern_t _cairo_pattern_white; |
855 | 631 | ||
856 | typedef struct _cairo_surface_attributes { |
632 | struct _cairo_surface_attributes { |
857 | cairo_matrix_t matrix; |
633 | cairo_matrix_t matrix; |
858 | cairo_extend_t extend; |
634 | cairo_extend_t extend; |
859 | cairo_filter_t filter; |
635 | cairo_filter_t filter; |
860 | cairo_bool_t has_component_alpha; |
636 | cairo_bool_t has_component_alpha; |
861 | int x_offset; |
637 | int x_offset; |
862 | int y_offset; |
638 | int y_offset; |
863 | void *extra; |
639 | void *extra; |
864 | } cairo_surface_attributes_t; |
- | |
865 | - | ||
866 | typedef struct _cairo_traps { |
- | |
867 | cairo_status_t status; |
- | |
868 | 640 | }; |
|
869 | const cairo_box_t *limits; |
- | |
870 | int num_limits; |
- | |
871 | - | ||
872 | unsigned int maybe_region : 1; /* hint: 0 implies that it cannot be */ |
- | |
873 | unsigned int has_intersections : 1; |
- | |
874 | unsigned int is_rectilinear : 1; |
- | |
875 | unsigned int is_rectangular : 1; |
- | |
876 | - | ||
877 | int num_traps; |
- | |
878 | int traps_size; |
- | |
879 | cairo_trapezoid_t *traps; |
- | |
880 | cairo_trapezoid_t traps_embedded[16]; |
- | |
881 | } cairo_traps_t; |
- | |
882 | 641 | ||
883 | #define CAIRO_FONT_SLANT_DEFAULT CAIRO_FONT_SLANT_NORMAL |
642 | #define CAIRO_FONT_SLANT_DEFAULT CAIRO_FONT_SLANT_NORMAL |
884 | #define CAIRO_FONT_WEIGHT_DEFAULT CAIRO_FONT_WEIGHT_NORMAL |
643 | #define CAIRO_FONT_WEIGHT_DEFAULT CAIRO_FONT_WEIGHT_NORMAL |
885 | 644 | ||
886 | #define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial" |
645 | #define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial" |
887 | #define CAIRO_QUARTZ_FONT_FAMILY_DEFAULT "Helvetica" |
646 | #define CAIRO_QUARTZ_FONT_FAMILY_DEFAULT "Helvetica" |
888 | #define CAIRO_FT_FONT_FAMILY_DEFAULT "" |
647 | #define CAIRO_FT_FONT_FAMILY_DEFAULT "" |
889 | #define CAIRO_USER_FONT_FAMILY_DEFAULT "@cairo:" |
648 | #define CAIRO_USER_FONT_FAMILY_DEFAULT "@cairo:" |
890 | 649 | ||
891 | #if CAIRO_HAS_WIN32_FONT |
650 | #if CAIRO_HAS_WIN32_FONT |
892 | 651 | ||
893 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT |
652 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT |
894 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_win32_font_face_backend |
653 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_win32_font_face_backend |
895 | 654 | ||
896 | #elif CAIRO_HAS_QUARTZ_FONT |
655 | #elif CAIRO_HAS_QUARTZ_FONT |
897 | 656 | ||
898 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_QUARTZ_FONT_FAMILY_DEFAULT |
657 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_QUARTZ_FONT_FAMILY_DEFAULT |
899 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_quartz_font_face_backend |
658 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_quartz_font_face_backend |
900 | 659 | ||
901 | #elif CAIRO_HAS_FT_FONT |
660 | #elif CAIRO_HAS_FT_FONT |
902 | 661 | ||
903 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT |
662 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT |
904 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_ft_font_face_backend |
663 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_ft_font_face_backend |
905 | 664 | ||
906 | #else |
665 | #else |
907 | 666 | ||
908 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT |
667 | #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT |
909 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_user_font_face_backend |
668 | #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_user_font_face_backend |
910 | 669 | ||
911 | #endif |
670 | #endif |
912 | 671 | ||
913 | #define CAIRO_GSTATE_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER |
672 | #define CAIRO_GSTATE_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER |
914 | #define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.1 |
673 | #define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.1 |
915 | #define CAIRO_GSTATE_FILL_RULE_DEFAULT CAIRO_FILL_RULE_WINDING |
674 | #define CAIRO_GSTATE_FILL_RULE_DEFAULT CAIRO_FILL_RULE_WINDING |
916 | #define CAIRO_GSTATE_LINE_WIDTH_DEFAULT 2.0 |
675 | #define CAIRO_GSTATE_LINE_WIDTH_DEFAULT 2.0 |
917 | #define CAIRO_GSTATE_LINE_CAP_DEFAULT CAIRO_LINE_CAP_BUTT |
676 | #define CAIRO_GSTATE_LINE_CAP_DEFAULT CAIRO_LINE_CAP_BUTT |
918 | #define CAIRO_GSTATE_LINE_JOIN_DEFAULT CAIRO_LINE_JOIN_MITER |
677 | #define CAIRO_GSTATE_LINE_JOIN_DEFAULT CAIRO_LINE_JOIN_MITER |
919 | #define CAIRO_GSTATE_MITER_LIMIT_DEFAULT 10.0 |
678 | #define CAIRO_GSTATE_MITER_LIMIT_DEFAULT 10.0 |
920 | #define CAIRO_GSTATE_DEFAULT_FONT_SIZE 10.0 |
679 | #define CAIRO_GSTATE_DEFAULT_FONT_SIZE 10.0 |
921 | 680 | ||
922 | #define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0 |
681 | #define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0 |
923 | #define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0 |
682 | #define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0 |
924 | 683 | ||
925 | typedef struct _cairo_stroke_face { |
684 | typedef struct _cairo_stroke_face { |
926 | cairo_point_t ccw; |
685 | cairo_point_t ccw; |
927 | cairo_point_t point; |
686 | cairo_point_t point; |
928 | cairo_point_t cw; |
687 | cairo_point_t cw; |
929 | cairo_slope_t dev_vector; |
688 | cairo_slope_t dev_vector; |
- | 689 | cairo_point_double_t dev_slope; |
|
930 | cairo_point_double_t usr_vector; |
690 | cairo_point_double_t usr_vector; |
- | 691 | double length; |
|
931 | } cairo_stroke_face_t; |
692 | } cairo_stroke_face_t; |
932 | 693 | ||
933 | /* cairo.c */ |
694 | /* cairo.c */ |
934 | 695 | ||
935 | static inline double cairo_const |
696 | static inline double cairo_const |
936 | _cairo_restrict_value (double value, double min, double max) |
697 | _cairo_restrict_value (double value, double min, double max) |
937 | { |
698 | { |
938 | if (value < min) |
699 | if (value < min) |
939 | return min; |
700 | return min; |
940 | else if (value > max) |
701 | else if (value > max) |
941 | return max; |
702 | return max; |
942 | else |
703 | else |
943 | return value; |
704 | return value; |
944 | } |
705 | } |
945 | 706 | ||
946 | /* C99 round() rounds to the nearest integral value with halfway cases rounded |
707 | /* C99 round() rounds to the nearest integral value with halfway cases rounded |
947 | * away from 0. _cairo_round rounds halfway cases toward negative infinity. |
708 | * away from 0. _cairo_round rounds halfway cases toward positive infinity. |
948 | * This matches the rounding behaviour of _cairo_lround. */ |
709 | * This matches the rounding behaviour of _cairo_lround. */ |
949 | static inline double cairo_const |
710 | static inline double cairo_const |
950 | _cairo_round (double r) |
711 | _cairo_round (double r) |
951 | { |
712 | { |
952 | return floor (r + .5); |
713 | return floor (r + .5); |
953 | } |
714 | } |
954 | 715 | ||
955 | #if DISABLE_SOME_FLOATING_POINT |
716 | #if DISABLE_SOME_FLOATING_POINT |
956 | cairo_private int |
717 | cairo_private int |
957 | _cairo_lround (double d) cairo_const; |
718 | _cairo_lround (double d) cairo_const; |
958 | #else |
719 | #else |
- | 720 | static inline int cairo_const |
|
- | 721 | _cairo_lround (double r) |
|
- | 722 | { |
|
959 | #define _cairo_lround lround |
723 | return _cairo_round (r); |
- | 724 | } |
|
960 | #endif |
725 | #endif |
961 | 726 | ||
962 | cairo_private uint16_t |
727 | cairo_private uint16_t |
963 | _cairo_half_from_float (float f) cairo_const; |
728 | _cairo_half_from_float (float f) cairo_const; |
964 | 729 | ||
965 | cairo_private cairo_bool_t |
730 | cairo_private cairo_bool_t |
966 | _cairo_operator_bounded_by_mask (cairo_operator_t op) cairo_const; |
731 | _cairo_operator_bounded_by_mask (cairo_operator_t op) cairo_const; |
967 | 732 | ||
968 | cairo_private cairo_bool_t |
733 | cairo_private cairo_bool_t |
969 | _cairo_operator_bounded_by_source (cairo_operator_t op) cairo_const; |
734 | _cairo_operator_bounded_by_source (cairo_operator_t op) cairo_const; |
970 | 735 | ||
971 | enum { |
736 | enum { |
972 | CAIRO_OPERATOR_BOUND_BY_MASK = 1 << 1, |
737 | CAIRO_OPERATOR_BOUND_BY_MASK = 1 << 1, |
973 | CAIRO_OPERATOR_BOUND_BY_SOURCE = 1 << 2, |
738 | CAIRO_OPERATOR_BOUND_BY_SOURCE = 1 << 2, |
974 | }; |
739 | }; |
975 | 740 | ||
976 | cairo_private uint32_t |
741 | cairo_private uint32_t |
977 | _cairo_operator_bounded_by_either (cairo_operator_t op) cairo_const; |
742 | _cairo_operator_bounded_by_either (cairo_operator_t op) cairo_const; |
978 | /* cairo-color.c */ |
743 | /* cairo-color.c */ |
979 | cairo_private const cairo_color_t * |
744 | cairo_private const cairo_color_t * |
980 | _cairo_stock_color (cairo_stock_t stock) cairo_pure; |
745 | _cairo_stock_color (cairo_stock_t stock) cairo_pure; |
981 | 746 | ||
982 | #define CAIRO_COLOR_WHITE _cairo_stock_color (CAIRO_STOCK_WHITE) |
747 | #define CAIRO_COLOR_WHITE _cairo_stock_color (CAIRO_STOCK_WHITE) |
983 | #define CAIRO_COLOR_BLACK _cairo_stock_color (CAIRO_STOCK_BLACK) |
748 | #define CAIRO_COLOR_BLACK _cairo_stock_color (CAIRO_STOCK_BLACK) |
984 | #define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT) |
749 | #define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT) |
985 | 750 | ||
986 | cairo_private uint16_t |
751 | cairo_private uint16_t |
987 | _cairo_color_double_to_short (double d) cairo_const; |
752 | _cairo_color_double_to_short (double d) cairo_const; |
988 | 753 | ||
989 | cairo_private void |
754 | cairo_private void |
990 | _cairo_color_init (cairo_color_t *color); |
- | |
991 | - | ||
992 | cairo_private void |
- | |
993 | _cairo_color_init_rgb (cairo_color_t *color, |
- | |
994 | double red, double green, double blue); |
- | |
995 | - | ||
996 | cairo_private void |
- | |
997 | _cairo_color_init_rgba (cairo_color_t *color, |
755 | _cairo_color_init_rgba (cairo_color_t *color, |
998 | double red, double green, double blue, |
756 | double red, double green, double blue, |
999 | double alpha); |
757 | double alpha); |
1000 | 758 | ||
1001 | cairo_private void |
759 | cairo_private void |
1002 | _cairo_color_multiply_alpha (cairo_color_t *color, |
760 | _cairo_color_multiply_alpha (cairo_color_t *color, |
1003 | double alpha); |
761 | double alpha); |
1004 | 762 | ||
1005 | cairo_private void |
763 | cairo_private void |
1006 | _cairo_color_get_rgba (cairo_color_t *color, |
764 | _cairo_color_get_rgba (cairo_color_t *color, |
1007 | double *red, |
765 | double *red, |
1008 | double *green, |
766 | double *green, |
1009 | double *blue, |
767 | double *blue, |
1010 | double *alpha); |
768 | double *alpha); |
1011 | 769 | ||
1012 | cairo_private void |
770 | cairo_private void |
1013 | _cairo_color_get_rgba_premultiplied (cairo_color_t *color, |
771 | _cairo_color_get_rgba_premultiplied (cairo_color_t *color, |
1014 | double *red, |
772 | double *red, |
1015 | double *green, |
773 | double *green, |
1016 | double *blue, |
774 | double *blue, |
1017 | double *alpha); |
775 | double *alpha); |
1018 | 776 | ||
1019 | cairo_private cairo_bool_t |
777 | cairo_private cairo_bool_t |
1020 | _cairo_color_equal (const cairo_color_t *color_a, |
778 | _cairo_color_equal (const cairo_color_t *color_a, |
1021 | const cairo_color_t *color_b) cairo_pure; |
779 | const cairo_color_t *color_b) cairo_pure; |
1022 | 780 | ||
1023 | cairo_private cairo_bool_t |
781 | cairo_private cairo_bool_t |
1024 | _cairo_color_stop_equal (const cairo_color_stop_t *color_a, |
782 | _cairo_color_stop_equal (const cairo_color_stop_t *color_a, |
1025 | const cairo_color_stop_t *color_b) cairo_pure; |
783 | const cairo_color_stop_t *color_b) cairo_pure; |
1026 | 784 | ||
1027 | cairo_private cairo_content_t |
785 | cairo_private cairo_content_t |
1028 | _cairo_color_get_content (const cairo_color_t *color) cairo_pure; |
786 | _cairo_color_get_content (const cairo_color_t *color) cairo_pure; |
1029 | 787 | ||
1030 | /* cairo-font-face.c */ |
788 | /* cairo-font-face.c */ |
1031 | 789 | ||
1032 | extern const cairo_private cairo_font_face_t _cairo_font_face_nil; |
790 | extern const cairo_private cairo_font_face_t _cairo_font_face_nil; |
1033 | 791 | ||
1034 | cairo_private void |
792 | cairo_private void |
1035 | _cairo_font_face_init (cairo_font_face_t *font_face, |
793 | _cairo_font_face_init (cairo_font_face_t *font_face, |
1036 | const cairo_font_face_backend_t *backend); |
794 | const cairo_font_face_backend_t *backend); |
1037 | 795 | ||
1038 | cairo_private cairo_status_t |
796 | cairo_private cairo_status_t |
1039 | _cairo_font_face_set_error (cairo_font_face_t *font_face, |
797 | _cairo_font_face_set_error (cairo_font_face_t *font_face, |
1040 | cairo_status_t status); |
798 | cairo_status_t status); |
1041 | 799 | ||
1042 | cairo_private void |
800 | cairo_private void |
1043 | _cairo_unscaled_font_init (cairo_unscaled_font_t *font, |
801 | _cairo_unscaled_font_init (cairo_unscaled_font_t *font, |
1044 | const cairo_unscaled_font_backend_t *backend); |
802 | const cairo_unscaled_font_backend_t *backend); |
1045 | 803 | ||
1046 | cairo_private_no_warn cairo_unscaled_font_t * |
804 | cairo_private_no_warn cairo_unscaled_font_t * |
1047 | _cairo_unscaled_font_reference (cairo_unscaled_font_t *font); |
805 | _cairo_unscaled_font_reference (cairo_unscaled_font_t *font); |
1048 | 806 | ||
1049 | cairo_private void |
807 | cairo_private void |
1050 | _cairo_unscaled_font_destroy (cairo_unscaled_font_t *font); |
808 | _cairo_unscaled_font_destroy (cairo_unscaled_font_t *font); |
1051 | 809 | ||
1052 | /* cairo-font-face-twin.c */ |
810 | /* cairo-font-face-twin.c */ |
1053 | 811 | ||
1054 | cairo_private cairo_font_face_t * |
812 | cairo_private cairo_font_face_t * |
1055 | _cairo_font_face_twin_create_fallback (void); |
813 | _cairo_font_face_twin_create_fallback (void); |
1056 | 814 | ||
1057 | cairo_private cairo_status_t |
815 | cairo_private cairo_status_t |
1058 | _cairo_font_face_twin_create_for_toy (cairo_toy_font_face_t *toy_face, |
816 | _cairo_font_face_twin_create_for_toy (cairo_toy_font_face_t *toy_face, |
1059 | cairo_font_face_t **font_face); |
817 | cairo_font_face_t **font_face); |
1060 | 818 | ||
1061 | /* cairo-font-face-twin-data.c */ |
819 | /* cairo-font-face-twin-data.c */ |
1062 | 820 | ||
1063 | extern const cairo_private int8_t _cairo_twin_outlines[]; |
821 | extern const cairo_private int8_t _cairo_twin_outlines[]; |
1064 | extern const cairo_private uint16_t _cairo_twin_charmap[128]; |
822 | extern const cairo_private uint16_t _cairo_twin_charmap[128]; |
1065 | 823 | ||
1066 | /* cairo-font-options.c */ |
824 | /* cairo-font-options.c */ |
1067 | 825 | ||
1068 | cairo_private void |
826 | cairo_private void |
1069 | _cairo_font_options_init_default (cairo_font_options_t *options); |
827 | _cairo_font_options_init_default (cairo_font_options_t *options); |
1070 | 828 | ||
1071 | cairo_private void |
829 | cairo_private void |
1072 | _cairo_font_options_init_copy (cairo_font_options_t *options, |
830 | _cairo_font_options_init_copy (cairo_font_options_t *options, |
1073 | const cairo_font_options_t *other); |
831 | const cairo_font_options_t *other); |
1074 | 832 | ||
1075 | cairo_private void |
833 | cairo_private void |
1076 | _cairo_font_options_set_lcd_filter (cairo_font_options_t *options, |
834 | _cairo_font_options_set_lcd_filter (cairo_font_options_t *options, |
1077 | cairo_lcd_filter_t lcd_filter); |
835 | cairo_lcd_filter_t lcd_filter); |
1078 | 836 | ||
1079 | cairo_private cairo_lcd_filter_t |
837 | cairo_private cairo_lcd_filter_t |
1080 | _cairo_font_options_get_lcd_filter (const cairo_font_options_t *options); |
838 | _cairo_font_options_get_lcd_filter (const cairo_font_options_t *options); |
- | 839 | ||
- | 840 | cairo_private void |
|
- | 841 | _cairo_font_options_set_round_glyph_positions (cairo_font_options_t *options, |
|
- | 842 | cairo_round_glyph_positions_t round); |
|
- | 843 | ||
- | 844 | cairo_private cairo_round_glyph_positions_t |
|
- | 845 | _cairo_font_options_get_round_glyph_positions (const cairo_font_options_t *options); |
|
1081 | 846 | ||
1082 | /* cairo-hull.c */ |
847 | /* cairo-hull.c */ |
1083 | cairo_private cairo_status_t |
848 | cairo_private cairo_status_t |
1084 | _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices); |
849 | _cairo_hull_compute (cairo_pen_vertex_t *vertices, int *num_vertices); |
1085 | 850 | ||
1086 | /* cairo-lzw.c */ |
851 | /* cairo-lzw.c */ |
1087 | cairo_private unsigned char * |
852 | cairo_private unsigned char * |
1088 | _cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out); |
853 | _cairo_lzw_compress (unsigned char *data, unsigned long *size_in_out); |
1089 | 854 | ||
1090 | /* cairo-misc.c */ |
855 | /* cairo-misc.c */ |
1091 | cairo_private cairo_status_t |
856 | cairo_private cairo_status_t |
1092 | _cairo_validate_text_clusters (const char *utf8, |
857 | _cairo_validate_text_clusters (const char *utf8, |
1093 | int utf8_len, |
858 | int utf8_len, |
1094 | const cairo_glyph_t *glyphs, |
859 | const cairo_glyph_t *glyphs, |
1095 | int num_glyphs, |
860 | int num_glyphs, |
1096 | const cairo_text_cluster_t *clusters, |
861 | const cairo_text_cluster_t *clusters, |
1097 | int num_clusters, |
862 | int num_clusters, |
1098 | cairo_text_cluster_flags_t cluster_flags); |
863 | cairo_text_cluster_flags_t cluster_flags); |
1099 | 864 | ||
1100 | cairo_private cairo_status_t |
865 | cairo_private cairo_status_t |
1101 | _cairo_intern_string (const char **str_inout, int len); |
866 | _cairo_intern_string (const char **str_inout, int len); |
1102 | 867 | ||
1103 | cairo_private void |
868 | cairo_private void |
1104 | _cairo_intern_string_reset_static_data (void); |
869 | _cairo_intern_string_reset_static_data (void); |
1105 | 870 | ||
1106 | /* cairo-path-fixed.c */ |
871 | /* cairo-path-fixed.c */ |
1107 | cairo_private cairo_path_fixed_t * |
872 | cairo_private cairo_path_fixed_t * |
1108 | _cairo_path_fixed_create (void); |
873 | _cairo_path_fixed_create (void); |
1109 | 874 | ||
1110 | cairo_private void |
875 | cairo_private void |
1111 | _cairo_path_fixed_init (cairo_path_fixed_t *path); |
876 | _cairo_path_fixed_init (cairo_path_fixed_t *path); |
1112 | 877 | ||
1113 | cairo_private cairo_status_t |
878 | cairo_private cairo_status_t |
1114 | _cairo_path_fixed_init_copy (cairo_path_fixed_t *path, |
879 | _cairo_path_fixed_init_copy (cairo_path_fixed_t *path, |
1115 | const cairo_path_fixed_t *other); |
880 | const cairo_path_fixed_t *other); |
1116 | - | ||
1117 | cairo_private cairo_bool_t |
- | |
1118 | _cairo_path_fixed_is_equal (const cairo_path_fixed_t *path, |
- | |
1119 | const cairo_path_fixed_t *other); |
- | |
1120 | 881 | ||
1121 | cairo_private void |
882 | cairo_private void |
1122 | _cairo_path_fixed_fini (cairo_path_fixed_t *path); |
883 | _cairo_path_fixed_fini (cairo_path_fixed_t *path); |
1123 | 884 | ||
1124 | cairo_private void |
885 | cairo_private void |
1125 | _cairo_path_fixed_destroy (cairo_path_fixed_t *path); |
886 | _cairo_path_fixed_destroy (cairo_path_fixed_t *path); |
1126 | 887 | ||
1127 | cairo_private cairo_status_t |
888 | cairo_private cairo_status_t |
1128 | _cairo_path_fixed_move_to (cairo_path_fixed_t *path, |
889 | _cairo_path_fixed_move_to (cairo_path_fixed_t *path, |
1129 | cairo_fixed_t x, |
890 | cairo_fixed_t x, |
1130 | cairo_fixed_t y); |
891 | cairo_fixed_t y); |
1131 | 892 | ||
1132 | cairo_private void |
893 | cairo_private void |
1133 | _cairo_path_fixed_new_sub_path (cairo_path_fixed_t *path); |
894 | _cairo_path_fixed_new_sub_path (cairo_path_fixed_t *path); |
1134 | 895 | ||
1135 | cairo_private cairo_status_t |
896 | cairo_private cairo_status_t |
1136 | _cairo_path_fixed_rel_move_to (cairo_path_fixed_t *path, |
897 | _cairo_path_fixed_rel_move_to (cairo_path_fixed_t *path, |
1137 | cairo_fixed_t dx, |
898 | cairo_fixed_t dx, |
1138 | cairo_fixed_t dy); |
899 | cairo_fixed_t dy); |
1139 | 900 | ||
1140 | cairo_private cairo_status_t |
901 | cairo_private cairo_status_t |
1141 | _cairo_path_fixed_line_to (cairo_path_fixed_t *path, |
902 | _cairo_path_fixed_line_to (cairo_path_fixed_t *path, |
1142 | cairo_fixed_t x, |
903 | cairo_fixed_t x, |
1143 | cairo_fixed_t y); |
904 | cairo_fixed_t y); |
1144 | 905 | ||
1145 | cairo_private cairo_status_t |
906 | cairo_private cairo_status_t |
1146 | _cairo_path_fixed_rel_line_to (cairo_path_fixed_t *path, |
907 | _cairo_path_fixed_rel_line_to (cairo_path_fixed_t *path, |
1147 | cairo_fixed_t dx, |
908 | cairo_fixed_t dx, |
1148 | cairo_fixed_t dy); |
909 | cairo_fixed_t dy); |
1149 | 910 | ||
1150 | cairo_private cairo_status_t |
911 | cairo_private cairo_status_t |
1151 | _cairo_path_fixed_curve_to (cairo_path_fixed_t *path, |
912 | _cairo_path_fixed_curve_to (cairo_path_fixed_t *path, |
1152 | cairo_fixed_t x0, cairo_fixed_t y0, |
913 | cairo_fixed_t x0, cairo_fixed_t y0, |
1153 | cairo_fixed_t x1, cairo_fixed_t y1, |
914 | cairo_fixed_t x1, cairo_fixed_t y1, |
1154 | cairo_fixed_t x2, cairo_fixed_t y2); |
915 | cairo_fixed_t x2, cairo_fixed_t y2); |
1155 | 916 | ||
1156 | cairo_private cairo_status_t |
917 | cairo_private cairo_status_t |
1157 | _cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path, |
918 | _cairo_path_fixed_rel_curve_to (cairo_path_fixed_t *path, |
1158 | cairo_fixed_t dx0, cairo_fixed_t dy0, |
919 | cairo_fixed_t dx0, cairo_fixed_t dy0, |
1159 | cairo_fixed_t dx1, cairo_fixed_t dy1, |
920 | cairo_fixed_t dx1, cairo_fixed_t dy1, |
1160 | cairo_fixed_t dx2, cairo_fixed_t dy2); |
921 | cairo_fixed_t dx2, cairo_fixed_t dy2); |
1161 | 922 | ||
1162 | cairo_private cairo_status_t |
923 | cairo_private cairo_status_t |
1163 | _cairo_path_fixed_close_path (cairo_path_fixed_t *path); |
924 | _cairo_path_fixed_close_path (cairo_path_fixed_t *path); |
1164 | 925 | ||
1165 | cairo_private cairo_bool_t |
926 | cairo_private cairo_bool_t |
1166 | _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path, |
927 | _cairo_path_fixed_get_current_point (cairo_path_fixed_t *path, |
1167 | cairo_fixed_t *x, |
928 | cairo_fixed_t *x, |
1168 | cairo_fixed_t *y); |
929 | cairo_fixed_t *y); |
1169 | 930 | ||
1170 | typedef cairo_status_t |
931 | typedef cairo_status_t |
1171 | (cairo_path_fixed_move_to_func_t) (void *closure, |
932 | (cairo_path_fixed_move_to_func_t) (void *closure, |
1172 | const cairo_point_t *point); |
933 | const cairo_point_t *point); |
1173 | 934 | ||
1174 | typedef cairo_status_t |
935 | typedef cairo_status_t |
1175 | (cairo_path_fixed_line_to_func_t) (void *closure, |
936 | (cairo_path_fixed_line_to_func_t) (void *closure, |
1176 | const cairo_point_t *point); |
937 | const cairo_point_t *point); |
1177 | 938 | ||
1178 | typedef cairo_status_t |
939 | typedef cairo_status_t |
1179 | (cairo_path_fixed_curve_to_func_t) (void *closure, |
940 | (cairo_path_fixed_curve_to_func_t) (void *closure, |
1180 | const cairo_point_t *p0, |
941 | const cairo_point_t *p0, |
1181 | const cairo_point_t *p1, |
942 | const cairo_point_t *p1, |
1182 | const cairo_point_t *p2); |
943 | const cairo_point_t *p2); |
1183 | 944 | ||
1184 | typedef cairo_status_t |
945 | typedef cairo_status_t |
1185 | (cairo_path_fixed_close_path_func_t) (void *closure); |
946 | (cairo_path_fixed_close_path_func_t) (void *closure); |
1186 | 947 | ||
1187 | cairo_private cairo_status_t |
948 | cairo_private cairo_status_t |
1188 | _cairo_path_fixed_interpret (const cairo_path_fixed_t *path, |
949 | _cairo_path_fixed_interpret (const cairo_path_fixed_t *path, |
1189 | cairo_direction_t dir, |
- | |
1190 | cairo_path_fixed_move_to_func_t *move_to, |
950 | cairo_path_fixed_move_to_func_t *move_to, |
1191 | cairo_path_fixed_line_to_func_t *line_to, |
951 | cairo_path_fixed_line_to_func_t *line_to, |
1192 | cairo_path_fixed_curve_to_func_t *curve_to, |
952 | cairo_path_fixed_curve_to_func_t *curve_to, |
1193 | cairo_path_fixed_close_path_func_t *close_path, |
953 | cairo_path_fixed_close_path_func_t *close_path, |
1194 | void *closure); |
954 | void *closure); |
1195 | 955 | ||
1196 | cairo_private cairo_status_t |
956 | cairo_private cairo_status_t |
1197 | _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path, |
957 | _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t *path, |
1198 | cairo_direction_t dir, |
- | |
1199 | cairo_path_fixed_move_to_func_t *move_to, |
958 | cairo_path_fixed_move_to_func_t *move_to, |
1200 | cairo_path_fixed_line_to_func_t *line_to, |
959 | cairo_path_fixed_line_to_func_t *line_to, |
1201 | cairo_path_fixed_close_path_func_t *close_path, |
960 | cairo_path_fixed_close_path_func_t *close_path, |
1202 | void *closure, |
961 | void *closure, |
1203 | double tolerance); |
962 | double tolerance); |
- | 963 | ||
- | 964 | ||
- | 965 | cairo_private cairo_bool_t |
|
- | 966 | _cairo_path_bounder_extents (const cairo_path_fixed_t *path, |
|
- | 967 | cairo_box_t *box); |
|
1204 | 968 | ||
1205 | cairo_private cairo_bool_t |
969 | cairo_private cairo_bool_t |
1206 | _cairo_path_fixed_extents (const cairo_path_fixed_t *path, |
970 | _cairo_path_fixed_extents (const cairo_path_fixed_t *path, |
1207 | cairo_box_t *box); |
971 | cairo_box_t *box); |
1208 | 972 | ||
1209 | cairo_private void |
973 | cairo_private void |
1210 | _cairo_path_fixed_approximate_clip_extents (const cairo_path_fixed_t *path, |
974 | _cairo_path_fixed_approximate_clip_extents (const cairo_path_fixed_t *path, |
1211 | cairo_rectangle_int_t *extents); |
975 | cairo_rectangle_int_t *extents); |
1212 | 976 | ||
1213 | cairo_private void |
977 | cairo_private void |
1214 | _cairo_path_fixed_approximate_fill_extents (const cairo_path_fixed_t *path, |
978 | _cairo_path_fixed_approximate_fill_extents (const cairo_path_fixed_t *path, |
1215 | cairo_rectangle_int_t *extents); |
979 | cairo_rectangle_int_t *extents); |
1216 | 980 | ||
1217 | cairo_private void |
981 | cairo_private void |
1218 | _cairo_path_fixed_fill_extents (const cairo_path_fixed_t *path, |
982 | _cairo_path_fixed_fill_extents (const cairo_path_fixed_t *path, |
1219 | cairo_fill_rule_t fill_rule, |
983 | cairo_fill_rule_t fill_rule, |
1220 | double tolerance, |
984 | double tolerance, |
1221 | cairo_rectangle_int_t *extents); |
985 | cairo_rectangle_int_t *extents); |
1222 | 986 | ||
1223 | cairo_private void |
987 | cairo_private void |
1224 | _cairo_path_fixed_approximate_stroke_extents (const cairo_path_fixed_t *path, |
988 | _cairo_path_fixed_approximate_stroke_extents (const cairo_path_fixed_t *path, |
1225 | const cairo_stroke_style_t *style, |
989 | const cairo_stroke_style_t *style, |
1226 | const cairo_matrix_t *ctm, |
990 | const cairo_matrix_t *ctm, |
1227 | cairo_rectangle_int_t *extents); |
991 | cairo_rectangle_int_t *extents); |
1228 | 992 | ||
1229 | cairo_private cairo_status_t |
993 | cairo_private cairo_status_t |
1230 | _cairo_path_fixed_stroke_extents (const cairo_path_fixed_t *path, |
994 | _cairo_path_fixed_stroke_extents (const cairo_path_fixed_t *path, |
1231 | const cairo_stroke_style_t *style, |
995 | const cairo_stroke_style_t *style, |
1232 | const cairo_matrix_t *ctm, |
996 | const cairo_matrix_t *ctm, |
1233 | const cairo_matrix_t *ctm_inverse, |
997 | const cairo_matrix_t *ctm_inverse, |
1234 | double tolerance, |
998 | double tolerance, |
1235 | cairo_rectangle_int_t *extents); |
999 | cairo_rectangle_int_t *extents); |
1236 | 1000 | ||
1237 | cairo_private void |
1001 | cairo_private void |
1238 | _cairo_path_fixed_transform (cairo_path_fixed_t *path, |
1002 | _cairo_path_fixed_transform (cairo_path_fixed_t *path, |
1239 | const cairo_matrix_t *matrix); |
1003 | const cairo_matrix_t *matrix); |
1240 | 1004 | ||
1241 | cairo_private cairo_bool_t |
1005 | cairo_private cairo_bool_t |
1242 | _cairo_path_fixed_is_box (const cairo_path_fixed_t *path, |
1006 | _cairo_path_fixed_is_box (const cairo_path_fixed_t *path, |
1243 | cairo_box_t *box); |
1007 | cairo_box_t *box); |
1244 | 1008 | ||
1245 | cairo_private cairo_bool_t |
1009 | cairo_private cairo_bool_t |
1246 | _cairo_path_fixed_is_rectangle (const cairo_path_fixed_t *path, |
1010 | _cairo_path_fixed_is_rectangle (const cairo_path_fixed_t *path, |
1247 | cairo_box_t *box); |
1011 | cairo_box_t *box); |
1248 | 1012 | ||
1249 | /* cairo-path-in-fill.c */ |
1013 | /* cairo-path-in-fill.c */ |
1250 | cairo_private cairo_bool_t |
1014 | cairo_private cairo_bool_t |
1251 | _cairo_path_fixed_in_fill (const cairo_path_fixed_t *path, |
1015 | _cairo_path_fixed_in_fill (const cairo_path_fixed_t *path, |
1252 | cairo_fill_rule_t fill_rule, |
1016 | cairo_fill_rule_t fill_rule, |
1253 | double tolerance, |
1017 | double tolerance, |
1254 | double x, |
1018 | double x, |
1255 | double y); |
1019 | double y); |
1256 | 1020 | ||
1257 | /* cairo-path-fill.c */ |
1021 | /* cairo-path-fill.c */ |
1258 | cairo_private cairo_status_t |
1022 | cairo_private cairo_status_t |
1259 | _cairo_path_fixed_fill_to_polygon (const cairo_path_fixed_t *path, |
1023 | _cairo_path_fixed_fill_to_polygon (const cairo_path_fixed_t *path, |
1260 | double tolerance, |
1024 | double tolerance, |
1261 | cairo_polygon_t *polygon); |
1025 | cairo_polygon_t *polygon); |
1262 | 1026 | ||
1263 | cairo_private cairo_int_status_t |
1027 | cairo_private cairo_status_t |
1264 | _cairo_path_fixed_fill_rectilinear_to_traps (const cairo_path_fixed_t *path, |
1028 | _cairo_path_fixed_fill_rectilinear_to_polygon (const cairo_path_fixed_t *path, |
1265 | cairo_fill_rule_t fill_rule, |
1029 | cairo_antialias_t antialias, |
1266 | cairo_traps_t *traps); |
1030 | cairo_polygon_t *polygon); |
1267 | 1031 | ||
1268 | cairo_private cairo_status_t |
1032 | cairo_private cairo_status_t |
1269 | _cairo_path_fixed_fill_rectilinear_to_boxes (const cairo_path_fixed_t *path, |
1033 | _cairo_path_fixed_fill_rectilinear_to_boxes (const cairo_path_fixed_t *path, |
1270 | cairo_fill_rule_t fill_rule, |
1034 | cairo_fill_rule_t fill_rule, |
- | 1035 | cairo_antialias_t antialias, |
|
1271 | cairo_boxes_t *boxes); |
1036 | cairo_boxes_t *boxes); |
1272 | 1037 | ||
1273 | cairo_private cairo_region_t * |
1038 | cairo_private cairo_region_t * |
1274 | _cairo_path_fixed_fill_rectilinear_to_region (const cairo_path_fixed_t *path, |
1039 | _cairo_path_fixed_fill_rectilinear_to_region (const cairo_path_fixed_t *path, |
1275 | cairo_fill_rule_t fill_rule, |
1040 | cairo_fill_rule_t fill_rule, |
1276 | const cairo_rectangle_int_t *extents); |
1041 | const cairo_rectangle_int_t *extents); |
1277 | 1042 | ||
1278 | cairo_private cairo_status_t |
1043 | cairo_private cairo_status_t |
1279 | _cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t *path, |
1044 | _cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t *path, |
1280 | cairo_fill_rule_t fill_rule, |
1045 | cairo_fill_rule_t fill_rule, |
1281 | double tolerance, |
1046 | double tolerance, |
1282 | cairo_traps_t *traps); |
1047 | cairo_traps_t *traps); |
1283 | 1048 | ||
1284 | /* cairo-path-stroke.c */ |
1049 | /* cairo-path-stroke.c */ |
1285 | cairo_private cairo_status_t |
1050 | cairo_private cairo_status_t |
1286 | _cairo_path_fixed_stroke_to_polygon (const cairo_path_fixed_t *path, |
1051 | _cairo_path_fixed_stroke_to_polygon (const cairo_path_fixed_t *path, |
1287 | const cairo_stroke_style_t *stroke_style, |
1052 | const cairo_stroke_style_t *stroke_style, |
1288 | const cairo_matrix_t *ctm, |
1053 | const cairo_matrix_t *ctm, |
1289 | const cairo_matrix_t *ctm_inverse, |
1054 | const cairo_matrix_t *ctm_inverse, |
1290 | double tolerance, |
1055 | double tolerance, |
1291 | cairo_polygon_t *polygon); |
1056 | cairo_polygon_t *polygon); |
1292 | 1057 | ||
1293 | cairo_private cairo_int_status_t |
1058 | cairo_private cairo_int_status_t |
1294 | _cairo_path_fixed_stroke_rectilinear_to_traps (const cairo_path_fixed_t *path, |
1059 | _cairo_path_fixed_stroke_to_tristrip (const cairo_path_fixed_t *path, |
1295 | const cairo_stroke_style_t *stroke_style, |
1060 | const cairo_stroke_style_t*style, |
1296 | const cairo_matrix_t *ctm, |
1061 | const cairo_matrix_t *ctm, |
- | 1062 | const cairo_matrix_t *ctm_inverse, |
|
- | 1063 | double tolerance, |
|
1297 | cairo_traps_t *traps); |
1064 | cairo_tristrip_t *strip); |
- | 1065 | ||
- | 1066 | cairo_private cairo_status_t |
|
- | 1067 | _cairo_path_fixed_stroke_dashed_to_polygon (const cairo_path_fixed_t *path, |
|
- | 1068 | const cairo_stroke_style_t *stroke_style, |
|
- | 1069 | const cairo_matrix_t *ctm, |
|
- | 1070 | const cairo_matrix_t *ctm_inverse, |
|
- | 1071 | double tolerance, |
|
- | 1072 | cairo_polygon_t *polygon); |
|
1298 | 1073 | ||
1299 | cairo_private cairo_int_status_t |
1074 | cairo_private cairo_int_status_t |
1300 | _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path, |
1075 | _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t *path, |
1301 | const cairo_stroke_style_t *stroke_style, |
1076 | const cairo_stroke_style_t *stroke_style, |
1302 | const cairo_matrix_t *ctm, |
1077 | const cairo_matrix_t *ctm, |
- | 1078 | cairo_antialias_t antialias, |
|
1303 | cairo_boxes_t *boxes); |
1079 | cairo_boxes_t *boxes); |
1304 | 1080 | ||
1305 | cairo_private cairo_status_t |
1081 | cairo_private cairo_int_status_t |
1306 | _cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path, |
1082 | _cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t *path, |
1307 | const cairo_stroke_style_t *stroke_style, |
1083 | const cairo_stroke_style_t *stroke_style, |
1308 | const cairo_matrix_t *ctm, |
1084 | const cairo_matrix_t *ctm, |
1309 | const cairo_matrix_t *ctm_inverse, |
1085 | const cairo_matrix_t *ctm_inverse, |
1310 | double tolerance, |
1086 | double tolerance, |
1311 | cairo_traps_t *traps); |
1087 | cairo_traps_t *traps); |
- | 1088 | ||
- | 1089 | cairo_private cairo_int_status_t |
|
- | 1090 | _cairo_path_fixed_stroke_polygon_to_traps (const cairo_path_fixed_t *path, |
|
- | 1091 | const cairo_stroke_style_t *stroke_style, |
|
- | 1092 | const cairo_matrix_t *ctm, |
|
- | 1093 | const cairo_matrix_t *ctm_inverse, |
|
- | 1094 | double tolerance, |
|
- | 1095 | cairo_traps_t *traps); |
|
1312 | 1096 | ||
1313 | cairo_private cairo_status_t |
1097 | cairo_private cairo_status_t |
1314 | _cairo_path_fixed_stroke_to_shaper (cairo_path_fixed_t *path, |
1098 | _cairo_path_fixed_stroke_to_shaper (cairo_path_fixed_t *path, |
1315 | const cairo_stroke_style_t *stroke_style, |
1099 | const cairo_stroke_style_t *stroke_style, |
1316 | const cairo_matrix_t *ctm, |
1100 | const cairo_matrix_t *ctm, |
1317 | const cairo_matrix_t *ctm_inverse, |
1101 | const cairo_matrix_t *ctm_inverse, |
1318 | double tolerance, |
1102 | double tolerance, |
1319 | cairo_status_t (*add_triangle) (void *closure, |
1103 | cairo_status_t (*add_triangle) (void *closure, |
1320 | const cairo_point_t triangle[3]), |
1104 | const cairo_point_t triangle[3]), |
1321 | cairo_status_t (*add_triangle_fan) (void *closure, |
1105 | cairo_status_t (*add_triangle_fan) (void *closure, |
1322 | const cairo_point_t *midpt, |
1106 | const cairo_point_t *midpt, |
1323 | const cairo_point_t *points, |
1107 | const cairo_point_t *points, |
1324 | int npoints), |
1108 | int npoints), |
1325 | cairo_status_t (*add_quad) (void *closure, |
1109 | cairo_status_t (*add_quad) (void *closure, |
1326 | const cairo_point_t quad[4]), |
1110 | const cairo_point_t quad[4]), |
1327 | void *closure); |
1111 | void *closure); |
1328 | 1112 | ||
1329 | /* cairo-scaled-font.c */ |
1113 | /* cairo-scaled-font.c */ |
1330 | 1114 | ||
1331 | cairo_private void |
1115 | cairo_private void |
1332 | _cairo_scaled_font_freeze_cache (cairo_scaled_font_t *scaled_font); |
1116 | _cairo_scaled_font_freeze_cache (cairo_scaled_font_t *scaled_font); |
1333 | 1117 | ||
1334 | cairo_private void |
1118 | cairo_private void |
1335 | _cairo_scaled_font_thaw_cache (cairo_scaled_font_t *scaled_font); |
1119 | _cairo_scaled_font_thaw_cache (cairo_scaled_font_t *scaled_font); |
1336 | 1120 | ||
1337 | cairo_private void |
1121 | cairo_private void |
1338 | _cairo_scaled_font_reset_cache (cairo_scaled_font_t *scaled_font); |
1122 | _cairo_scaled_font_reset_cache (cairo_scaled_font_t *scaled_font); |
1339 | 1123 | ||
1340 | cairo_private cairo_status_t |
1124 | cairo_private cairo_status_t |
1341 | _cairo_scaled_font_set_error (cairo_scaled_font_t *scaled_font, |
1125 | _cairo_scaled_font_set_error (cairo_scaled_font_t *scaled_font, |
1342 | cairo_status_t status); |
1126 | cairo_status_t status); |
1343 | 1127 | ||
1344 | cairo_private cairo_scaled_font_t * |
1128 | cairo_private cairo_scaled_font_t * |
1345 | _cairo_scaled_font_create_in_error (cairo_status_t status); |
1129 | _cairo_scaled_font_create_in_error (cairo_status_t status); |
1346 | 1130 | ||
1347 | cairo_private void |
1131 | cairo_private void |
1348 | _cairo_scaled_font_reset_static_data (void); |
1132 | _cairo_scaled_font_reset_static_data (void); |
1349 | 1133 | ||
1350 | cairo_private cairo_status_t |
1134 | cairo_private cairo_status_t |
1351 | _cairo_scaled_font_register_placeholder_and_unlock_font_map (cairo_scaled_font_t *scaled_font); |
1135 | _cairo_scaled_font_register_placeholder_and_unlock_font_map (cairo_scaled_font_t *scaled_font); |
1352 | 1136 | ||
1353 | cairo_private void |
1137 | cairo_private void |
1354 | _cairo_scaled_font_unregister_placeholder_and_lock_font_map (cairo_scaled_font_t *scaled_font); |
1138 | _cairo_scaled_font_unregister_placeholder_and_lock_font_map (cairo_scaled_font_t *scaled_font); |
1355 | 1139 | ||
1356 | cairo_private cairo_status_t |
1140 | cairo_private cairo_status_t |
1357 | _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font, |
1141 | _cairo_scaled_font_init (cairo_scaled_font_t *scaled_font, |
1358 | cairo_font_face_t *font_face, |
1142 | cairo_font_face_t *font_face, |
1359 | const cairo_matrix_t *font_matrix, |
1143 | const cairo_matrix_t *font_matrix, |
1360 | const cairo_matrix_t *ctm, |
1144 | const cairo_matrix_t *ctm, |
1361 | const cairo_font_options_t *options, |
1145 | const cairo_font_options_t *options, |
1362 | const cairo_scaled_font_backend_t *backend); |
1146 | const cairo_scaled_font_backend_t *backend); |
1363 | 1147 | ||
1364 | cairo_private cairo_status_t |
1148 | cairo_private cairo_status_t |
1365 | _cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font, |
1149 | _cairo_scaled_font_set_metrics (cairo_scaled_font_t *scaled_font, |
1366 | cairo_font_extents_t *fs_metrics); |
1150 | cairo_font_extents_t *fs_metrics); |
1367 | 1151 | ||
1368 | /* This should only be called on an error path by a scaled_font constructor */ |
1152 | /* This should only be called on an error path by a scaled_font constructor */ |
1369 | cairo_private void |
1153 | cairo_private void |
1370 | _cairo_scaled_font_fini (cairo_scaled_font_t *scaled_font); |
1154 | _cairo_scaled_font_fini (cairo_scaled_font_t *scaled_font); |
1371 | 1155 | ||
1372 | cairo_private cairo_status_t |
1156 | cairo_private cairo_status_t |
1373 | _cairo_scaled_font_font_extents (cairo_scaled_font_t *scaled_font, |
1157 | _cairo_scaled_font_font_extents (cairo_scaled_font_t *scaled_font, |
1374 | cairo_font_extents_t *extents); |
1158 | cairo_font_extents_t *extents); |
1375 | 1159 | ||
1376 | cairo_private cairo_status_t |
1160 | cairo_private cairo_status_t |
1377 | _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font, |
1161 | _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t *scaled_font, |
1378 | const cairo_glyph_t *glyphs, |
1162 | const cairo_glyph_t *glyphs, |
1379 | int num_glyphs, |
1163 | int num_glyphs, |
1380 | cairo_rectangle_int_t *extents, |
1164 | cairo_rectangle_int_t *extents, |
1381 | cairo_bool_t *overlap); |
1165 | cairo_bool_t *overlap); |
1382 | 1166 | ||
1383 | cairo_private void |
1167 | cairo_private cairo_bool_t |
1384 | _cairo_scaled_font_glyph_approximate_extents (cairo_scaled_font_t *scaled_font, |
1168 | _cairo_scaled_font_glyph_approximate_extents (cairo_scaled_font_t *scaled_font, |
1385 | const cairo_glyph_t *glyphs, |
1169 | const cairo_glyph_t *glyphs, |
1386 | int num_glyphs, |
1170 | int num_glyphs, |
1387 | cairo_rectangle_int_t *extents); |
1171 | cairo_rectangle_int_t *extents); |
1388 | 1172 | ||
1389 | cairo_private cairo_status_t |
1173 | cairo_private cairo_status_t |
1390 | _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font, |
1174 | _cairo_scaled_font_show_glyphs (cairo_scaled_font_t *scaled_font, |
1391 | cairo_operator_t op, |
1175 | cairo_operator_t op, |
1392 | const cairo_pattern_t *source, |
1176 | const cairo_pattern_t *source, |
1393 | cairo_surface_t *surface, |
1177 | cairo_surface_t *surface, |
1394 | int source_x, |
1178 | int source_x, |
1395 | int source_y, |
1179 | int source_y, |
1396 | int dest_x, |
1180 | int dest_x, |
1397 | int dest_y, |
1181 | int dest_y, |
1398 | unsigned int width, |
1182 | unsigned int width, |
1399 | unsigned int height, |
1183 | unsigned int height, |
1400 | cairo_glyph_t *glyphs, |
1184 | cairo_glyph_t *glyphs, |
1401 | int num_glyphs, |
1185 | int num_glyphs, |
1402 | cairo_region_t *clip_region); |
1186 | cairo_region_t *clip_region); |
1403 | 1187 | ||
1404 | cairo_private cairo_status_t |
1188 | cairo_private cairo_status_t |
1405 | _cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font, |
1189 | _cairo_scaled_font_glyph_path (cairo_scaled_font_t *scaled_font, |
1406 | const cairo_glyph_t *glyphs, |
1190 | const cairo_glyph_t *glyphs, |
1407 | int num_glyphs, |
1191 | int num_glyphs, |
1408 | cairo_path_fixed_t *path); |
1192 | cairo_path_fixed_t *path); |
1409 | 1193 | ||
1410 | cairo_private void |
1194 | cairo_private void |
1411 | _cairo_scaled_glyph_set_metrics (cairo_scaled_glyph_t *scaled_glyph, |
1195 | _cairo_scaled_glyph_set_metrics (cairo_scaled_glyph_t *scaled_glyph, |
1412 | cairo_scaled_font_t *scaled_font, |
1196 | cairo_scaled_font_t *scaled_font, |
1413 | cairo_text_extents_t *fs_metrics); |
1197 | cairo_text_extents_t *fs_metrics); |
1414 | 1198 | ||
1415 | cairo_private void |
1199 | cairo_private void |
1416 | _cairo_scaled_glyph_set_surface (cairo_scaled_glyph_t *scaled_glyph, |
1200 | _cairo_scaled_glyph_set_surface (cairo_scaled_glyph_t *scaled_glyph, |
1417 | cairo_scaled_font_t *scaled_font, |
1201 | cairo_scaled_font_t *scaled_font, |
1418 | cairo_image_surface_t *surface); |
1202 | cairo_image_surface_t *surface); |
1419 | 1203 | ||
1420 | cairo_private void |
1204 | cairo_private void |
1421 | _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph, |
1205 | _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t *scaled_glyph, |
1422 | cairo_scaled_font_t *scaled_font, |
1206 | cairo_scaled_font_t *scaled_font, |
1423 | cairo_path_fixed_t *path); |
1207 | cairo_path_fixed_t *path); |
1424 | 1208 | ||
1425 | cairo_private void |
1209 | cairo_private void |
1426 | _cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph, |
1210 | _cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t *scaled_glyph, |
1427 | cairo_scaled_font_t *scaled_font, |
1211 | cairo_scaled_font_t *scaled_font, |
1428 | cairo_surface_t *recording_surface); |
1212 | cairo_surface_t *recording_surface); |
1429 | 1213 | ||
1430 | cairo_private cairo_int_status_t |
1214 | cairo_private cairo_int_status_t |
1431 | _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font, |
1215 | _cairo_scaled_glyph_lookup (cairo_scaled_font_t *scaled_font, |
1432 | unsigned long index, |
1216 | unsigned long index, |
1433 | cairo_scaled_glyph_info_t info, |
1217 | cairo_scaled_glyph_info_t info, |
1434 | cairo_scaled_glyph_t **scaled_glyph_ret); |
1218 | cairo_scaled_glyph_t **scaled_glyph_ret); |
1435 | 1219 | ||
1436 | cairo_private double |
1220 | cairo_private double |
1437 | _cairo_scaled_font_get_max_scale (cairo_scaled_font_t *scaled_font); |
1221 | _cairo_scaled_font_get_max_scale (cairo_scaled_font_t *scaled_font); |
1438 | 1222 | ||
1439 | cairo_private void |
1223 | cairo_private void |
1440 | _cairo_scaled_font_map_destroy (void); |
1224 | _cairo_scaled_font_map_destroy (void); |
1441 | 1225 | ||
1442 | /* cairo-stroke-style.c */ |
1226 | /* cairo-stroke-style.c */ |
1443 | 1227 | ||
1444 | cairo_private void |
1228 | cairo_private void |
1445 | _cairo_stroke_style_init (cairo_stroke_style_t *style); |
1229 | _cairo_stroke_style_init (cairo_stroke_style_t *style); |
1446 | 1230 | ||
1447 | cairo_private cairo_status_t |
1231 | cairo_private cairo_status_t |
1448 | _cairo_stroke_style_init_copy (cairo_stroke_style_t *style, |
1232 | _cairo_stroke_style_init_copy (cairo_stroke_style_t *style, |
1449 | const cairo_stroke_style_t *other); |
1233 | const cairo_stroke_style_t *other); |
1450 | 1234 | ||
1451 | cairo_private void |
1235 | cairo_private void |
1452 | _cairo_stroke_style_fini (cairo_stroke_style_t *style); |
1236 | _cairo_stroke_style_fini (cairo_stroke_style_t *style); |
1453 | 1237 | ||
1454 | cairo_private void |
1238 | cairo_private void |
1455 | _cairo_stroke_style_max_distance_from_path (const cairo_stroke_style_t *style, |
1239 | _cairo_stroke_style_max_distance_from_path (const cairo_stroke_style_t *style, |
- | 1240 | const cairo_path_fixed_t *path, |
|
1456 | const cairo_matrix_t *ctm, |
1241 | const cairo_matrix_t *ctm, |
1457 | double *dx, double *dy); |
1242 | double *dx, double *dy); |
- | 1243 | cairo_private void |
|
- | 1244 | _cairo_stroke_style_max_line_distance_from_path (const cairo_stroke_style_t *style, |
|
- | 1245 | const cairo_path_fixed_t *path, |
|
- | 1246 | const cairo_matrix_t *ctm, |
|
- | 1247 | double *dx, double *dy); |
|
- | 1248 | ||
- | 1249 | cairo_private void |
|
- | 1250 | _cairo_stroke_style_max_join_distance_from_path (const cairo_stroke_style_t *style, |
|
- | 1251 | const cairo_path_fixed_t *path, |
|
- | 1252 | const cairo_matrix_t *ctm, |
|
- | 1253 | double *dx, double *dy); |
|
1458 | 1254 | ||
1459 | cairo_private double |
1255 | cairo_private double |
1460 | _cairo_stroke_style_dash_period (const cairo_stroke_style_t *style); |
1256 | _cairo_stroke_style_dash_period (const cairo_stroke_style_t *style); |
1461 | 1257 | ||
1462 | cairo_private double |
1258 | cairo_private double |
1463 | _cairo_stroke_style_dash_stroked (const cairo_stroke_style_t *style); |
1259 | _cairo_stroke_style_dash_stroked (const cairo_stroke_style_t *style); |
1464 | 1260 | ||
1465 | cairo_private cairo_bool_t |
1261 | cairo_private cairo_bool_t |
1466 | _cairo_stroke_style_dash_can_approximate (const cairo_stroke_style_t *style, |
1262 | _cairo_stroke_style_dash_can_approximate (const cairo_stroke_style_t *style, |
1467 | const cairo_matrix_t *ctm, |
1263 | const cairo_matrix_t *ctm, |
1468 | double tolerance); |
1264 | double tolerance); |
1469 | 1265 | ||
1470 | cairo_private void |
1266 | cairo_private void |
1471 | _cairo_stroke_style_dash_approximate (const cairo_stroke_style_t *style, |
1267 | _cairo_stroke_style_dash_approximate (const cairo_stroke_style_t *style, |
1472 | const cairo_matrix_t *ctm, |
1268 | const cairo_matrix_t *ctm, |
1473 | double tolerance, |
1269 | double tolerance, |
1474 | double *dash_offset, |
1270 | double *dash_offset, |
1475 | double *dashes, |
1271 | double *dashes, |
1476 | unsigned int *num_dashes); |
1272 | unsigned int *num_dashes); |
1477 | 1273 | ||
1478 | 1274 | ||
1479 | /* cairo-surface.c */ |
1275 | /* cairo-surface.c */ |
1480 | - | ||
1481 | cairo_private cairo_surface_t * |
- | |
1482 | _cairo_surface_create_in_error (cairo_status_t status); |
- | |
1483 | 1276 | ||
1484 | cairo_private cairo_status_t |
1277 | cairo_private cairo_status_t |
1485 | _cairo_surface_copy_mime_data (cairo_surface_t *dst, |
1278 | _cairo_surface_copy_mime_data (cairo_surface_t *dst, |
1486 | cairo_surface_t *src); |
1279 | cairo_surface_t *src); |
1487 | 1280 | ||
1488 | cairo_private cairo_status_t |
1281 | cairo_private_no_warn cairo_int_status_t |
1489 | _cairo_surface_set_error (cairo_surface_t *surface, |
1282 | _cairo_surface_set_error (cairo_surface_t *surface, |
1490 | cairo_status_t status); |
1283 | cairo_int_status_t status); |
1491 | 1284 | ||
1492 | cairo_private void |
1285 | cairo_private void |
1493 | _cairo_surface_set_resolution (cairo_surface_t *surface, |
1286 | _cairo_surface_set_resolution (cairo_surface_t *surface, |
1494 | double x_res, |
1287 | double x_res, |
1495 | double y_res); |
1288 | double y_res); |
1496 | 1289 | ||
1497 | cairo_private cairo_surface_t * |
1290 | cairo_private cairo_surface_t * |
1498 | _cairo_surface_create_similar_scratch (cairo_surface_t *other, |
1291 | _cairo_surface_create_similar_scratch (cairo_surface_t *other, |
1499 | cairo_content_t content, |
1292 | cairo_content_t content, |
1500 | int width, |
1293 | int width, |
1501 | int height); |
1294 | int height); |
1502 | 1295 | ||
1503 | cairo_private cairo_surface_t * |
1296 | cairo_private cairo_surface_t * |
- | 1297 | _cairo_surface_create_for_rectangle_int (cairo_surface_t *target, |
|
- | 1298 | const cairo_rectangle_int_t *extents); |
|
- | 1299 | ||
- | 1300 | cairo_private cairo_surface_t * |
|
1504 | _cairo_surface_create_similar_solid (cairo_surface_t *other, |
1301 | _cairo_surface_create_similar_solid (cairo_surface_t *other, |
1505 | cairo_content_t content, |
1302 | cairo_content_t content, |
1506 | int width, |
1303 | int width, |
1507 | int height, |
1304 | int height, |
1508 | const cairo_color_t *color, |
1305 | const cairo_color_t *color); |
1509 | cairo_bool_t allow_fallback); |
- | |
1510 | - | ||
1511 | cairo_private cairo_surface_t * |
- | |
1512 | _cairo_surface_create_solid_pattern_surface (cairo_surface_t *other, |
- | |
1513 | const cairo_solid_pattern_t *solid_pattern); |
- | |
1514 | - | ||
1515 | cairo_private cairo_int_status_t |
- | |
1516 | _cairo_surface_repaint_solid_pattern_surface (cairo_surface_t *other, |
- | |
1517 | cairo_surface_t *solid_surface, |
- | |
1518 | const cairo_solid_pattern_t *solid_pattern); |
- | |
1519 | 1306 | ||
1520 | cairo_private void |
1307 | cairo_private void |
1521 | _cairo_surface_init (cairo_surface_t *surface, |
1308 | _cairo_surface_init (cairo_surface_t *surface, |
1522 | const cairo_surface_backend_t *backend, |
1309 | const cairo_surface_backend_t *backend, |
1523 | cairo_device_t *device, |
1310 | cairo_device_t *device, |
1524 | cairo_content_t content); |
1311 | cairo_content_t content); |
1525 | 1312 | ||
1526 | cairo_private void |
1313 | cairo_private void |
1527 | _cairo_surface_set_font_options (cairo_surface_t *surface, |
1314 | _cairo_surface_set_font_options (cairo_surface_t *surface, |
1528 | cairo_font_options_t *options); |
1315 | cairo_font_options_t *options); |
1529 | 1316 | ||
1530 | cairo_private cairo_status_t |
1317 | cairo_private cairo_status_t |
1531 | _cairo_surface_composite (cairo_operator_t op, |
- | |
1532 | const cairo_pattern_t *src, |
- | |
1533 | const cairo_pattern_t *mask, |
- | |
1534 | cairo_surface_t *dst, |
- | |
1535 | int src_x, |
- | |
1536 | int src_y, |
- | |
1537 | int mask_x, |
- | |
1538 | int mask_y, |
- | |
1539 | int dst_x, |
- | |
1540 | int dst_y, |
- | |
1541 | unsigned int width, |
- | |
1542 | unsigned int height, |
- | |
1543 | cairo_region_t *clip_region); |
- | |
1544 | - | ||
1545 | cairo_private cairo_status_t |
- | |
1546 | _cairo_surface_fill_rectangle (cairo_surface_t *surface, |
- | |
1547 | cairo_operator_t op, |
- | |
1548 | const cairo_color_t *color, |
- | |
1549 | int x, |
- | |
1550 | int y, |
- | |
1551 | int width, |
- | |
1552 | int height); |
- | |
1553 | - | ||
1554 | cairo_private cairo_status_t |
- | |
1555 | _cairo_surface_fill_region (cairo_surface_t *surface, |
- | |
1556 | cairo_operator_t op, |
- | |
1557 | const cairo_color_t *color, |
- | |
1558 | cairo_region_t *region); |
- | |
1559 | - | ||
1560 | cairo_private cairo_status_t |
- | |
1561 | _cairo_surface_fill_rectangles (cairo_surface_t *surface, |
- | |
1562 | cairo_operator_t op, |
- | |
1563 | const cairo_color_t *color, |
- | |
1564 | cairo_rectangle_int_t *rects, |
- | |
1565 | int num_rects); |
- | |
1566 | - | ||
1567 | cairo_private cairo_status_t |
- | |
1568 | _cairo_surface_paint (cairo_surface_t *surface, |
1318 | _cairo_surface_paint (cairo_surface_t *surface, |
1569 | cairo_operator_t op, |
1319 | cairo_operator_t op, |
1570 | const cairo_pattern_t *source, |
1320 | const cairo_pattern_t *source, |
1571 | cairo_clip_t *clip); |
1321 | const cairo_clip_t *clip); |
- | 1322 | ||
- | 1323 | cairo_private cairo_image_surface_t * |
|
- | 1324 | _cairo_surface_map_to_image (cairo_surface_t *surface, |
|
- | 1325 | const cairo_rectangle_int_t *extents); |
|
- | 1326 | ||
- | 1327 | cairo_private cairo_int_status_t |
|
- | 1328 | _cairo_surface_unmap_image (cairo_surface_t *surface, |
|
- | 1329 | cairo_image_surface_t *image); |
|
1572 | 1330 | ||
1573 | cairo_private cairo_status_t |
1331 | cairo_private cairo_status_t |
1574 | _cairo_surface_mask (cairo_surface_t *surface, |
1332 | _cairo_surface_mask (cairo_surface_t *surface, |
1575 | cairo_operator_t op, |
1333 | cairo_operator_t op, |
1576 | const cairo_pattern_t *source, |
1334 | const cairo_pattern_t *source, |
1577 | const cairo_pattern_t *mask, |
1335 | const cairo_pattern_t *mask, |
1578 | cairo_clip_t *clip); |
1336 | const cairo_clip_t *clip); |
1579 | 1337 | ||
1580 | cairo_private cairo_status_t |
1338 | cairo_private cairo_status_t |
1581 | _cairo_surface_fill_stroke (cairo_surface_t *surface, |
1339 | _cairo_surface_fill_stroke (cairo_surface_t *surface, |
1582 | cairo_operator_t fill_op, |
1340 | cairo_operator_t fill_op, |
1583 | const cairo_pattern_t *fill_source, |
1341 | const cairo_pattern_t *fill_source, |
1584 | cairo_fill_rule_t fill_rule, |
1342 | cairo_fill_rule_t fill_rule, |
1585 | double fill_tolerance, |
1343 | double fill_tolerance, |
1586 | cairo_antialias_t fill_antialias, |
1344 | cairo_antialias_t fill_antialias, |
1587 | cairo_path_fixed_t *path, |
1345 | cairo_path_fixed_t *path, |
1588 | cairo_operator_t stroke_op, |
1346 | cairo_operator_t stroke_op, |
1589 | const cairo_pattern_t *stroke_source, |
1347 | const cairo_pattern_t *stroke_source, |
1590 | const cairo_stroke_style_t *stroke_style, |
1348 | const cairo_stroke_style_t *stroke_style, |
1591 | const cairo_matrix_t *stroke_ctm, |
1349 | const cairo_matrix_t *stroke_ctm, |
1592 | const cairo_matrix_t *stroke_ctm_inverse, |
1350 | const cairo_matrix_t *stroke_ctm_inverse, |
1593 | double stroke_tolerance, |
1351 | double stroke_tolerance, |
1594 | cairo_antialias_t stroke_antialias, |
1352 | cairo_antialias_t stroke_antialias, |
1595 | cairo_clip_t *clip); |
1353 | const cairo_clip_t *clip); |
1596 | 1354 | ||
1597 | cairo_private cairo_status_t |
1355 | cairo_private cairo_status_t |
1598 | _cairo_surface_stroke (cairo_surface_t *surface, |
1356 | _cairo_surface_stroke (cairo_surface_t *surface, |
1599 | cairo_operator_t op, |
1357 | cairo_operator_t op, |
1600 | const cairo_pattern_t *source, |
1358 | const cairo_pattern_t *source, |
1601 | cairo_path_fixed_t *path, |
1359 | const cairo_path_fixed_t *path, |
1602 | const cairo_stroke_style_t *style, |
1360 | const cairo_stroke_style_t *style, |
1603 | const cairo_matrix_t *ctm, |
1361 | const cairo_matrix_t *ctm, |
1604 | const cairo_matrix_t *ctm_inverse, |
1362 | const cairo_matrix_t *ctm_inverse, |
1605 | double tolerance, |
1363 | double tolerance, |
1606 | cairo_antialias_t antialias, |
1364 | cairo_antialias_t antialias, |
1607 | cairo_clip_t *clip); |
1365 | const cairo_clip_t *clip); |
1608 | 1366 | ||
1609 | cairo_private cairo_status_t |
1367 | cairo_private cairo_status_t |
1610 | _cairo_surface_fill (cairo_surface_t *surface, |
1368 | _cairo_surface_fill (cairo_surface_t *surface, |
1611 | cairo_operator_t op, |
1369 | cairo_operator_t op, |
1612 | const cairo_pattern_t *source, |
1370 | const cairo_pattern_t *source, |
1613 | cairo_path_fixed_t *path, |
1371 | const cairo_path_fixed_t *path, |
1614 | cairo_fill_rule_t fill_rule, |
1372 | cairo_fill_rule_t fill_rule, |
1615 | double tolerance, |
1373 | double tolerance, |
1616 | cairo_antialias_t antialias, |
1374 | cairo_antialias_t antialias, |
1617 | cairo_clip_t *clip); |
1375 | const cairo_clip_t *clip); |
1618 | 1376 | ||
1619 | cairo_private cairo_status_t |
1377 | cairo_private cairo_status_t |
1620 | _cairo_surface_show_text_glyphs (cairo_surface_t *surface, |
1378 | _cairo_surface_show_text_glyphs (cairo_surface_t *surface, |
1621 | cairo_operator_t op, |
1379 | cairo_operator_t op, |
1622 | const cairo_pattern_t *source, |
1380 | const cairo_pattern_t *source, |
1623 | const char *utf8, |
1381 | const char *utf8, |
1624 | int utf8_len, |
1382 | int utf8_len, |
1625 | cairo_glyph_t *glyphs, |
1383 | cairo_glyph_t *glyphs, |
1626 | int num_glyphs, |
1384 | int num_glyphs, |
1627 | const cairo_text_cluster_t *clusters, |
1385 | const cairo_text_cluster_t *clusters, |
1628 | int num_clusters, |
1386 | int num_clusters, |
1629 | cairo_text_cluster_flags_t cluster_flags, |
1387 | cairo_text_cluster_flags_t cluster_flags, |
1630 | cairo_scaled_font_t *scaled_font, |
1388 | cairo_scaled_font_t *scaled_font, |
1631 | cairo_clip_t *clip); |
1389 | const cairo_clip_t *clip); |
1632 | - | ||
1633 | cairo_private cairo_status_t |
- | |
1634 | _cairo_surface_paint_extents (cairo_surface_t *surface, |
- | |
1635 | cairo_operator_t op, |
- | |
1636 | const cairo_pattern_t *source, |
- | |
1637 | cairo_clip_t *clip, |
- | |
1638 | cairo_rectangle_int_t *extents); |
- | |
1639 | - | ||
1640 | cairo_private cairo_status_t |
- | |
1641 | _cairo_surface_mask_extents (cairo_surface_t *surface, |
- | |
1642 | cairo_operator_t op, |
- | |
1643 | const cairo_pattern_t *source, |
- | |
1644 | const cairo_pattern_t *mask, |
- | |
1645 | cairo_clip_t *clip, |
- | |
1646 | cairo_rectangle_int_t *extents); |
- | |
1647 | - | ||
1648 | cairo_private cairo_status_t |
- | |
1649 | _cairo_surface_stroke_extents (cairo_surface_t *surface, |
- | |
1650 | cairo_operator_t op, |
- | |
1651 | const cairo_pattern_t *source, |
- | |
1652 | cairo_path_fixed_t *path, |
- | |
1653 | const cairo_stroke_style_t *style, |
- | |
1654 | const cairo_matrix_t *ctm, |
- | |
1655 | const cairo_matrix_t *ctm_inverse, |
- | |
1656 | double tolerance, |
- | |
1657 | cairo_antialias_t antialias, |
- | |
1658 | cairo_clip_t *clip, |
- | |
1659 | cairo_rectangle_int_t *extents); |
- | |
1660 | - | ||
1661 | cairo_private cairo_status_t |
- | |
1662 | _cairo_surface_fill_extents (cairo_surface_t *surface, |
- | |
1663 | cairo_operator_t op, |
- | |
1664 | const cairo_pattern_t *source, |
- | |
1665 | cairo_path_fixed_t *path, |
- | |
1666 | cairo_fill_rule_t fill_rule, |
- | |
1667 | double tolerance, |
- | |
1668 | cairo_antialias_t antialias, |
- | |
1669 | cairo_clip_t *clip, |
- | |
1670 | cairo_rectangle_int_t *extents); |
- | |
1671 | - | ||
1672 | cairo_private cairo_status_t |
- | |
1673 | _cairo_surface_glyphs_extents (cairo_surface_t *surface, |
- | |
1674 | cairo_operator_t op, |
- | |
1675 | const cairo_pattern_t *source, |
- | |
1676 | cairo_glyph_t *glyphs, |
- | |
1677 | int num_glyphs, |
- | |
1678 | cairo_scaled_font_t *scaled_font, |
- | |
1679 | cairo_clip_t *clip, |
- | |
1680 | cairo_rectangle_int_t *extents); |
- | |
1681 | - | ||
1682 | cairo_private cairo_status_t |
- | |
1683 | _cairo_surface_composite_trapezoids (cairo_operator_t op, |
- | |
1684 | const cairo_pattern_t *pattern, |
- | |
1685 | cairo_surface_t *dst, |
- | |
1686 | cairo_antialias_t antialias, |
- | |
1687 | int src_x, |
- | |
1688 | int src_y, |
- | |
1689 | int dst_x, |
- | |
1690 | int dst_y, |
- | |
1691 | unsigned int width, |
- | |
1692 | unsigned int height, |
- | |
1693 | cairo_trapezoid_t *traps, |
- | |
1694 | int ntraps, |
- | |
1695 | cairo_region_t *clip_region); |
- | |
1696 | - | ||
1697 | cairo_private cairo_span_renderer_t * |
- | |
1698 | _cairo_surface_create_span_renderer (cairo_operator_t op, |
- | |
1699 | const cairo_pattern_t *pattern, |
- | |
1700 | cairo_surface_t *dst, |
- | |
1701 | cairo_antialias_t antialias, |
- | |
1702 | const cairo_composite_rectangles_t *rects, |
- | |
1703 | cairo_region_t *clip_region); |
- | |
1704 | - | ||
1705 | cairo_private cairo_bool_t |
- | |
1706 | _cairo_surface_check_span_renderer (cairo_operator_t op, |
- | |
1707 | const cairo_pattern_t *pattern, |
- | |
1708 | cairo_surface_t *dst, |
- | |
1709 | cairo_antialias_t antialias); |
- | |
1710 | 1390 | ||
1711 | cairo_private cairo_status_t |
1391 | cairo_private cairo_status_t |
1712 | _cairo_surface_acquire_source_image (cairo_surface_t *surface, |
1392 | _cairo_surface_acquire_source_image (cairo_surface_t *surface, |
1713 | cairo_image_surface_t **image_out, |
1393 | cairo_image_surface_t **image_out, |
1714 | void **image_extra); |
1394 | void **image_extra); |
1715 | 1395 | ||
1716 | cairo_private void |
1396 | cairo_private void |
1717 | _cairo_surface_release_source_image (cairo_surface_t *surface, |
1397 | _cairo_surface_release_source_image (cairo_surface_t *surface, |
1718 | cairo_image_surface_t *image, |
1398 | cairo_image_surface_t *image, |
1719 | void *image_extra); |
1399 | void *image_extra); |
1720 | - | ||
1721 | cairo_private cairo_status_t |
- | |
1722 | _cairo_surface_acquire_dest_image (cairo_surface_t *surface, |
- | |
1723 | cairo_rectangle_int_t *interest_rect, |
- | |
1724 | cairo_image_surface_t **image_out, |
- | |
1725 | cairo_rectangle_int_t *image_rect, |
- | |
1726 | void **image_extra); |
- | |
1727 | - | ||
1728 | cairo_private void |
- | |
1729 | _cairo_surface_release_dest_image (cairo_surface_t *surface, |
- | |
1730 | cairo_rectangle_int_t *interest_rect, |
- | |
1731 | cairo_image_surface_t *image, |
- | |
1732 | cairo_rectangle_int_t *image_rect, |
- | |
1733 | void *image_extra); |
- | |
1734 | - | ||
1735 | cairo_private cairo_status_t |
- | |
1736 | _cairo_surface_clone_similar (cairo_surface_t *surface, |
- | |
1737 | cairo_surface_t *src, |
- | |
1738 | int src_x, |
- | |
1739 | int src_y, |
- | |
1740 | int width, |
- | |
1741 | int height, |
- | |
1742 | int *clone_offset_x, |
- | |
1743 | int *clone_offset_y, |
- | |
1744 | cairo_surface_t **clone_out); |
- | |
1745 | 1400 | ||
1746 | cairo_private cairo_surface_t * |
1401 | cairo_private cairo_surface_t * |
1747 | _cairo_surface_snapshot (cairo_surface_t *surface); |
1402 | _cairo_surface_snapshot (cairo_surface_t *surface); |
1748 | 1403 | ||
1749 | cairo_private void |
1404 | cairo_private void |
1750 | _cairo_surface_attach_snapshot (cairo_surface_t *surface, |
1405 | _cairo_surface_attach_snapshot (cairo_surface_t *surface, |
1751 | cairo_surface_t *snapshot, |
1406 | cairo_surface_t *snapshot, |
1752 | cairo_surface_func_t detach_func); |
1407 | cairo_surface_func_t detach_func); |
1753 | 1408 | ||
1754 | cairo_private cairo_surface_t * |
1409 | cairo_private cairo_surface_t * |
1755 | _cairo_surface_has_snapshot (cairo_surface_t *surface, |
1410 | _cairo_surface_has_snapshot (cairo_surface_t *surface, |
1756 | const cairo_surface_backend_t *backend); |
1411 | const cairo_surface_backend_t *backend); |
1757 | 1412 | ||
1758 | cairo_private void |
1413 | cairo_private void |
1759 | _cairo_surface_detach_snapshot (cairo_surface_t *snapshot); |
1414 | _cairo_surface_detach_snapshot (cairo_surface_t *snapshot); |
1760 | 1415 | ||
1761 | cairo_private cairo_bool_t |
1416 | cairo_private cairo_status_t |
1762 | _cairo_surface_is_similar (cairo_surface_t *surface_a, |
- | |
1763 | cairo_surface_t *surface_b); |
1417 | _cairo_surface_begin_modification (cairo_surface_t *surface); |
1764 | 1418 | ||
1765 | cairo_private cairo_bool_t |
1419 | cairo_private_no_warn cairo_bool_t |
1766 | _cairo_surface_get_extents (cairo_surface_t *surface, |
1420 | _cairo_surface_get_extents (cairo_surface_t *surface, |
1767 | cairo_rectangle_int_t *extents); |
1421 | cairo_rectangle_int_t *extents); |
1768 | - | ||
1769 | cairo_private cairo_status_t |
- | |
1770 | _cairo_surface_old_show_glyphs (cairo_scaled_font_t *scaled_font, |
- | |
1771 | cairo_operator_t op, |
- | |
1772 | const cairo_pattern_t *pattern, |
- | |
1773 | cairo_surface_t *surface, |
- | |
1774 | int source_x, |
- | |
1775 | int source_y, |
- | |
1776 | int dest_x, |
- | |
1777 | int dest_y, |
- | |
1778 | unsigned int width, |
- | |
1779 | unsigned int height, |
- | |
1780 | cairo_glyph_t *glyphs, |
- | |
1781 | int num_glyphs, |
- | |
1782 | cairo_region_t *clip_region); |
- | |
1783 | - | ||
1784 | cairo_private cairo_status_t |
- | |
1785 | _cairo_surface_composite_fixup_unbounded (cairo_surface_t *dst, |
- | |
1786 | cairo_surface_attributes_t *src_attr, |
- | |
1787 | int src_width, |
- | |
1788 | int src_height, |
- | |
1789 | cairo_surface_attributes_t *mask_attr, |
- | |
1790 | int mask_width, |
- | |
1791 | int mask_height, |
- | |
1792 | int src_x, |
- | |
1793 | int src_y, |
- | |
1794 | int mask_x, |
- | |
1795 | int mask_y, |
- | |
1796 | int dst_x, |
- | |
1797 | int dst_y, |
- | |
1798 | unsigned int width, |
- | |
1799 | unsigned int height, |
- | |
1800 | cairo_region_t *clip_region); |
- | |
1801 | - | ||
1802 | cairo_private cairo_status_t |
- | |
1803 | _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst, |
- | |
1804 | cairo_surface_attributes_t *src_attr, |
- | |
1805 | int src_width, |
- | |
1806 | int src_height, |
- | |
1807 | int mask_width, |
- | |
1808 | int mask_height, |
- | |
1809 | int src_x, |
- | |
1810 | int src_y, |
- | |
1811 | int mask_x, |
- | |
1812 | int mask_y, |
- | |
1813 | int dst_x, |
- | |
1814 | int dst_y, |
- | |
1815 | unsigned int width, |
- | |
1816 | unsigned int height, |
- | |
1817 | cairo_region_t *clip_region); |
- | |
1818 | - | ||
1819 | cairo_private cairo_bool_t |
- | |
1820 | _cairo_surface_is_opaque (const cairo_surface_t *surface); |
- | |
1821 | 1422 | ||
1822 | cairo_private void |
1423 | cairo_private void |
1823 | _cairo_surface_set_device_scale (cairo_surface_t *surface, |
1424 | _cairo_surface_set_device_scale (cairo_surface_t *surface, |
1824 | double sx, |
1425 | double sx, |
1825 | double sy); |
1426 | double sy); |
1826 | 1427 | ||
1827 | cairo_private cairo_bool_t |
1428 | cairo_private cairo_bool_t |
1828 | _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure; |
1429 | _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure; |
1829 | 1430 | ||
1830 | cairo_private void |
1431 | cairo_private void |
1831 | _cairo_surface_release_device_reference (cairo_surface_t *surface); |
1432 | _cairo_surface_release_device_reference (cairo_surface_t *surface); |
1832 | 1433 | ||
1833 | /* cairo-image-surface.c */ |
1434 | /* cairo-image-surface.c */ |
1834 | 1435 | ||
1835 | /* XXX: In cairo 1.2.0 we added a new %CAIRO_FORMAT_RGB16_565 but |
1436 | /* XXX: In cairo 1.2.0 we added a new %CAIRO_FORMAT_RGB16_565 but |
1836 | * neglected to adjust this macro. The net effect is that it's |
1437 | * neglected to adjust this macro. The net effect is that it's |
1837 | * impossible to externally create an image surface with this |
1438 | * impossible to externally create an image surface with this |
1838 | * format. This is perhaps a good thing since we also neglected to fix |
1439 | * format. This is perhaps a good thing since we also neglected to fix |
1839 | * up things like cairo_surface_write_to_png() for the new format |
1440 | * up things like cairo_surface_write_to_png() for the new format |
1840 | * (-Wswitch-enum will tell you where). Is it obvious that format was |
1441 | * (-Wswitch-enum will tell you where). Is it obvious that format was |
1841 | * added in haste? |
1442 | * added in haste? |
1842 | * |
1443 | * |
1843 | * The reason for the new format was to allow the xlib backend to be |
1444 | * The reason for the new format was to allow the xlib backend to be |
1844 | * used on X servers with a 565 visual. So the new format did its job |
1445 | * used on X servers with a 565 visual. So the new format did its job |
1845 | * for that, even without being considered "valid" for the sake of |
1446 | * for that, even without being considered "valid" for the sake of |
1846 | * things like cairo_image_surface_create(). |
1447 | * things like cairo_image_surface_create(). |
1847 | * |
1448 | * |
1848 | * Since 1.2.0 we ran into the same situtation with X servers with BGR |
1449 | * Since 1.2.0 we ran into the same situtation with X servers with BGR |
1849 | * visuals. This time we invented #cairo_internal_format_t instead, |
1450 | * visuals. This time we invented #cairo_internal_format_t instead, |
1850 | * (see it for more discussion). |
1451 | * (see it for more discussion). |
1851 | * |
1452 | * |
1852 | * The punchline is that %CAIRO_FORMAT_VALID must not conside any |
1453 | * The punchline is that %CAIRO_FORMAT_VALID must not conside any |
1853 | * internal format to be valid. Also we need to decide if the |
1454 | * internal format to be valid. Also we need to decide if the |
1854 | * RGB16_565 should be moved to instead be an internal format. If so, |
1455 | * RGB16_565 should be moved to instead be an internal format. If so, |
1855 | * this macro need not change for it. (We probably will need to leave |
1456 | * this macro need not change for it. (We probably will need to leave |
1856 | * an RGB16_565 value in the header files for the sake of code that |
1457 | * an RGB16_565 value in the header files for the sake of code that |
1857 | * might have that value in it.) |
1458 | * might have that value in it.) |
1858 | * |
1459 | * |
1859 | * If we do decide to start fully supporting RGB16_565 as an external |
1460 | * If we do decide to start fully supporting RGB16_565 as an external |
1860 | * format, then %CAIRO_FORMAT_VALID needs to be adjusted to include |
1461 | * format, then %CAIRO_FORMAT_VALID needs to be adjusted to include |
1861 | * it. But that should not happen before all necessary code is fixed |
1462 | * it. But that should not happen before all necessary code is fixed |
1862 | * to support it (at least cairo_surface_write_to_png() and a few spots |
1463 | * to support it (at least cairo_surface_write_to_png() and a few spots |
1863 | * in cairo-xlib-surface.c--again see -Wswitch-enum). |
1464 | * in cairo-xlib-surface.c--again see -Wswitch-enum). |
1864 | */ |
1465 | */ |
1865 | #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ |
1466 | #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \ |
1866 | (format) <= CAIRO_FORMAT_RGB16_565) |
1467 | (format) <= CAIRO_FORMAT_RGB30) |
1867 | 1468 | ||
1868 | /* pixman-required stride alignment in bytes. */ |
1469 | /* pixman-required stride alignment in bytes. */ |
1869 | #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t)) |
1470 | #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t)) |
1870 | #define CAIRO_STRIDE_FOR_WIDTH_BPP(w,bpp) \ |
1471 | #define CAIRO_STRIDE_FOR_WIDTH_BPP(w,bpp) \ |
1871 | ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT) |
1472 | ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT) |
1872 | 1473 | ||
1873 | #define CAIRO_CONTENT_VALID(content) ((content) && \ |
1474 | #define CAIRO_CONTENT_VALID(content) ((content) && \ |
1874 | (((content) & ~(CAIRO_CONTENT_COLOR | \ |
1475 | (((content) & ~(CAIRO_CONTENT_COLOR | \ |
1875 | CAIRO_CONTENT_ALPHA | \ |
1476 | CAIRO_CONTENT_ALPHA | \ |
1876 | CAIRO_CONTENT_COLOR_ALPHA))\ |
1477 | CAIRO_CONTENT_COLOR_ALPHA))\ |
1877 | == 0)) |
1478 | == 0)) |
1878 | 1479 | ||
1879 | cairo_private int |
1480 | cairo_private int |
1880 | _cairo_format_bits_per_pixel (cairo_format_t format) cairo_const; |
1481 | _cairo_format_bits_per_pixel (cairo_format_t format) cairo_const; |
1881 | 1482 | ||
1882 | cairo_private cairo_format_t |
1483 | cairo_private cairo_format_t |
1883 | _cairo_format_from_content (cairo_content_t content) cairo_const; |
1484 | _cairo_format_from_content (cairo_content_t content) cairo_const; |
1884 | 1485 | ||
1885 | cairo_private cairo_format_t |
1486 | cairo_private cairo_format_t |
1886 | _cairo_format_from_pixman_format (pixman_format_code_t pixman_format); |
1487 | _cairo_format_from_pixman_format (pixman_format_code_t pixman_format); |
1887 | 1488 | ||
1888 | cairo_private cairo_content_t |
1489 | cairo_private cairo_content_t |
1889 | _cairo_content_from_format (cairo_format_t format) cairo_const; |
1490 | _cairo_content_from_format (cairo_format_t format) cairo_const; |
1890 | 1491 | ||
1891 | cairo_private cairo_content_t |
1492 | cairo_private cairo_content_t |
1892 | _cairo_content_from_pixman_format (pixman_format_code_t pixman_format); |
1493 | _cairo_content_from_pixman_format (pixman_format_code_t pixman_format); |
1893 | 1494 | ||
1894 | cairo_private cairo_surface_t * |
1495 | cairo_private cairo_surface_t * |
1895 | _cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image, |
1496 | _cairo_image_surface_create_for_pixman_image (pixman_image_t *pixman_image, |
1896 | pixman_format_code_t pixman_format); |
1497 | pixman_format_code_t pixman_format); |
1897 | 1498 | ||
1898 | cairo_private pixman_format_code_t |
1499 | cairo_private pixman_format_code_t |
1899 | _cairo_format_to_pixman_format_code (cairo_format_t format); |
1500 | _cairo_format_to_pixman_format_code (cairo_format_t format); |
1900 | 1501 | ||
1901 | cairo_private cairo_bool_t |
1502 | cairo_private cairo_bool_t |
1902 | _pixman_format_from_masks (cairo_format_masks_t *masks, |
1503 | _pixman_format_from_masks (cairo_format_masks_t *masks, |
1903 | pixman_format_code_t *format_ret); |
1504 | pixman_format_code_t *format_ret); |
1904 | 1505 | ||
1905 | cairo_private cairo_bool_t |
1506 | cairo_private cairo_bool_t |
1906 | _pixman_format_to_masks (pixman_format_code_t pixman_format, |
1507 | _pixman_format_to_masks (pixman_format_code_t pixman_format, |
1907 | cairo_format_masks_t *masks); |
1508 | cairo_format_masks_t *masks); |
1908 | 1509 | ||
1909 | cairo_private void |
1510 | cairo_private void |
- | 1511 | _cairo_image_scaled_glyph_fini (cairo_scaled_font_t *scaled_font, |
|
- | 1512 | cairo_scaled_glyph_t *scaled_glyph); |
|
- | 1513 | ||
- | 1514 | cairo_private void |
|
1910 | _cairo_image_reset_static_data (void); |
1515 | _cairo_image_reset_static_data (void); |
1911 | 1516 | ||
1912 | cairo_private cairo_surface_t * |
1517 | cairo_private cairo_surface_t * |
1913 | _cairo_image_surface_create_with_pixman_format (unsigned char *data, |
1518 | _cairo_image_surface_create_with_pixman_format (unsigned char *data, |
1914 | pixman_format_code_t pixman_format, |
1519 | pixman_format_code_t pixman_format, |
1915 | int width, |
1520 | int width, |
1916 | int height, |
1521 | int height, |
1917 | int stride); |
1522 | int stride); |
1918 | 1523 | ||
1919 | cairo_private cairo_surface_t * |
1524 | cairo_private cairo_surface_t * |
1920 | _cairo_image_surface_create_with_content (cairo_content_t content, |
1525 | _cairo_image_surface_create_with_content (cairo_content_t content, |
1921 | int width, |
1526 | int width, |
1922 | int height); |
1527 | int height); |
1923 | 1528 | ||
1924 | cairo_private void |
1529 | cairo_private void |
1925 | _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface); |
1530 | _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t *surface); |
1926 | 1531 | ||
1927 | cairo_private cairo_image_surface_t * |
1532 | cairo_private cairo_image_surface_t * |
1928 | _cairo_image_surface_coerce (cairo_image_surface_t *surface); |
1533 | _cairo_image_surface_coerce (cairo_image_surface_t *surface); |
1929 | 1534 | ||
1930 | cairo_private cairo_image_surface_t * |
1535 | cairo_private cairo_image_surface_t * |
1931 | _cairo_image_surface_coerce_to_format (cairo_image_surface_t *surface, |
1536 | _cairo_image_surface_coerce_to_format (cairo_image_surface_t *surface, |
1932 | cairo_format_t format); |
1537 | cairo_format_t format); |
1933 | - | ||
1934 | cairo_private void |
- | |
1935 | _cairo_image_surface_span_render_row (int y, |
- | |
1936 | const cairo_half_open_span_t *spans, |
- | |
1937 | unsigned num_spans, |
- | |
1938 | uint8_t *data, |
- | |
1939 | uint32_t stride); |
- | |
1940 | 1538 | ||
1941 | cairo_private cairo_image_transparency_t |
1539 | cairo_private cairo_image_transparency_t |
1942 | _cairo_image_analyze_transparency (cairo_image_surface_t *image); |
1540 | _cairo_image_analyze_transparency (cairo_image_surface_t *image); |
1943 | 1541 | ||
1944 | cairo_private cairo_bool_t |
1542 | cairo_private cairo_image_color_t |
1945 | _cairo_surface_is_image (const cairo_surface_t *surface) cairo_pure; |
- | |
1946 | - | ||
1947 | cairo_private cairo_bool_t |
- | |
1948 | _cairo_surface_is_recording (const cairo_surface_t *surface) cairo_pure; |
1543 | _cairo_image_analyze_color (cairo_image_surface_t *image); |
- | 1544 | ||
- | 1545 | /* cairo-pen.c */ |
|
- | 1546 | cairo_private int |
|
- | 1547 | _cairo_pen_vertices_needed (double tolerance, |
|
- | 1548 | double radius, |
|
1949 | 1549 | const cairo_matrix_t *matrix); |
|
1950 | /* cairo-pen.c */ |
1550 | |
1951 | cairo_private cairo_status_t |
1551 | cairo_private cairo_status_t |
1952 | _cairo_pen_init (cairo_pen_t *pen, |
1552 | _cairo_pen_init (cairo_pen_t *pen, |
1953 | double radius, |
1553 | double radius, |
1954 | double tolerance, |
1554 | double tolerance, |
1955 | const cairo_matrix_t *ctm); |
1555 | const cairo_matrix_t *ctm); |
1956 | 1556 | ||
1957 | cairo_private void |
1557 | cairo_private void |
1958 | _cairo_pen_init_empty (cairo_pen_t *pen); |
1558 | _cairo_pen_init_empty (cairo_pen_t *pen); |
1959 | 1559 | ||
1960 | cairo_private cairo_status_t |
1560 | cairo_private cairo_status_t |
1961 | _cairo_pen_init_copy (cairo_pen_t *pen, const cairo_pen_t *other); |
1561 | _cairo_pen_init_copy (cairo_pen_t *pen, const cairo_pen_t *other); |
1962 | 1562 | ||
1963 | cairo_private void |
1563 | cairo_private void |
1964 | _cairo_pen_fini (cairo_pen_t *pen); |
1564 | _cairo_pen_fini (cairo_pen_t *pen); |
1965 | 1565 | ||
1966 | cairo_private cairo_status_t |
1566 | cairo_private cairo_status_t |
1967 | _cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points); |
1567 | _cairo_pen_add_points (cairo_pen_t *pen, cairo_point_t *point, int num_points); |
1968 | - | ||
1969 | cairo_private cairo_status_t |
- | |
1970 | _cairo_pen_add_points_for_slopes (cairo_pen_t *pen, |
- | |
1971 | cairo_point_t *a, |
- | |
1972 | cairo_point_t *b, |
- | |
1973 | cairo_point_t *c, |
- | |
1974 | cairo_point_t *d); |
- | |
1975 | 1568 | ||
1976 | cairo_private int |
1569 | cairo_private int |
1977 | _cairo_pen_find_active_cw_vertex_index (const cairo_pen_t *pen, |
1570 | _cairo_pen_find_active_cw_vertex_index (const cairo_pen_t *pen, |
1978 | const cairo_slope_t *slope); |
1571 | const cairo_slope_t *slope); |
1979 | 1572 | ||
1980 | cairo_private int |
1573 | cairo_private int |
1981 | _cairo_pen_find_active_ccw_vertex_index (const cairo_pen_t *pen, |
1574 | _cairo_pen_find_active_ccw_vertex_index (const cairo_pen_t *pen, |
1982 | const cairo_slope_t *slope); |
1575 | const cairo_slope_t *slope); |
- | 1576 | ||
- | 1577 | cairo_private void |
|
- | 1578 | _cairo_pen_find_active_cw_vertices (const cairo_pen_t *pen, |
|
- | 1579 | const cairo_slope_t *in, |
|
- | 1580 | const cairo_slope_t *out, |
|
- | 1581 | int *start, int *stop); |
|
- | 1582 | ||
- | 1583 | cairo_private void |
|
- | 1584 | _cairo_pen_find_active_ccw_vertices (const cairo_pen_t *pen, |
|
- | 1585 | const cairo_slope_t *in, |
|
- | 1586 | const cairo_slope_t *out, |
|
- | 1587 | int *start, int *stop); |
|
1983 | 1588 | ||
1984 | /* cairo-polygon.c */ |
1589 | /* cairo-polygon.c */ |
1985 | cairo_private void |
1590 | cairo_private void |
- | 1591 | _cairo_polygon_init (cairo_polygon_t *polygon, |
|
- | 1592 | const cairo_box_t *boxes, |
|
- | 1593 | int num_boxes); |
|
- | 1594 | ||
- | 1595 | cairo_private void |
|
- | 1596 | _cairo_polygon_init_with_clip (cairo_polygon_t *polygon, |
|
- | 1597 | const cairo_clip_t *clip); |
|
- | 1598 | ||
- | 1599 | cairo_private cairo_status_t |
|
- | 1600 | _cairo_polygon_init_boxes (cairo_polygon_t *polygon, |
|
- | 1601 | const cairo_boxes_t *boxes); |
|
- | 1602 | ||
- | 1603 | cairo_private cairo_status_t |
|
- | 1604 | _cairo_polygon_init_box_array (cairo_polygon_t *polygon, |
|
- | 1605 | cairo_box_t *boxes, |
|
- | 1606 | int num_boxes); |
|
- | 1607 | ||
- | 1608 | cairo_private void |
|
- | 1609 | _cairo_polygon_limit (cairo_polygon_t *polygon, |
|
- | 1610 | const cairo_box_t *limits, |
|
1986 | _cairo_polygon_init (cairo_polygon_t *polygon); |
1611 | int num_limits); |
1987 | 1612 | ||
1988 | cairo_private void |
1613 | cairo_private void |
1989 | _cairo_polygon_limit (cairo_polygon_t *polygon, |
- | |
1990 | const cairo_box_t *boxes, |
1614 | _cairo_polygon_limit_to_clip (cairo_polygon_t *polygon, |
1991 | int num_boxes); |
1615 | const cairo_clip_t *clip); |
1992 | 1616 | ||
1993 | cairo_private void |
1617 | cairo_private void |
1994 | _cairo_polygon_fini (cairo_polygon_t *polygon); |
1618 | _cairo_polygon_fini (cairo_polygon_t *polygon); |
1995 | 1619 | ||
1996 | cairo_private cairo_status_t |
1620 | cairo_private cairo_status_t |
1997 | _cairo_polygon_add_line (cairo_polygon_t *polygon, |
1621 | _cairo_polygon_add_line (cairo_polygon_t *polygon, |
1998 | const cairo_line_t *line, |
1622 | const cairo_line_t *line, |
1999 | int top, int bottom, |
1623 | int top, int bottom, |
2000 | int dir); |
1624 | int dir); |
2001 | 1625 | ||
2002 | cairo_private cairo_status_t |
1626 | cairo_private cairo_status_t |
2003 | _cairo_polygon_add_external_edge (void *polygon, |
1627 | _cairo_polygon_add_external_edge (void *polygon, |
2004 | const cairo_point_t *p1, |
1628 | const cairo_point_t *p1, |
2005 | const cairo_point_t *p2); |
1629 | const cairo_point_t *p2); |
2006 | 1630 | ||
2007 | cairo_private cairo_status_t |
1631 | cairo_private cairo_status_t |
2008 | _cairo_polygon_move_to (cairo_polygon_t *polygon, |
1632 | _cairo_polygon_add_contour (cairo_polygon_t *polygon, |
2009 | const cairo_point_t *point); |
1633 | const cairo_contour_t *contour); |
- | 1634 | ||
- | 1635 | cairo_private void |
|
- | 1636 | _cairo_polygon_translate (cairo_polygon_t *polygon, int dx, int dy); |
|
2010 | 1637 | ||
2011 | cairo_private cairo_status_t |
1638 | cairo_private cairo_status_t |
2012 | _cairo_polygon_line_to (cairo_polygon_t *polygon, |
1639 | _cairo_polygon_reduce (cairo_polygon_t *polygon, |
2013 | const cairo_point_t *point); |
1640 | cairo_fill_rule_t fill_rule); |
- | 1641 | ||
- | 1642 | cairo_private cairo_status_t |
|
- | 1643 | _cairo_polygon_intersect (cairo_polygon_t *a, int winding_a, |
|
- | 1644 | cairo_polygon_t *b, int winding_b); |
|
- | 1645 | ||
- | 1646 | cairo_private cairo_status_t |
|
- | 1647 | _cairo_polygon_intersect_with_boxes (cairo_polygon_t *polygon, |
|
- | 1648 | cairo_fill_rule_t *winding, |
|
- | 1649 | cairo_box_t *boxes, |
|
- | 1650 | int num_boxes); |
|
2014 | 1651 | ||
- | 1652 | static inline cairo_bool_t |
|
- | 1653 | _cairo_polygon_is_empty (const cairo_polygon_t *polygon) |
|
- | 1654 | { |
|
- | 1655 | return |
|
- | 1656 | polygon->num_edges == 0 || |
|
2015 | cairo_private cairo_status_t |
1657 | polygon->extents.p2.x <= polygon->extents.p1.x; |
2016 | _cairo_polygon_close (cairo_polygon_t *polygon); |
1658 | } |
2017 | 1659 | ||
2018 | #define _cairo_polygon_status(P) ((cairo_polygon_t *) (P))->status |
1660 | #define _cairo_polygon_status(P) ((cairo_polygon_t *) (P))->status |
2019 | 1661 | ||
2020 | /* cairo-spline.c */ |
1662 | /* cairo-spline.c */ |
2021 | cairo_private cairo_bool_t |
1663 | cairo_private cairo_bool_t |
2022 | _cairo_spline_init (cairo_spline_t *spline, |
1664 | _cairo_spline_init (cairo_spline_t *spline, |
2023 | cairo_spline_add_point_func_t add_point_func, |
1665 | cairo_spline_add_point_func_t add_point_func, |
2024 | void *closure, |
1666 | void *closure, |
2025 | const cairo_point_t *a, const cairo_point_t *b, |
1667 | const cairo_point_t *a, const cairo_point_t *b, |
2026 | const cairo_point_t *c, const cairo_point_t *d); |
1668 | const cairo_point_t *c, const cairo_point_t *d); |
2027 | 1669 | ||
2028 | cairo_private cairo_status_t |
1670 | cairo_private cairo_status_t |
2029 | _cairo_spline_decompose (cairo_spline_t *spline, double tolerance); |
1671 | _cairo_spline_decompose (cairo_spline_t *spline, double tolerance); |
2030 | 1672 | ||
2031 | cairo_private cairo_status_t |
1673 | cairo_private cairo_status_t |
2032 | _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func, |
1674 | _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func, |
2033 | void *closure, |
1675 | void *closure, |
2034 | const cairo_point_t *p0, const cairo_point_t *p1, |
1676 | const cairo_point_t *p0, const cairo_point_t *p1, |
2035 | const cairo_point_t *p2, const cairo_point_t *p3); |
1677 | const cairo_point_t *p2, const cairo_point_t *p3); |
2036 | 1678 | ||
2037 | /* cairo-matrix.c */ |
1679 | /* cairo-matrix.c */ |
2038 | cairo_private void |
1680 | cairo_private void |
2039 | _cairo_matrix_get_affine (const cairo_matrix_t *matrix, |
1681 | _cairo_matrix_get_affine (const cairo_matrix_t *matrix, |
2040 | double *xx, double *yx, |
1682 | double *xx, double *yx, |
2041 | double *xy, double *yy, |
1683 | double *xy, double *yy, |
2042 | double *x0, double *y0); |
1684 | double *x0, double *y0); |
2043 | 1685 | ||
2044 | cairo_private void |
1686 | cairo_private void |
2045 | _cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix, |
1687 | _cairo_matrix_transform_bounding_box (const cairo_matrix_t *matrix, |
2046 | double *x1, double *y1, |
1688 | double *x1, double *y1, |
2047 | double *x2, double *y2, |
1689 | double *x2, double *y2, |
2048 | cairo_bool_t *is_tight); |
1690 | cairo_bool_t *is_tight); |
2049 | 1691 | ||
2050 | cairo_private void |
1692 | cairo_private void |
2051 | _cairo_matrix_transform_bounding_box_fixed (const cairo_matrix_t *matrix, |
1693 | _cairo_matrix_transform_bounding_box_fixed (const cairo_matrix_t *matrix, |
2052 | cairo_box_t *bbox, |
1694 | cairo_box_t *bbox, |
2053 | cairo_bool_t *is_tight); |
1695 | cairo_bool_t *is_tight); |
2054 | 1696 | ||
2055 | cairo_private cairo_bool_t |
1697 | cairo_private cairo_bool_t |
2056 | _cairo_matrix_is_invertible (const cairo_matrix_t *matrix) cairo_pure; |
1698 | _cairo_matrix_is_invertible (const cairo_matrix_t *matrix) cairo_pure; |
2057 | 1699 | ||
2058 | cairo_private cairo_bool_t |
1700 | cairo_private cairo_bool_t |
2059 | _cairo_matrix_is_scale_0 (const cairo_matrix_t *matrix) cairo_pure; |
1701 | _cairo_matrix_is_scale_0 (const cairo_matrix_t *matrix) cairo_pure; |
2060 | 1702 | ||
2061 | cairo_private double |
1703 | cairo_private double |
2062 | _cairo_matrix_compute_determinant (const cairo_matrix_t *matrix) cairo_pure; |
1704 | _cairo_matrix_compute_determinant (const cairo_matrix_t *matrix) cairo_pure; |
2063 | 1705 | ||
2064 | cairo_private cairo_status_t |
1706 | cairo_private cairo_status_t |
2065 | _cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t *matrix, |
1707 | _cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t *matrix, |
2066 | double *sx, double *sy, int x_major); |
1708 | double *sx, double *sy, int x_major); |
2067 | 1709 | ||
2068 | cairo_private cairo_bool_t |
1710 | static inline cairo_bool_t |
- | 1711 | _cairo_matrix_is_identity (const cairo_matrix_t *matrix) |
|
- | 1712 | { |
|
- | 1713 | return (matrix->xx == 1.0 && matrix->yx == 0.0 && |
|
- | 1714 | matrix->xy == 0.0 && matrix->yy == 1.0 && |
|
- | 1715 | matrix->x0 == 0.0 && matrix->y0 == 0.0); |
|
2069 | _cairo_matrix_is_identity (const cairo_matrix_t *matrix) cairo_pure; |
1716 | } |
2070 | 1717 | ||
- | 1718 | static inline cairo_bool_t |
|
- | 1719 | _cairo_matrix_is_translation (const cairo_matrix_t *matrix) |
|
- | 1720 | { |
|
- | 1721 | return (matrix->xx == 1.0 && matrix->yx == 0.0 && |
|
- | 1722 | matrix->xy == 0.0 && matrix->yy == 1.0); |
|
- | 1723 | } |
|
- | 1724 | ||
- | 1725 | static inline cairo_bool_t |
|
- | 1726 | _cairo_matrix_is_scale (const cairo_matrix_t *matrix) |
|
- | 1727 | { |
|
2071 | cairo_private cairo_bool_t |
1728 | return matrix->yx == 0.0 && matrix->xy == 0.0; |
2072 | _cairo_matrix_is_translation (const cairo_matrix_t *matrix) cairo_pure; |
1729 | } |
2073 | 1730 | ||
2074 | cairo_private cairo_bool_t |
1731 | cairo_private cairo_bool_t |
2075 | _cairo_matrix_is_integer_translation(const cairo_matrix_t *matrix, |
1732 | _cairo_matrix_is_integer_translation(const cairo_matrix_t *matrix, |
2076 | int *itx, int *ity); |
1733 | int *itx, int *ity); |
2077 | 1734 | ||
2078 | cairo_private cairo_bool_t |
1735 | cairo_private cairo_bool_t |
2079 | _cairo_matrix_has_unity_scale (const cairo_matrix_t *matrix); |
1736 | _cairo_matrix_has_unity_scale (const cairo_matrix_t *matrix); |
2080 | 1737 | ||
2081 | cairo_private cairo_bool_t |
1738 | cairo_private cairo_bool_t |
2082 | _cairo_matrix_is_pixel_exact (const cairo_matrix_t *matrix) cairo_pure; |
1739 | _cairo_matrix_is_pixel_exact (const cairo_matrix_t *matrix) cairo_pure; |
2083 | 1740 | ||
2084 | cairo_private double |
1741 | cairo_private double |
2085 | _cairo_matrix_transformed_circle_major_axis (const cairo_matrix_t *matrix, |
1742 | _cairo_matrix_transformed_circle_major_axis (const cairo_matrix_t *matrix, |
2086 | double radius) cairo_pure; |
1743 | double radius) cairo_pure; |
2087 | 1744 | ||
2088 | cairo_private void |
1745 | cairo_private cairo_bool_t |
2089 | _cairo_matrix_to_pixman_matrix (const cairo_matrix_t *matrix, |
- | |
2090 | pixman_transform_t *pixman_transform, |
1746 | _cairo_matrix_is_pixman_translation (const cairo_matrix_t *matrix, |
2091 | double xc, |
1747 | cairo_filter_t filter, |
2092 | double yc); |
- | |
2093 | - | ||
2094 | /* cairo-traps.c */ |
- | |
2095 | cairo_private void |
- | |
2096 | _cairo_traps_init (cairo_traps_t *traps); |
- | |
2097 | - | ||
2098 | cairo_private void |
- | |
2099 | _cairo_traps_limit (cairo_traps_t *traps, |
- | |
2100 | const cairo_box_t *boxes, |
- | |
2101 | int num_boxes); |
- | |
2102 | - | ||
2103 | cairo_private cairo_status_t |
- | |
2104 | _cairo_traps_init_boxes (cairo_traps_t *traps, |
1748 | int *out_x_offset, |
2105 | const cairo_boxes_t *boxes); |
- | |
2106 | - | ||
2107 | cairo_private void |
- | |
2108 | _cairo_traps_clear (cairo_traps_t *traps); |
- | |
2109 | - | ||
2110 | cairo_private void |
- | |
2111 | _cairo_traps_fini (cairo_traps_t *traps); |
- | |
2112 | - | ||
2113 | #define _cairo_traps_status(T) (T)->status |
- | |
2114 | - | ||
2115 | cairo_private void |
- | |
2116 | _cairo_traps_translate (cairo_traps_t *traps, int x, int y); |
1749 | int *out_y_offset); |
2117 | 1750 | ||
2118 | cairo_private cairo_status_t |
1751 | cairo_private cairo_status_t |
2119 | _cairo_traps_tessellate_rectangle (cairo_traps_t *traps, |
1752 | _cairo_matrix_to_pixman_matrix_offset (const cairo_matrix_t *matrix, |
2120 | const cairo_point_t *top_left, |
- | |
2121 | const cairo_point_t *bottom_right); |
1753 | cairo_filter_t filter, |
2122 | 1754 | double xc, |
|
2123 | cairo_private void |
1755 | double yc, |
2124 | _cairo_traps_add_trap (cairo_traps_t *traps, |
1756 | pixman_transform_t *out_transform, |
2125 | cairo_fixed_t top, cairo_fixed_t bottom, |
1757 | int *out_x_offset, |
2126 | cairo_line_t *left, cairo_line_t *right); |
1758 | int *out_y_offset); |
2127 | 1759 | ||
2128 | cairo_private cairo_status_t |
1760 | cairo_private cairo_status_t |
2129 | _cairo_bentley_ottmann_tessellate_rectilinear_polygon (cairo_traps_t *traps, |
1761 | _cairo_bentley_ottmann_tessellate_rectilinear_polygon (cairo_traps_t *traps, |
2130 | const cairo_polygon_t *polygon, |
1762 | const cairo_polygon_t *polygon, |
2131 | cairo_fill_rule_t fill_rule); |
1763 | cairo_fill_rule_t fill_rule); |
2132 | 1764 | ||
2133 | cairo_private cairo_status_t |
1765 | cairo_private cairo_status_t |
2134 | _cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps, |
1766 | _cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t *traps, |
2135 | const cairo_polygon_t *polygon, |
1767 | const cairo_polygon_t *polygon, |
2136 | cairo_fill_rule_t fill_rule); |
1768 | cairo_fill_rule_t fill_rule); |
2137 | 1769 | ||
2138 | cairo_private cairo_status_t |
1770 | cairo_private cairo_status_t |
2139 | _cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps, |
1771 | _cairo_bentley_ottmann_tessellate_traps (cairo_traps_t *traps, |
2140 | cairo_fill_rule_t fill_rule); |
1772 | cairo_fill_rule_t fill_rule); |
2141 | 1773 | ||
2142 | cairo_private cairo_status_t |
1774 | cairo_private cairo_status_t |
2143 | _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps, |
1775 | _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t *traps, |
2144 | cairo_fill_rule_t fill_rule); |
1776 | cairo_fill_rule_t fill_rule); |
2145 | 1777 | ||
2146 | cairo_private cairo_status_t |
1778 | cairo_private cairo_status_t |
2147 | _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in, |
1779 | _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t *in, |
2148 | cairo_fill_rule_t fill_rule, |
1780 | cairo_fill_rule_t fill_rule, |
2149 | cairo_boxes_t *out); |
1781 | cairo_boxes_t *out); |
2150 | 1782 | ||
2151 | cairo_private cairo_status_t |
1783 | cairo_private cairo_status_t |
2152 | _cairo_bentley_ottmann_tessellate_rectilinear_traps (cairo_traps_t *traps, |
1784 | _cairo_bentley_ottmann_tessellate_rectilinear_traps (cairo_traps_t *traps, |
2153 | cairo_fill_rule_t fill_rule); |
1785 | cairo_fill_rule_t fill_rule); |
2154 | 1786 | ||
2155 | cairo_private cairo_status_t |
1787 | cairo_private cairo_status_t |
2156 | _cairo_bentley_ottmann_tessellate_rectilinear_polygon_to_boxes (const cairo_polygon_t *polygon, |
1788 | _cairo_bentley_ottmann_tessellate_rectilinear_polygon_to_boxes (const cairo_polygon_t *polygon, |
2157 | cairo_fill_rule_t fill_rule, |
1789 | cairo_fill_rule_t fill_rule, |
2158 | cairo_boxes_t *boxes); |
1790 | cairo_boxes_t *boxes); |
2159 | - | ||
2160 | cairo_private int |
- | |
2161 | _cairo_traps_contain (const cairo_traps_t *traps, |
- | |
2162 | double x, double y); |
- | |
2163 | - | ||
2164 | cairo_private void |
- | |
2165 | _cairo_traps_extents (const cairo_traps_t *traps, |
- | |
2166 | cairo_box_t *extents); |
- | |
2167 | - | ||
2168 | cairo_private cairo_int_status_t |
- | |
2169 | _cairo_traps_extract_region (cairo_traps_t *traps, |
- | |
2170 | cairo_region_t **region); |
- | |
2171 | - | ||
2172 | cairo_private cairo_status_t |
- | |
2173 | _cairo_traps_path (const cairo_traps_t *traps, |
- | |
2174 | cairo_path_fixed_t *path); |
- | |
2175 | 1791 | ||
2176 | cairo_private void |
1792 | cairo_private void |
2177 | _cairo_trapezoid_array_translate_and_scale (cairo_trapezoid_t *offset_traps, |
1793 | _cairo_trapezoid_array_translate_and_scale (cairo_trapezoid_t *offset_traps, |
2178 | cairo_trapezoid_t *src_traps, |
1794 | cairo_trapezoid_t *src_traps, |
2179 | int num_traps, |
1795 | int num_traps, |
2180 | double tx, double ty, |
1796 | double tx, double ty, |
2181 | double sx, double sy); |
1797 | double sx, double sy); |
2182 | - | ||
2183 | /* cairo-pattern.c */ |
- | |
2184 | - | ||
2185 | cairo_private cairo_pattern_t * |
- | |
2186 | _cairo_pattern_create_in_error (cairo_status_t status); |
- | |
2187 | - | ||
2188 | cairo_private cairo_status_t |
- | |
2189 | _cairo_pattern_create_copy (cairo_pattern_t **pattern, |
- | |
2190 | const cairo_pattern_t *other); |
- | |
2191 | - | ||
2192 | cairo_private cairo_status_t |
- | |
2193 | _cairo_pattern_init_copy (cairo_pattern_t *pattern, |
- | |
2194 | const cairo_pattern_t *other); |
- | |
2195 | - | ||
2196 | cairo_private void |
- | |
2197 | _cairo_pattern_init_static_copy (cairo_pattern_t *pattern, |
- | |
2198 | const cairo_pattern_t *other); |
- | |
2199 | - | ||
2200 | cairo_private cairo_status_t |
- | |
2201 | _cairo_pattern_init_snapshot (cairo_pattern_t *pattern, |
- | |
2202 | const cairo_pattern_t *other); |
- | |
2203 | - | ||
2204 | cairo_private void |
- | |
2205 | _cairo_pattern_init_solid (cairo_solid_pattern_t *pattern, |
- | |
2206 | const cairo_color_t *color); |
- | |
2207 | - | ||
2208 | cairo_private void |
- | |
2209 | _cairo_pattern_init_for_surface (cairo_surface_pattern_t *pattern, |
- | |
2210 | cairo_surface_t *surface); |
- | |
2211 | - | ||
2212 | cairo_private void |
- | |
2213 | _cairo_pattern_init_linear (cairo_linear_pattern_t *pattern, |
- | |
2214 | double x0, double y0, double x1, double y1); |
- | |
2215 | - | ||
2216 | cairo_private void |
- | |
2217 | _cairo_pattern_init_radial (cairo_radial_pattern_t *pattern, |
- | |
2218 | double cx0, double cy0, double radius0, |
- | |
2219 | double cx1, double cy1, double radius1); |
- | |
2220 | - | ||
2221 | cairo_private void |
- | |
2222 | _cairo_pattern_fini (cairo_pattern_t *pattern); |
- | |
2223 | - | ||
2224 | cairo_private cairo_pattern_t * |
- | |
2225 | _cairo_pattern_create_solid (const cairo_color_t *color); |
- | |
2226 | - | ||
2227 | cairo_private void |
- | |
2228 | _cairo_pattern_transform (cairo_pattern_t *pattern, |
- | |
2229 | const cairo_matrix_t *ctm_inverse); |
- | |
2230 | - | ||
2231 | cairo_private cairo_bool_t |
- | |
2232 | _cairo_gradient_pattern_is_solid (const cairo_gradient_pattern_t *gradient, |
- | |
2233 | const cairo_rectangle_int_t *extents, |
- | |
2234 | cairo_color_t *color); |
- | |
2235 | - | ||
2236 | cairo_private cairo_bool_t |
- | |
2237 | _cairo_pattern_is_opaque_solid (const cairo_pattern_t *pattern); |
- | |
2238 | - | ||
2239 | cairo_private cairo_bool_t |
- | |
2240 | _cairo_pattern_is_opaque (const cairo_pattern_t *pattern, |
- | |
2241 | const cairo_rectangle_int_t *extents); |
- | |
2242 | - | ||
2243 | cairo_private cairo_bool_t |
- | |
2244 | _cairo_pattern_is_clear (const cairo_pattern_t *pattern); |
- | |
2245 | - | ||
2246 | cairo_private_no_warn cairo_filter_t |
- | |
2247 | _cairo_pattern_analyze_filter (const cairo_pattern_t *pattern, |
- | |
2248 | double *pad_out); |
- | |
2249 | - | ||
2250 | enum { |
- | |
2251 | CAIRO_PATTERN_ACQUIRE_NONE = 0x0, |
- | |
2252 | CAIRO_PATTERN_ACQUIRE_NO_REFLECT = 0x1 |
- | |
2253 | }; |
- | |
2254 | cairo_private cairo_int_status_t |
- | |
2255 | _cairo_pattern_acquire_surface (const cairo_pattern_t *pattern, |
- | |
2256 | cairo_surface_t *dst, |
- | |
2257 | int x, |
- | |
2258 | int y, |
- | |
2259 | unsigned int width, |
- | |
2260 | unsigned int height, |
- | |
2261 | unsigned int flags, |
- | |
2262 | cairo_surface_t **surface_out, |
- | |
2263 | cairo_surface_attributes_t *attributes); |
- | |
2264 | - | ||
2265 | cairo_private void |
- | |
2266 | _cairo_pattern_release_surface (const cairo_pattern_t *pattern, |
- | |
2267 | cairo_surface_t *surface, |
- | |
2268 | cairo_surface_attributes_t *attributes); |
- | |
2269 | - | ||
2270 | cairo_private cairo_int_status_t |
- | |
2271 | _cairo_pattern_acquire_surfaces (const cairo_pattern_t *src, |
- | |
2272 | const cairo_pattern_t *mask, |
- | |
2273 | cairo_surface_t *dst, |
- | |
2274 | int src_x, |
- | |
2275 | int src_y, |
- | |
2276 | int mask_x, |
- | |
2277 | int mask_y, |
- | |
2278 | unsigned int width, |
- | |
2279 | unsigned int height, |
- | |
2280 | unsigned int flags, |
- | |
2281 | cairo_surface_t **src_out, |
- | |
2282 | cairo_surface_t **mask_out, |
- | |
2283 | cairo_surface_attributes_t *src_attributes, |
- | |
2284 | cairo_surface_attributes_t *mask_attributes); |
- | |
2285 | - | ||
2286 | cairo_private void |
- | |
2287 | _cairo_pattern_get_extents (const cairo_pattern_t *pattern, |
- | |
2288 | cairo_rectangle_int_t *extents); |
- | |
2289 | - | ||
2290 | cairo_private unsigned long |
- | |
2291 | _cairo_pattern_hash (const cairo_pattern_t *pattern); |
- | |
2292 | - | ||
2293 | cairo_private unsigned long |
- | |
2294 | _cairo_linear_pattern_hash (unsigned long hash, |
- | |
2295 | const cairo_linear_pattern_t *linear); |
- | |
2296 | - | ||
2297 | cairo_private unsigned long |
- | |
2298 | _cairo_radial_pattern_hash (unsigned long hash, |
- | |
2299 | const cairo_radial_pattern_t *radial); |
- | |
2300 | - | ||
2301 | cairo_private cairo_bool_t |
- | |
2302 | _cairo_linear_pattern_equal (const cairo_linear_pattern_t *a, |
- | |
2303 | const cairo_linear_pattern_t *b); |
- | |
2304 | - | ||
2305 | cairo_private unsigned long |
- | |
2306 | _cairo_pattern_size (const cairo_pattern_t *pattern); |
- | |
2307 | - | ||
2308 | cairo_private cairo_bool_t |
- | |
2309 | _cairo_radial_pattern_equal (const cairo_radial_pattern_t *a, |
- | |
2310 | const cairo_radial_pattern_t *b); |
- | |
2311 | - | ||
2312 | cairo_private cairo_bool_t |
- | |
2313 | _cairo_pattern_equal (const cairo_pattern_t *a, |
- | |
2314 | const cairo_pattern_t *b); |
- | |
2315 | - | ||
2316 | cairo_private void |
- | |
2317 | _cairo_pattern_reset_static_data (void); |
- | |
2318 | 1798 | ||
2319 | #if CAIRO_HAS_DRM_SURFACE |
1799 | #if CAIRO_HAS_DRM_SURFACE |
2320 | 1800 | ||
2321 | cairo_private void |
1801 | cairo_private void |
2322 | _cairo_drm_device_reset_static_data (void); |
1802 | _cairo_drm_device_reset_static_data (void); |
2323 | 1803 | ||
2324 | #endif |
1804 | #endif |
2325 | 1805 | ||
2326 | cairo_private void |
1806 | cairo_private void |
2327 | _cairo_clip_reset_static_data (void); |
1807 | _cairo_clip_reset_static_data (void); |
- | 1808 | ||
- | 1809 | cairo_private void |
|
- | 1810 | _cairo_pattern_reset_static_data (void); |
|
2328 | 1811 | ||
2329 | /* cairo-unicode.c */ |
1812 | /* cairo-unicode.c */ |
2330 | 1813 | ||
2331 | cairo_private int |
1814 | cairo_private int |
2332 | _cairo_utf8_get_char_validated (const char *p, |
1815 | _cairo_utf8_get_char_validated (const char *p, |
2333 | uint32_t *unicode); |
1816 | uint32_t *unicode); |
2334 | 1817 | ||
2335 | cairo_private cairo_status_t |
1818 | cairo_private cairo_status_t |
2336 | _cairo_utf8_to_ucs4 (const char *str, |
1819 | _cairo_utf8_to_ucs4 (const char *str, |
2337 | int len, |
1820 | int len, |
2338 | uint32_t **result, |
1821 | uint32_t **result, |
2339 | int *items_written); |
1822 | int *items_written); |
2340 | 1823 | ||
2341 | cairo_private int |
1824 | cairo_private int |
2342 | _cairo_ucs4_to_utf8 (uint32_t unicode, |
1825 | _cairo_ucs4_to_utf8 (uint32_t unicode, |
2343 | char *utf8); |
1826 | char *utf8); |
2344 | 1827 | ||
2345 | #if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS |
1828 | #if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS |
2346 | # define CAIRO_HAS_UTF8_TO_UTF16 1 |
1829 | # define CAIRO_HAS_UTF8_TO_UTF16 1 |
2347 | #endif |
1830 | #endif |
2348 | #if CAIRO_HAS_UTF8_TO_UTF16 |
1831 | #if CAIRO_HAS_UTF8_TO_UTF16 |
2349 | cairo_private cairo_status_t |
1832 | cairo_private cairo_status_t |
2350 | _cairo_utf8_to_utf16 (const char *str, |
1833 | _cairo_utf8_to_utf16 (const char *str, |
2351 | int len, |
1834 | int len, |
2352 | uint16_t **result, |
1835 | uint16_t **result, |
2353 | int *items_written); |
1836 | int *items_written); |
2354 | #endif |
1837 | #endif |
- | 1838 | ||
- | 1839 | cairo_private void |
|
- | 1840 | _cairo_matrix_multiply (cairo_matrix_t *r, |
|
- | 1841 | const cairo_matrix_t *a, |
|
- | 1842 | const cairo_matrix_t *b); |
|
2355 | 1843 | ||
2356 | /* cairo-observer.c */ |
1844 | /* cairo-observer.c */ |
2357 | 1845 | ||
2358 | cairo_private void |
1846 | cairo_private void |
2359 | _cairo_observers_notify (cairo_list_t *observers, void *arg); |
1847 | _cairo_observers_notify (cairo_list_t *observers, void *arg); |
2360 | 1848 | ||
2361 | /* Avoid unnecessary PLT entries. */ |
1849 | /* Avoid unnecessary PLT entries. */ |
2362 | slim_hidden_proto (cairo_clip_preserve); |
1850 | slim_hidden_proto (cairo_clip_preserve); |
2363 | slim_hidden_proto (cairo_close_path); |
1851 | slim_hidden_proto (cairo_close_path); |
2364 | slim_hidden_proto (cairo_create); |
1852 | slim_hidden_proto (cairo_create); |
2365 | slim_hidden_proto (cairo_curve_to); |
1853 | slim_hidden_proto (cairo_curve_to); |
2366 | slim_hidden_proto (cairo_destroy); |
1854 | slim_hidden_proto (cairo_destroy); |
2367 | slim_hidden_proto (cairo_fill_preserve); |
1855 | slim_hidden_proto (cairo_fill_preserve); |
2368 | slim_hidden_proto (cairo_font_face_destroy); |
1856 | slim_hidden_proto (cairo_font_face_destroy); |
2369 | slim_hidden_proto (cairo_font_face_get_user_data); |
1857 | slim_hidden_proto (cairo_font_face_get_user_data); |
2370 | slim_hidden_proto_no_warn (cairo_font_face_reference); |
1858 | slim_hidden_proto_no_warn (cairo_font_face_reference); |
2371 | slim_hidden_proto (cairo_font_face_set_user_data); |
1859 | slim_hidden_proto (cairo_font_face_set_user_data); |
2372 | slim_hidden_proto (cairo_font_options_equal); |
1860 | slim_hidden_proto (cairo_font_options_equal); |
2373 | slim_hidden_proto (cairo_font_options_hash); |
1861 | slim_hidden_proto (cairo_font_options_hash); |
2374 | slim_hidden_proto (cairo_font_options_merge); |
1862 | slim_hidden_proto (cairo_font_options_merge); |
2375 | slim_hidden_proto (cairo_font_options_set_antialias); |
1863 | slim_hidden_proto (cairo_font_options_set_antialias); |
2376 | slim_hidden_proto (cairo_font_options_set_hint_metrics); |
1864 | slim_hidden_proto (cairo_font_options_set_hint_metrics); |
2377 | slim_hidden_proto (cairo_font_options_set_hint_style); |
1865 | slim_hidden_proto (cairo_font_options_set_hint_style); |
2378 | slim_hidden_proto (cairo_font_options_set_subpixel_order); |
1866 | slim_hidden_proto (cairo_font_options_set_subpixel_order); |
2379 | slim_hidden_proto (cairo_font_options_status); |
1867 | slim_hidden_proto (cairo_font_options_status); |
2380 | slim_hidden_proto (cairo_format_stride_for_width); |
1868 | slim_hidden_proto (cairo_format_stride_for_width); |
2381 | slim_hidden_proto (cairo_get_current_point); |
1869 | slim_hidden_proto (cairo_get_current_point); |
2382 | slim_hidden_proto (cairo_get_line_width); |
1870 | slim_hidden_proto (cairo_get_line_width); |
2383 | slim_hidden_proto (cairo_get_matrix); |
1871 | slim_hidden_proto (cairo_get_matrix); |
- | 1872 | slim_hidden_proto (cairo_get_scaled_font); |
|
2384 | slim_hidden_proto (cairo_get_target); |
1873 | slim_hidden_proto (cairo_get_target); |
2385 | slim_hidden_proto (cairo_get_tolerance); |
1874 | slim_hidden_proto (cairo_get_tolerance); |
2386 | slim_hidden_proto (cairo_glyph_allocate); |
1875 | slim_hidden_proto (cairo_glyph_allocate); |
2387 | slim_hidden_proto (cairo_glyph_free); |
1876 | slim_hidden_proto (cairo_glyph_free); |
2388 | slim_hidden_proto (cairo_image_surface_create); |
1877 | slim_hidden_proto (cairo_image_surface_create); |
2389 | slim_hidden_proto (cairo_image_surface_create_for_data); |
1878 | slim_hidden_proto (cairo_image_surface_create_for_data); |
2390 | slim_hidden_proto (cairo_image_surface_get_data); |
1879 | slim_hidden_proto (cairo_image_surface_get_data); |
2391 | slim_hidden_proto (cairo_image_surface_get_format); |
1880 | slim_hidden_proto (cairo_image_surface_get_format); |
2392 | slim_hidden_proto (cairo_image_surface_get_height); |
1881 | slim_hidden_proto (cairo_image_surface_get_height); |
2393 | slim_hidden_proto (cairo_image_surface_get_stride); |
1882 | slim_hidden_proto (cairo_image_surface_get_stride); |
2394 | slim_hidden_proto (cairo_image_surface_get_width); |
1883 | slim_hidden_proto (cairo_image_surface_get_width); |
2395 | slim_hidden_proto (cairo_line_to); |
1884 | slim_hidden_proto (cairo_line_to); |
2396 | slim_hidden_proto (cairo_mask); |
1885 | slim_hidden_proto (cairo_mask); |
2397 | slim_hidden_proto (cairo_matrix_init); |
1886 | slim_hidden_proto (cairo_matrix_init); |
2398 | slim_hidden_proto (cairo_matrix_init_identity); |
1887 | slim_hidden_proto (cairo_matrix_init_identity); |
2399 | slim_hidden_proto (cairo_matrix_init_rotate); |
1888 | slim_hidden_proto (cairo_matrix_init_rotate); |
2400 | slim_hidden_proto (cairo_matrix_init_scale); |
1889 | slim_hidden_proto (cairo_matrix_init_scale); |
2401 | slim_hidden_proto (cairo_matrix_init_translate); |
1890 | slim_hidden_proto (cairo_matrix_init_translate); |
2402 | slim_hidden_proto (cairo_matrix_invert); |
1891 | slim_hidden_proto (cairo_matrix_invert); |
2403 | slim_hidden_proto (cairo_matrix_multiply); |
1892 | slim_hidden_proto (cairo_matrix_multiply); |
2404 | slim_hidden_proto (cairo_matrix_scale); |
1893 | slim_hidden_proto (cairo_matrix_scale); |
2405 | slim_hidden_proto (cairo_matrix_transform_distance); |
1894 | slim_hidden_proto (cairo_matrix_transform_distance); |
2406 | slim_hidden_proto (cairo_matrix_transform_point); |
1895 | slim_hidden_proto (cairo_matrix_transform_point); |
2407 | slim_hidden_proto (cairo_matrix_translate); |
1896 | slim_hidden_proto (cairo_matrix_translate); |
2408 | slim_hidden_proto (cairo_move_to); |
1897 | slim_hidden_proto (cairo_move_to); |
2409 | slim_hidden_proto (cairo_new_path); |
1898 | slim_hidden_proto (cairo_new_path); |
2410 | slim_hidden_proto (cairo_paint); |
1899 | slim_hidden_proto (cairo_paint); |
- | 1900 | slim_hidden_proto (cairo_pattern_add_color_stop_rgba); |
|
2411 | slim_hidden_proto (cairo_pattern_create_for_surface); |
1901 | slim_hidden_proto (cairo_pattern_create_for_surface); |
2412 | slim_hidden_proto (cairo_pattern_create_rgb); |
1902 | slim_hidden_proto (cairo_pattern_create_rgb); |
2413 | slim_hidden_proto (cairo_pattern_create_rgba); |
1903 | slim_hidden_proto (cairo_pattern_create_rgba); |
2414 | slim_hidden_proto (cairo_pattern_destroy); |
1904 | slim_hidden_proto (cairo_pattern_destroy); |
2415 | slim_hidden_proto (cairo_pattern_get_extend); |
1905 | slim_hidden_proto (cairo_pattern_get_extend); |
- | 1906 | slim_hidden_proto (cairo_mesh_pattern_curve_to); |
|
- | 1907 | slim_hidden_proto (cairo_mesh_pattern_get_control_point); |
|
- | 1908 | slim_hidden_proto (cairo_mesh_pattern_get_corner_color_rgba); |
|
- | 1909 | slim_hidden_proto (cairo_mesh_pattern_get_patch_count); |
|
- | 1910 | slim_hidden_proto (cairo_mesh_pattern_get_path); |
|
- | 1911 | slim_hidden_proto (cairo_mesh_pattern_line_to); |
|
- | 1912 | slim_hidden_proto (cairo_mesh_pattern_move_to); |
|
- | 1913 | slim_hidden_proto (cairo_mesh_pattern_set_corner_color_rgba); |
|
2416 | slim_hidden_proto_no_warn (cairo_pattern_reference); |
1914 | slim_hidden_proto_no_warn (cairo_pattern_reference); |
2417 | slim_hidden_proto (cairo_pattern_set_matrix); |
1915 | slim_hidden_proto (cairo_pattern_set_matrix); |
2418 | slim_hidden_proto (cairo_pop_group); |
1916 | slim_hidden_proto (cairo_pop_group); |
2419 | slim_hidden_proto (cairo_push_group_with_content); |
1917 | slim_hidden_proto (cairo_push_group_with_content); |
- | 1918 | slim_hidden_proto_no_warn (cairo_path_destroy); |
|
- | 1919 | slim_hidden_proto (cairo_recording_surface_create); |
|
2420 | slim_hidden_proto (cairo_rel_line_to); |
1920 | slim_hidden_proto (cairo_rel_line_to); |
2421 | slim_hidden_proto (cairo_restore); |
1921 | slim_hidden_proto (cairo_restore); |
2422 | slim_hidden_proto (cairo_save); |
1922 | slim_hidden_proto (cairo_save); |
2423 | slim_hidden_proto (cairo_scale); |
1923 | slim_hidden_proto (cairo_scale); |
2424 | slim_hidden_proto (cairo_scaled_font_create); |
1924 | slim_hidden_proto (cairo_scaled_font_create); |
2425 | slim_hidden_proto (cairo_scaled_font_destroy); |
1925 | slim_hidden_proto (cairo_scaled_font_destroy); |
2426 | slim_hidden_proto (cairo_scaled_font_extents); |
1926 | slim_hidden_proto (cairo_scaled_font_extents); |
2427 | slim_hidden_proto (cairo_scaled_font_get_ctm); |
1927 | slim_hidden_proto (cairo_scaled_font_get_ctm); |
2428 | slim_hidden_proto (cairo_scaled_font_get_font_face); |
1928 | slim_hidden_proto (cairo_scaled_font_get_font_face); |
2429 | slim_hidden_proto (cairo_scaled_font_get_font_matrix); |
1929 | slim_hidden_proto (cairo_scaled_font_get_font_matrix); |
2430 | slim_hidden_proto (cairo_scaled_font_get_font_options); |
1930 | slim_hidden_proto (cairo_scaled_font_get_font_options); |
2431 | slim_hidden_proto (cairo_scaled_font_glyph_extents); |
1931 | slim_hidden_proto (cairo_scaled_font_glyph_extents); |
2432 | slim_hidden_proto_no_warn (cairo_scaled_font_reference); |
1932 | slim_hidden_proto_no_warn (cairo_scaled_font_reference); |
2433 | slim_hidden_proto (cairo_scaled_font_status); |
1933 | slim_hidden_proto (cairo_scaled_font_status); |
2434 | slim_hidden_proto (cairo_scaled_font_get_user_data); |
1934 | slim_hidden_proto (cairo_scaled_font_get_user_data); |
2435 | slim_hidden_proto (cairo_scaled_font_set_user_data); |
1935 | slim_hidden_proto (cairo_scaled_font_set_user_data); |
2436 | slim_hidden_proto (cairo_scaled_font_text_to_glyphs); |
1936 | slim_hidden_proto (cairo_scaled_font_text_to_glyphs); |
- | 1937 | slim_hidden_proto (cairo_set_font_matrix); |
|
2437 | slim_hidden_proto (cairo_set_font_options); |
1938 | slim_hidden_proto (cairo_set_font_options); |
2438 | slim_hidden_proto (cairo_set_font_size); |
1939 | slim_hidden_proto (cairo_set_font_size); |
2439 | slim_hidden_proto (cairo_set_line_cap); |
1940 | slim_hidden_proto (cairo_set_line_cap); |
2440 | slim_hidden_proto (cairo_set_line_join); |
1941 | slim_hidden_proto (cairo_set_line_join); |
2441 | slim_hidden_proto (cairo_set_line_width); |
1942 | slim_hidden_proto (cairo_set_line_width); |
2442 | slim_hidden_proto (cairo_set_matrix); |
1943 | slim_hidden_proto (cairo_set_matrix); |
2443 | slim_hidden_proto (cairo_set_operator); |
1944 | slim_hidden_proto (cairo_set_operator); |
2444 | slim_hidden_proto (cairo_set_source); |
1945 | slim_hidden_proto (cairo_set_source); |
2445 | slim_hidden_proto (cairo_set_source_rgb); |
1946 | slim_hidden_proto (cairo_set_source_rgb); |
2446 | slim_hidden_proto (cairo_set_source_surface); |
1947 | slim_hidden_proto (cairo_set_source_surface); |
2447 | slim_hidden_proto (cairo_set_tolerance); |
1948 | slim_hidden_proto (cairo_set_tolerance); |
2448 | slim_hidden_proto (cairo_status); |
1949 | slim_hidden_proto (cairo_status); |
2449 | slim_hidden_proto (cairo_stroke); |
1950 | slim_hidden_proto (cairo_stroke); |
2450 | slim_hidden_proto (cairo_stroke_preserve); |
1951 | slim_hidden_proto (cairo_stroke_preserve); |
2451 | slim_hidden_proto (cairo_surface_copy_page); |
1952 | slim_hidden_proto (cairo_surface_copy_page); |
- | 1953 | slim_hidden_proto (cairo_surface_create_similar_image); |
|
2452 | slim_hidden_proto (cairo_surface_destroy); |
1954 | slim_hidden_proto (cairo_surface_destroy); |
2453 | slim_hidden_proto (cairo_surface_finish); |
1955 | slim_hidden_proto (cairo_surface_finish); |
2454 | slim_hidden_proto (cairo_surface_flush); |
1956 | slim_hidden_proto (cairo_surface_flush); |
2455 | slim_hidden_proto (cairo_surface_get_content); |
- | |
2456 | slim_hidden_proto (cairo_surface_get_device_offset); |
1957 | slim_hidden_proto (cairo_surface_get_device_offset); |
2457 | slim_hidden_proto (cairo_surface_get_font_options); |
1958 | slim_hidden_proto (cairo_surface_get_font_options); |
2458 | slim_hidden_proto (cairo_surface_get_mime_data); |
1959 | slim_hidden_proto (cairo_surface_get_mime_data); |
2459 | slim_hidden_proto (cairo_surface_get_type); |
- | |
2460 | slim_hidden_proto (cairo_surface_has_show_text_glyphs); |
1960 | slim_hidden_proto (cairo_surface_has_show_text_glyphs); |
2461 | slim_hidden_proto (cairo_surface_mark_dirty); |
1961 | slim_hidden_proto (cairo_surface_mark_dirty); |
2462 | slim_hidden_proto (cairo_surface_mark_dirty_rectangle); |
1962 | slim_hidden_proto (cairo_surface_mark_dirty_rectangle); |
2463 | slim_hidden_proto_no_warn (cairo_surface_reference); |
1963 | slim_hidden_proto_no_warn (cairo_surface_reference); |
2464 | slim_hidden_proto (cairo_surface_set_device_offset); |
1964 | slim_hidden_proto (cairo_surface_set_device_offset); |
2465 | slim_hidden_proto (cairo_surface_set_fallback_resolution); |
1965 | slim_hidden_proto (cairo_surface_set_fallback_resolution); |
2466 | slim_hidden_proto (cairo_surface_set_mime_data); |
1966 | slim_hidden_proto (cairo_surface_set_mime_data); |
2467 | slim_hidden_proto (cairo_surface_show_page); |
1967 | slim_hidden_proto (cairo_surface_show_page); |
2468 | slim_hidden_proto (cairo_surface_status); |
1968 | slim_hidden_proto (cairo_surface_status); |
- | 1969 | slim_hidden_proto (cairo_surface_supports_mime_type); |
|
2469 | slim_hidden_proto (cairo_text_cluster_allocate); |
1970 | slim_hidden_proto (cairo_text_cluster_allocate); |
2470 | slim_hidden_proto (cairo_text_cluster_free); |
1971 | slim_hidden_proto (cairo_text_cluster_free); |
2471 | slim_hidden_proto (cairo_toy_font_face_create); |
1972 | slim_hidden_proto (cairo_toy_font_face_create); |
2472 | slim_hidden_proto (cairo_toy_font_face_get_slant); |
1973 | slim_hidden_proto (cairo_toy_font_face_get_slant); |
2473 | slim_hidden_proto (cairo_toy_font_face_get_weight); |
1974 | slim_hidden_proto (cairo_toy_font_face_get_weight); |
2474 | slim_hidden_proto (cairo_translate); |
1975 | slim_hidden_proto (cairo_translate); |
2475 | slim_hidden_proto (cairo_transform); |
1976 | slim_hidden_proto (cairo_transform); |
2476 | slim_hidden_proto (cairo_user_font_face_create); |
1977 | slim_hidden_proto (cairo_user_font_face_create); |
2477 | slim_hidden_proto (cairo_user_font_face_set_init_func); |
1978 | slim_hidden_proto (cairo_user_font_face_set_init_func); |
2478 | slim_hidden_proto (cairo_user_font_face_set_render_glyph_func); |
1979 | slim_hidden_proto (cairo_user_font_face_set_render_glyph_func); |
2479 | slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func); |
1980 | slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func); |
- | 1981 | slim_hidden_proto (cairo_device_to_user); |
|
2480 | slim_hidden_proto (cairo_user_to_device); |
1982 | slim_hidden_proto (cairo_user_to_device); |
2481 | slim_hidden_proto (cairo_user_to_device_distance); |
1983 | slim_hidden_proto (cairo_user_to_device_distance); |
2482 | slim_hidden_proto (cairo_version_string); |
1984 | slim_hidden_proto (cairo_version_string); |
2483 | slim_hidden_proto (cairo_region_create); |
1985 | slim_hidden_proto (cairo_region_create); |
2484 | slim_hidden_proto (cairo_region_create_rectangle); |
1986 | slim_hidden_proto (cairo_region_create_rectangle); |
2485 | slim_hidden_proto (cairo_region_create_rectangles); |
1987 | slim_hidden_proto (cairo_region_create_rectangles); |
2486 | slim_hidden_proto (cairo_region_copy); |
1988 | slim_hidden_proto (cairo_region_copy); |
2487 | slim_hidden_proto (cairo_region_reference); |
1989 | slim_hidden_proto (cairo_region_reference); |
2488 | slim_hidden_proto (cairo_region_destroy); |
1990 | slim_hidden_proto (cairo_region_destroy); |
2489 | slim_hidden_proto (cairo_region_equal); |
1991 | slim_hidden_proto (cairo_region_equal); |
2490 | slim_hidden_proto (cairo_region_status); |
1992 | slim_hidden_proto (cairo_region_status); |
2491 | slim_hidden_proto (cairo_region_get_extents); |
1993 | slim_hidden_proto (cairo_region_get_extents); |
2492 | slim_hidden_proto (cairo_region_num_rectangles); |
1994 | slim_hidden_proto (cairo_region_num_rectangles); |
2493 | slim_hidden_proto (cairo_region_get_rectangle); |
1995 | slim_hidden_proto (cairo_region_get_rectangle); |
2494 | slim_hidden_proto (cairo_region_is_empty); |
1996 | slim_hidden_proto (cairo_region_is_empty); |
2495 | slim_hidden_proto (cairo_region_contains_rectangle); |
1997 | slim_hidden_proto (cairo_region_contains_rectangle); |
2496 | slim_hidden_proto (cairo_region_contains_point); |
1998 | slim_hidden_proto (cairo_region_contains_point); |
2497 | slim_hidden_proto (cairo_region_translate); |
1999 | slim_hidden_proto (cairo_region_translate); |
2498 | slim_hidden_proto (cairo_region_subtract); |
2000 | slim_hidden_proto (cairo_region_subtract); |
2499 | slim_hidden_proto (cairo_region_subtract_rectangle); |
2001 | slim_hidden_proto (cairo_region_subtract_rectangle); |
2500 | slim_hidden_proto (cairo_region_intersect); |
2002 | slim_hidden_proto (cairo_region_intersect); |
2501 | slim_hidden_proto (cairo_region_intersect_rectangle); |
2003 | slim_hidden_proto (cairo_region_intersect_rectangle); |
2502 | slim_hidden_proto (cairo_region_union); |
2004 | slim_hidden_proto (cairo_region_union); |
2503 | slim_hidden_proto (cairo_region_union_rectangle); |
2005 | slim_hidden_proto (cairo_region_union_rectangle); |
2504 | slim_hidden_proto (cairo_region_xor); |
2006 | slim_hidden_proto (cairo_region_xor); |
2505 | slim_hidden_proto (cairo_region_xor_rectangle); |
2007 | slim_hidden_proto (cairo_region_xor_rectangle); |
2506 | 2008 | ||
2507 | #if CAIRO_HAS_PNG_FUNCTIONS |
2009 | #if CAIRO_HAS_PNG_FUNCTIONS |
2508 | 2010 | ||
2509 | slim_hidden_proto (cairo_surface_write_to_png_stream); |
2011 | slim_hidden_proto (cairo_surface_write_to_png_stream); |
2510 | 2012 | ||
2511 | #endif |
2013 | #endif |
2512 | 2014 | ||
2513 | cairo_private_no_warn cairo_filter_t |
2015 | cairo_private_no_warn cairo_filter_t |
2514 | _cairo_pattern_analyze_filter (const cairo_pattern_t *pattern, |
2016 | _cairo_pattern_analyze_filter (const cairo_pattern_t *pattern, |
2515 | double *pad_out); |
2017 | double *pad_out); |
2516 | 2018 | ||
2517 | CAIRO_END_DECLS |
2019 | CAIRO_END_DECLS |
2518 | 2020 | ||
2519 | #include "cairo-mutex-private.h" |
2021 | #include "cairo-mutex-private.h" |
2520 | #include "cairo-fixed-private.h" |
2022 | #include "cairo-fixed-private.h" |
2521 | #include "cairo-wideint-private.h" |
2023 | #include "cairo-wideint-private.h" |
2522 | #include "cairo-malloc-private.h" |
2024 | #include "cairo-malloc-private.h" |
2523 | #include "cairo-hash-private.h" |
2025 | #include "cairo-hash-private.h" |
2524 | 2026 | ||
2525 | #if HAVE_VALGRIND |
2027 | #if HAVE_VALGRIND |
2526 | #include |
2028 | #include |
2527 | 2029 | ||
2528 | #define VG(x) x |
2030 | #define VG(x) x |
2529 | 2031 | ||
2530 | cairo_private void |
2032 | cairo_private void |
2531 | _cairo_debug_check_image_surface_is_defined (const cairo_surface_t *surface); |
2033 | _cairo_debug_check_image_surface_is_defined (const cairo_surface_t *surface); |
2532 | 2034 | ||
2533 | #else |
2035 | #else |
2534 | 2036 | ||
2535 | #define VG(x) |
2037 | #define VG(x) |
2536 | #define _cairo_debug_check_image_surface_is_defined(X) |
2038 | #define _cairo_debug_check_image_surface_is_defined(X) |
2537 | 2039 | ||
2538 | #endif |
2040 | #endif |
2539 | 2041 | ||
2540 | cairo_private void |
2042 | cairo_private void |
2541 | _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path); |
2043 | _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path); |
2542 | 2044 | ||
2543 | cairo_private void |
2045 | cairo_private void |
- | 2046 | _cairo_debug_print_polygon (FILE *stream, cairo_polygon_t *polygon); |
|
- | 2047 | ||
- | 2048 | cairo_private void |
|
- | 2049 | _cairo_debug_print_traps (FILE *file, const cairo_traps_t *traps); |
|
- | 2050 | ||
- | 2051 | cairo_private void |
|
2544 | _cairo_debug_print_clip (FILE *stream, cairo_clip_t *clip); |
2052 | _cairo_debug_print_clip (FILE *stream, const cairo_clip_t *clip); |
- | 2053 | ||
- | 2054 | #if 0 |
|
- | 2055 | #define TRACE(x) fprintf (stderr, "%s: ", __FILE__), fprintf x |
|
- | 2056 | #define TRACE_(x) x |
|
- | 2057 | #else |
|
- | 2058 | #define TRACE(x) |
|
- | 2059 | #define TRACE_(x) |
|
- | 2060 | #endif |
|
2545 | 2061 | ||
2546 | #endif=>><>><>>><>><>><>><>=>=>><>><>=>=>=>> |
2062 | #endif=>=>><>><>>><>><>><>><>=>=>=>=>=>=>><>><>=>=>=>> |