1 /* cairo - a vector graphics library with display and print output
3 * Copyright © 2002 University of Southern California
4 * Copyright © 2005 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it either under the terms of the GNU Lesser General Public
8 * License version 2.1 as published by the Free Software Foundation
9 * (the "LGPL") or, at your option, under the terms of the Mozilla
10 * Public License Version 1.1 (the "MPL"). If you do not alter this
11 * notice, a recipient may use your version of this file under either
12 * the MPL or the LGPL.
14 * You should have received a copy of the LGPL along with this library
15 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
17 * You should have received a copy of the MPL along with this library
18 * in the file COPYING-MPL-1.1
20 * The contents of this file are subject to the Mozilla Public License
21 * Version 1.1 (the "License"); you may not use this file except in
22 * compliance with the License. You may obtain a copy of the License at
23 * http://www.mozilla.org/MPL/
25 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
26 * OF ANY KIND, either express or implied. See the LGPL or the MPL for
27 * the specific language governing rights and limitations.
29 * The Original Code is the cairo graphics library.
31 * The Initial Developer of the Original Code is University of Southern
35 * Carl D. Worth <cworth@cworth.org>
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
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
43 * existing published interfaces. cworth@cworth.org
54 #define cairo_public __declspec(dllexport)
64 #define _USE_MATH_DEFINES
73 #include "cairo-compiler-private.h"
74 #include "cairo-error-private.h"
76 #if CAIRO_HAS_PDF_SURFACE || \
77 CAIRO_HAS_PS_SURFACE || \
78 CAIRO_HAS_SCRIPT_SURFACE || \
80 #define CAIRO_HAS_DEFLATE_STREAM 1
83 #if CAIRO_HAS_PS_SURFACE || \
84 CAIRO_HAS_PDF_SURFACE || \
85 CAIRO_HAS_SVG_SURFACE || \
86 CAIRO_HAS_WIN32_SURFACE
87 #define CAIRO_HAS_FONT_SUBSET 1
90 #if CAIRO_HAS_PS_SURFACE || \
91 CAIRO_HAS_PDF_SURFACE || \
93 #define CAIRO_HAS_PDF_OPERATORS 1
98 #if _WIN32 && !_WIN32_WCE /* Permissions on WinCE? No worries! */
100 _cairo_win32_tmpfile (void);
101 #define tmpfile() _cairo_win32_tmpfile()
105 #define MIN(a, b) ((a) < (b) ? (a) : (b))
108 #define MAX(a, b) ((a) > (b) ? (a) : (b))
119 #define M_PI 3.14159265358979323846
123 #define M_SQRT2 1.41421356237309504880
127 #define M_SQRT1_2 0.707106781186547524400844362104849039
131 #define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
135 #define STRINGIFY(macro_or_string) STRINGIFY_ARG (macro_or_string)
136 #define STRINGIFY_ARG(contents) #contents
138 #if defined (__GNUC__)
139 #define cairo_container_of(ptr, type, member) ({ \
140 const __typeof__ (((type *) 0)->member) *mptr__ = (ptr); \
141 (type *) ((char *) mptr__ - offsetof (type, member)); \
144 #define cairo_container_of(ptr, type, member) \
145 ((type *)((char *) (ptr) - (char *) &((type *)0)->member))
149 #define ASSERT_NOT_REACHED \
151 assert (!"reached"); \
153 #define COMPILE_TIME_ASSERT1(condition, line) \
154 typedef int compile_time_assertion_at_line_##line##_failed [(condition)?1:-1]
155 #define COMPILE_TIME_ASSERT0(condition, line) COMPILE_TIME_ASSERT1(condition, line)
156 #define COMPILE_TIME_ASSERT(condition) COMPILE_TIME_ASSERT0(condition, __LINE__)
158 #define CAIRO_ALPHA_IS_CLEAR(alpha) ((alpha) <= ((double)0x00ff / (double)0xffff))
159 #define CAIRO_ALPHA_SHORT_IS_CLEAR(alpha) ((alpha) <= 0x00ff)
161 #define CAIRO_ALPHA_IS_OPAQUE(alpha) ((alpha) >= ((double)0xff00 / (double)0xffff))
162 #define CAIRO_ALPHA_SHORT_IS_OPAQUE(alpha) ((alpha) >= 0xff00)
163 #define CAIRO_ALPHA_IS_ZERO(alpha) ((alpha) <= 0.0)
165 #define CAIRO_COLOR_IS_CLEAR(color) CAIRO_ALPHA_SHORT_IS_CLEAR ((color)->alpha_short)
166 #define CAIRO_COLOR_IS_OPAQUE(color) CAIRO_ALPHA_SHORT_IS_OPAQUE ((color)->alpha_short)
168 /* Reverse the bits in a byte with 7 operations (no 64-bit):
169 * Devised by Sean Anderson, July 13, 2001.
170 * Source: http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith32Bits
172 #define CAIRO_BITSWAP8(c) ((((c) * 0x0802LU & 0x22110LU) | ((c) * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16)
174 /* Return the number of 1 bits in mask.
176 * GCC 3.4 supports a "population count" builtin, which on many targets is
177 * implemented with a single instruction. There is a fallback definition
178 * in libgcc in case a target does not have one, which should be just as
179 * good as the open-coded solution below, (which is "HACKMEM 169").
181 static inline int cairo_const
182 _cairo_popcount (uint32_t mask
)
184 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
185 return __builtin_popcount (mask
);
189 y
= (mask
>> 1) &033333333333;
190 y
= mask
- y
- ((y
>>1) & 033333333333);
191 return (((y
+ (y
>> 3)) & 030707070707) % 077);
195 static cairo_always_inline cairo_bool_t
196 _cairo_is_little_endian (void)
198 static const int i
= 1;
199 return *((char *) &i
) == 0x01;
202 #ifdef WORDS_BIGENDIAN
203 #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) (c)
205 #define CAIRO_BITSWAP8_IF_LITTLE_ENDIAN(c) CAIRO_BITSWAP8(c)
208 #ifdef WORDS_BIGENDIAN
210 #define cpu_to_be16(v) (v)
211 #define be16_to_cpu(v) (v)
212 #define cpu_to_be32(v) (v)
213 #define be32_to_cpu(v) (v)
217 static inline uint16_t cairo_const
218 cpu_to_be16(uint16_t v
)
220 return (v
<< 8) | (v
>> 8);
223 static inline uint16_t cairo_const
224 be16_to_cpu(uint16_t v
)
226 return cpu_to_be16 (v
);
229 static inline uint32_t cairo_const
230 cpu_to_be32(uint32_t v
)
232 return (v
>> 24) | ((v
>> 8) & 0xff00) | ((v
<< 8) & 0xff0000) | (v
<< 24);
235 static inline uint32_t cairo_const
236 be32_to_cpu(uint32_t v
)
238 return cpu_to_be32 (v
);
243 /* Unaligned big endian access
246 static inline uint16_t get_unaligned_be16 (const unsigned char *p
)
248 return p
[0] << 8 | p
[1];
251 static inline uint32_t get_unaligned_be32 (const unsigned char *p
)
253 return p
[0] << 24 | p
[1] << 16 | p
[2] << 8 | p
[3];
256 static inline void put_unaligned_be16 (uint16_t v
, unsigned char *p
)
258 p
[0] = (v
>> 8) & 0xff;
262 static inline void put_unaligned_be32 (uint32_t v
, unsigned char *p
)
264 p
[0] = (v
>> 24) & 0xff;
265 p
[1] = (v
>> 16) & 0xff;
266 p
[2] = (v
>> 8) & 0xff;
270 /* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales.
273 static inline int cairo_const
274 _cairo_isspace (int c
)
276 return (c
== 0x20 || (c
>= 0x09 && c
<= 0x0d));
279 static inline int cairo_const
280 _cairo_isdigit (int c
)
282 return (c
>= '0' && c
<= '9');
285 #include "cairo-types-private.h"
286 #include "cairo-cache-private.h"
287 #include "cairo-reference-count-private.h"
288 #include "cairo-spans-private.h"
289 #include "cairo-surface-private.h"
292 _cairo_box_from_doubles (cairo_box_t
*box
,
293 double *x1
, double *y1
,
294 double *x2
, double *y2
);
297 _cairo_box_to_doubles (const cairo_box_t
*box
,
298 double *x1
, double *y1
,
299 double *x2
, double *y2
);
302 _cairo_box_from_rectangle (cairo_box_t
*box
,
303 const cairo_rectangle_int_t
*rectangle
);
306 _cairo_box_round_to_rectangle (const cairo_box_t
*box
,
307 cairo_rectangle_int_t
*rectangle
);
310 _cairo_box_add_curve_to (cairo_box_t
*extents
,
311 const cairo_point_t
*a
,
312 const cairo_point_t
*b
,
313 const cairo_point_t
*c
,
314 const cairo_point_t
*d
);
317 _cairo_boxes_get_extents (const cairo_box_t
*boxes
,
319 cairo_box_t
*extents
);
321 cairo_private
extern const cairo_rectangle_int_t _cairo_empty_rectangle
;
322 cairo_private
extern const cairo_rectangle_int_t _cairo_unbounded_rectangle
;
325 _cairo_unbounded_rectangle_init (cairo_rectangle_int_t
*rect
)
327 *rect
= _cairo_unbounded_rectangle
;
330 cairo_private_no_warn cairo_bool_t
331 _cairo_rectangle_intersect (cairo_rectangle_int_t
*dst
,
332 const cairo_rectangle_int_t
*src
);
334 static inline cairo_bool_t
335 _cairo_rectangle_intersects (const cairo_rectangle_int_t
*dst
,
336 const cairo_rectangle_int_t
*src
)
338 return !(src
->x
>= dst
->x
+ (int) dst
->width
||
339 src
->x
+ (int) src
->width
<= dst
->x
||
340 src
->y
>= dst
->y
+ (int) dst
->height
||
341 src
->y
+ (int) src
->height
<= dst
->y
);
344 static inline cairo_bool_t
345 _cairo_rectangle_contains_rectangle (const cairo_rectangle_int_t
*a
,
346 const cairo_rectangle_int_t
*b
)
348 return (a
->x
<= b
->x
&&
349 a
->x
+ (int) a
->width
>= b
->x
+ (int) b
->width
&&
351 a
->y
+ (int) a
->height
>= b
->y
+ (int) b
->height
);
355 _cairo_rectangle_int_from_double (cairo_rectangle_int_t
*recti
,
356 const cairo_rectangle_t
*rectf
);
358 /* Extends the dst rectangle to also contain src.
359 * If one of the rectangles is empty, the result is undefined
362 _cairo_rectangle_union (cairo_rectangle_int_t
*dst
,
363 const cairo_rectangle_int_t
*src
);
365 cairo_private cairo_bool_t
366 _cairo_box_intersects_line_segment (const cairo_box_t
*box
,
367 cairo_line_t
*line
) cairo_pure
;
369 cairo_private cairo_bool_t
370 _cairo_spline_intersects (const cairo_point_t
*a
,
371 const cairo_point_t
*b
,
372 const cairo_point_t
*c
,
373 const cairo_point_t
*d
,
374 const cairo_box_t
*box
) cairo_pure
;
377 const cairo_user_data_key_t
*key
;
379 cairo_destroy_func_t destroy
;
380 } cairo_user_data_slot_t
;
383 _cairo_user_data_array_init (cairo_user_data_array_t
*array
);
386 _cairo_user_data_array_fini (cairo_user_data_array_t
*array
);
389 _cairo_user_data_array_get_data (cairo_user_data_array_t
*array
,
390 const cairo_user_data_key_t
*key
);
392 cairo_private cairo_status_t
393 _cairo_user_data_array_set_data (cairo_user_data_array_t
*array
,
394 const cairo_user_data_key_t
*key
,
396 cairo_destroy_func_t destroy
);
398 cairo_private cairo_status_t
399 _cairo_user_data_array_copy (cairo_user_data_array_t
*dst
,
400 const cairo_user_data_array_t
*src
);
403 _cairo_user_data_array_foreach (cairo_user_data_array_t
*array
,
404 void (*func
) (const void *key
,
409 #define _CAIRO_HASH_INIT_VALUE 5381
411 cairo_private
unsigned long
412 _cairo_hash_string (const char *c
);
414 cairo_private
unsigned long
415 _cairo_hash_bytes (unsigned long hash
,
417 unsigned int length
);
419 #define _cairo_scaled_glyph_index(g) ((g)->hash_entry.hash)
420 #define _cairo_scaled_glyph_set_index(g, i) ((g)->hash_entry.hash = (i))
422 #include "cairo-scaled-font-private.h"
424 struct _cairo_font_face
{
425 /* hash_entry must be first */
426 cairo_hash_entry_t hash_entry
;
427 cairo_status_t status
;
428 cairo_reference_count_t ref_count
;
429 cairo_user_data_array_t user_data
;
430 const cairo_font_face_backend_t
*backend
;
434 _cairo_default_context_reset_static_data (void);
437 _cairo_toy_font_face_reset_static_data (void);
440 _cairo_ft_font_reset_static_data (void);
443 _cairo_win32_font_reset_static_data (void);
445 #if CAIRO_HAS_COGL_SURFACE
447 _cairo_cogl_context_reset_static_data (void);
450 /* the font backend interface */
452 struct _cairo_unscaled_font_backend
{
453 cairo_bool_t (*destroy
) (void *unscaled_font
);
456 /* #cairo_toy_font_face_t - simple family/slant/weight font faces used for
457 * the built-in font API
460 typedef struct _cairo_toy_font_face
{
461 cairo_font_face_t base
;
463 cairo_bool_t owns_family
;
464 cairo_font_slant_t slant
;
465 cairo_font_weight_t weight
;
467 cairo_font_face_t
*impl_face
; /* The non-toy font face this actually uses */
468 } cairo_toy_font_face_t
;
470 typedef enum _cairo_scaled_glyph_info
{
471 CAIRO_SCALED_GLYPH_INFO_METRICS
= (1 << 0),
472 CAIRO_SCALED_GLYPH_INFO_SURFACE
= (1 << 1),
473 CAIRO_SCALED_GLYPH_INFO_PATH
= (1 << 2),
474 CAIRO_SCALED_GLYPH_INFO_RECORDING_SURFACE
= (1 << 3)
475 } cairo_scaled_glyph_info_t
;
477 typedef struct _cairo_scaled_font_subset
{
478 cairo_scaled_font_t
*scaled_font
;
479 unsigned int font_id
;
480 unsigned int subset_id
;
482 /* Index of glyphs array is subset_glyph_index.
483 * Value of glyphs array is scaled_font_glyph_index.
485 unsigned long *glyphs
;
489 unsigned long *latin_to_subset_glyph_index
;
490 unsigned int num_glyphs
;
491 cairo_bool_t is_composite
;
492 cairo_bool_t is_scaled
;
493 cairo_bool_t is_latin
;
494 } cairo_scaled_font_subset_t
;
496 struct _cairo_scaled_font_backend
{
497 cairo_font_type_t type
;
500 (*fini
) (void *scaled_font
);
502 cairo_warn cairo_int_status_t
503 (*scaled_glyph_init
) (void *scaled_font
,
504 cairo_scaled_glyph_t
*scaled_glyph
,
505 cairo_scaled_glyph_info_t info
);
507 /* A backend only needs to implement this or ucs4_to_index(), not
508 * both. This allows the backend to do something more sophisticated
509 * then just converting characters one by one.
511 cairo_warn cairo_int_status_t
512 (*text_to_glyphs
) (void *scaled_font
,
517 cairo_glyph_t
**glyphs
,
519 cairo_text_cluster_t
**clusters
,
521 cairo_text_cluster_flags_t
*cluster_flags
);
524 (*ucs4_to_index
) (void *scaled_font
,
527 /* Read data from a sfnt font table.
529 * @tag: 4 byte table name specifying the table to read.
530 * @offset: offset into the table
531 * @buffer: buffer to write data into. Caller must ensure there is sufficient space.
532 * If NULL, return the size of the table in @length.
533 * @length: If @buffer is NULL, the size of the table will be returned in @length.
534 * If @buffer is not null, @length specifies the number of bytes to read.
536 * If less than @length bytes are available to read this function
537 * returns CAIRO_INT_STATUS_UNSUPPORTED. Note that requesting more
538 * bytes than are available in the table may continue reading data
539 * from the following table and return success. If this is
540 * undesirable the caller should first query the table size. If an
541 * error occurs the output value of @length is undefined.
543 * Returns CAIRO_INT_STATUS_UNSUPPORTED if not a sfnt style font or table not found.
545 cairo_warn cairo_int_status_t
546 (*load_truetype_table
)(void *scaled_font
,
549 unsigned char *buffer
,
550 unsigned long *length
);
552 /* ucs4 is set to -1 if the unicode character could not be found
554 cairo_warn cairo_int_status_t
555 (*index_to_ucs4
)(void *scaled_font
,
559 cairo_warn cairo_bool_t
560 (*is_synthetic
)(void *scaled_font
);
562 /* For type 1 fonts, return the glyph name for a given glyph index.
563 * A glyph index and list of glyph names in the Type 1 fonts is provided.
564 * The function returns the index of the glyph in the list of glyph names.
566 * @glyph_names: the names of each glyph in the Type 1 font in the
567 * order they appear in the CharStrings array
568 * @num_glyph_names: the number of names in the glyph_names array
569 * @glyph_index: the given glyph index
570 * @glyph_array_index: (index into glyph_names) the glyph name corresponding
574 cairo_warn cairo_int_status_t
575 (*index_to_glyph_name
)(void *scaled_font
,
578 unsigned long glyph_index
,
579 unsigned long *glyph_array_index
);
581 /* Read data from a PostScript font.
583 * @offset: offset into the table
584 * @buffer: buffer to write data into. Caller must ensure there is sufficient space.
585 * If NULL, return the size of the table in @length.
586 * @length: If @buffer is NULL, the size of the table will be returned in @length.
587 * If @buffer is not null, @length specifies the number of bytes to read.
589 * If less than @length bytes are available to read this function
590 * returns CAIRO_INT_STATUS_UNSUPPORTED. If an error occurs the
591 * output value of @length is undefined.
593 * Returns CAIRO_INT_STATUS_UNSUPPORTED if not a Type 1 font.
595 cairo_warn cairo_int_status_t
596 (*load_type1_data
) (void *scaled_font
,
598 unsigned char *buffer
,
599 unsigned long *length
);
602 struct _cairo_font_face_backend
{
603 cairo_font_type_t type
;
605 cairo_warn cairo_status_t
606 (*create_for_toy
) (cairo_toy_font_face_t
*toy_face
,
607 cairo_font_face_t
**font_face
);
609 /* The destroy() function is allowed to resurrect the font face
610 * by re-referencing. This is needed for the FreeType backend.
613 (*destroy
) (void *font_face
);
615 cairo_warn cairo_status_t
616 (*scaled_font_create
) (void *font_face
,
617 const cairo_matrix_t
*font_matrix
,
618 const cairo_matrix_t
*ctm
,
619 const cairo_font_options_t
*options
,
620 cairo_scaled_font_t
**scaled_font
);
623 (*get_implementation
) (void *font_face
,
624 const cairo_matrix_t
*font_matrix
,
625 const cairo_matrix_t
*ctm
,
626 const cairo_font_options_t
*options
);
629 extern const cairo_private
struct _cairo_font_face_backend _cairo_user_font_face_backend
;
631 /* concrete font backends */
632 #if CAIRO_HAS_FT_FONT
634 extern const cairo_private
struct _cairo_font_face_backend _cairo_ft_font_face_backend
;
638 #if CAIRO_HAS_WIN32_FONT
640 extern const cairo_private
struct _cairo_font_face_backend _cairo_win32_font_face_backend
;
644 #if CAIRO_HAS_QUARTZ_FONT
646 extern const cairo_private
struct _cairo_font_face_backend _cairo_quartz_font_face_backend
;
650 #define CAIRO_EXTEND_SURFACE_DEFAULT CAIRO_EXTEND_NONE
651 #define CAIRO_EXTEND_GRADIENT_DEFAULT CAIRO_EXTEND_PAD
652 #define CAIRO_FILTER_DEFAULT CAIRO_FILTER_GOOD
654 extern const cairo_private cairo_solid_pattern_t _cairo_pattern_clear
;
655 extern const cairo_private cairo_solid_pattern_t _cairo_pattern_black
;
656 extern const cairo_private cairo_solid_pattern_t _cairo_pattern_white
;
658 struct _cairo_surface_attributes
{
659 cairo_matrix_t matrix
;
660 cairo_extend_t extend
;
661 cairo_filter_t filter
;
662 cairo_bool_t has_component_alpha
;
668 #define CAIRO_FONT_SLANT_DEFAULT CAIRO_FONT_SLANT_NORMAL
669 #define CAIRO_FONT_WEIGHT_DEFAULT CAIRO_FONT_WEIGHT_NORMAL
671 #define CAIRO_WIN32_FONT_FAMILY_DEFAULT "Arial"
672 #define CAIRO_QUARTZ_FONT_FAMILY_DEFAULT "Helvetica"
673 #define CAIRO_FT_FONT_FAMILY_DEFAULT ""
674 #define CAIRO_USER_FONT_FAMILY_DEFAULT "@cairo:"
676 #if CAIRO_HAS_WIN32_FONT
678 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_WIN32_FONT_FAMILY_DEFAULT
679 #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_win32_font_face_backend
681 #elif CAIRO_HAS_QUARTZ_FONT
683 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_QUARTZ_FONT_FAMILY_DEFAULT
684 #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_quartz_font_face_backend
686 #elif CAIRO_HAS_FT_FONT
688 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT
689 #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_ft_font_face_backend
693 #define CAIRO_FONT_FAMILY_DEFAULT CAIRO_FT_FONT_FAMILY_DEFAULT
694 #define CAIRO_FONT_FACE_BACKEND_DEFAULT &_cairo_user_font_face_backend
698 #define CAIRO_GSTATE_OPERATOR_DEFAULT CAIRO_OPERATOR_OVER
699 #define CAIRO_GSTATE_TOLERANCE_DEFAULT 0.1
700 #define CAIRO_GSTATE_FILL_RULE_DEFAULT CAIRO_FILL_RULE_WINDING
701 #define CAIRO_GSTATE_LINE_WIDTH_DEFAULT 2.0
702 #define CAIRO_GSTATE_LINE_CAP_DEFAULT CAIRO_LINE_CAP_BUTT
703 #define CAIRO_GSTATE_LINE_JOIN_DEFAULT CAIRO_LINE_JOIN_MITER
704 #define CAIRO_GSTATE_MITER_LIMIT_DEFAULT 10.0
705 #define CAIRO_GSTATE_DEFAULT_FONT_SIZE 10.0
707 #define CAIRO_SURFACE_RESOLUTION_DEFAULT 72.0
708 #define CAIRO_SURFACE_FALLBACK_RESOLUTION_DEFAULT 300.0
710 typedef struct _cairo_stroke_face
{
714 cairo_slope_t dev_vector
;
715 cairo_point_double_t dev_slope
;
716 cairo_point_double_t usr_vector
;
718 } cairo_stroke_face_t
;
722 static inline double cairo_const
723 _cairo_restrict_value (double value
, double min
, double max
)
727 else if (value
> max
)
733 /* C99 round() rounds to the nearest integral value with halfway cases rounded
734 * away from 0. _cairo_round rounds halfway cases toward positive infinity.
735 * This matches the rounding behaviour of _cairo_lround. */
736 static inline double cairo_const
737 _cairo_round (double r
)
739 return floor (r
+ .5);
742 #if DISABLE_SOME_FLOATING_POINT
744 _cairo_lround (double d
) cairo_const
;
746 static inline int cairo_const
747 _cairo_lround (double r
)
749 return _cairo_round (r
);
753 cairo_private
uint16_t
754 _cairo_half_from_float (float f
) cairo_const
;
756 cairo_private cairo_bool_t
757 _cairo_operator_bounded_by_mask (cairo_operator_t op
) cairo_const
;
759 cairo_private cairo_bool_t
760 _cairo_operator_bounded_by_source (cairo_operator_t op
) cairo_const
;
763 CAIRO_OPERATOR_BOUND_BY_MASK
= 1 << 1,
764 CAIRO_OPERATOR_BOUND_BY_SOURCE
= 1 << 2,
767 cairo_private
uint32_t
768 _cairo_operator_bounded_by_either (cairo_operator_t op
) cairo_const
;
770 cairo_private
const cairo_color_t
*
771 _cairo_stock_color (cairo_stock_t stock
) cairo_pure
;
773 #define CAIRO_COLOR_WHITE _cairo_stock_color (CAIRO_STOCK_WHITE)
774 #define CAIRO_COLOR_BLACK _cairo_stock_color (CAIRO_STOCK_BLACK)
775 #define CAIRO_COLOR_TRANSPARENT _cairo_stock_color (CAIRO_STOCK_TRANSPARENT)
777 cairo_private
uint16_t
778 _cairo_color_double_to_short (double d
) cairo_const
;
781 _cairo_color_init_rgba (cairo_color_t
*color
,
782 double red
, double green
, double blue
,
786 _cairo_color_multiply_alpha (cairo_color_t
*color
,
790 _cairo_color_get_rgba (cairo_color_t
*color
,
797 _cairo_color_get_rgba_premultiplied (cairo_color_t
*color
,
803 cairo_private cairo_bool_t
804 _cairo_color_equal (const cairo_color_t
*color_a
,
805 const cairo_color_t
*color_b
) cairo_pure
;
807 cairo_private cairo_bool_t
808 _cairo_color_stop_equal (const cairo_color_stop_t
*color_a
,
809 const cairo_color_stop_t
*color_b
) cairo_pure
;
811 cairo_private cairo_content_t
812 _cairo_color_get_content (const cairo_color_t
*color
) cairo_pure
;
814 /* cairo-font-face.c */
816 extern const cairo_private cairo_font_face_t _cairo_font_face_nil
;
817 extern const cairo_private cairo_font_face_t _cairo_font_face_nil_file_not_found
;
820 _cairo_font_face_init (cairo_font_face_t
*font_face
,
821 const cairo_font_face_backend_t
*backend
);
823 cairo_private cairo_bool_t
824 _cairo_font_face_destroy (void *abstract_face
);
826 cairo_private cairo_status_t
827 _cairo_font_face_set_error (cairo_font_face_t
*font_face
,
828 cairo_status_t status
);
831 _cairo_unscaled_font_init (cairo_unscaled_font_t
*font
,
832 const cairo_unscaled_font_backend_t
*backend
);
834 cairo_private_no_warn cairo_unscaled_font_t
*
835 _cairo_unscaled_font_reference (cairo_unscaled_font_t
*font
);
838 _cairo_unscaled_font_destroy (cairo_unscaled_font_t
*font
);
840 /* cairo-font-face-twin.c */
842 cairo_private cairo_font_face_t
*
843 _cairo_font_face_twin_create_fallback (void);
845 cairo_private cairo_status_t
846 _cairo_font_face_twin_create_for_toy (cairo_toy_font_face_t
*toy_face
,
847 cairo_font_face_t
**font_face
);
849 /* cairo-font-face-twin-data.c */
851 extern const cairo_private
int8_t _cairo_twin_outlines
[];
852 extern const cairo_private
uint16_t _cairo_twin_charmap
[128];
854 /* cairo-font-options.c */
857 _cairo_font_options_init_default (cairo_font_options_t
*options
);
860 _cairo_font_options_init_copy (cairo_font_options_t
*options
,
861 const cairo_font_options_t
*other
);
864 _cairo_font_options_set_lcd_filter (cairo_font_options_t
*options
,
865 cairo_lcd_filter_t lcd_filter
);
867 cairo_private cairo_lcd_filter_t
868 _cairo_font_options_get_lcd_filter (const cairo_font_options_t
*options
);
871 _cairo_font_options_set_round_glyph_positions (cairo_font_options_t
*options
,
872 cairo_round_glyph_positions_t round
);
874 cairo_private cairo_round_glyph_positions_t
875 _cairo_font_options_get_round_glyph_positions (const cairo_font_options_t
*options
);
878 cairo_private cairo_status_t
879 _cairo_hull_compute (cairo_pen_vertex_t
*vertices
, int *num_vertices
);
882 cairo_private
unsigned char *
883 _cairo_lzw_compress (unsigned char *data
, unsigned long *size_in_out
);
886 cairo_private cairo_status_t
887 _cairo_validate_text_clusters (const char *utf8
,
889 const cairo_glyph_t
*glyphs
,
891 const cairo_text_cluster_t
*clusters
,
893 cairo_text_cluster_flags_t cluster_flags
);
895 cairo_private cairo_status_t
896 _cairo_intern_string (const char **str_inout
, int len
);
899 _cairo_intern_string_reset_static_data (void);
901 cairo_private
const char *
902 cairo_get_locale_decimal_point (void);
904 /* cairo-path-fixed.c */
905 cairo_private cairo_path_fixed_t
*
906 _cairo_path_fixed_create (void);
909 _cairo_path_fixed_init (cairo_path_fixed_t
*path
);
911 cairo_private cairo_status_t
912 _cairo_path_fixed_init_copy (cairo_path_fixed_t
*path
,
913 const cairo_path_fixed_t
*other
);
916 _cairo_path_fixed_fini (cairo_path_fixed_t
*path
);
919 _cairo_path_fixed_destroy (cairo_path_fixed_t
*path
);
921 cairo_private cairo_status_t
922 _cairo_path_fixed_move_to (cairo_path_fixed_t
*path
,
927 _cairo_path_fixed_new_sub_path (cairo_path_fixed_t
*path
);
929 cairo_private cairo_status_t
930 _cairo_path_fixed_rel_move_to (cairo_path_fixed_t
*path
,
934 cairo_private cairo_status_t
935 _cairo_path_fixed_line_to (cairo_path_fixed_t
*path
,
939 cairo_private cairo_status_t
940 _cairo_path_fixed_rel_line_to (cairo_path_fixed_t
*path
,
944 cairo_private cairo_status_t
945 _cairo_path_fixed_curve_to (cairo_path_fixed_t
*path
,
946 cairo_fixed_t x0
, cairo_fixed_t y0
,
947 cairo_fixed_t x1
, cairo_fixed_t y1
,
948 cairo_fixed_t x2
, cairo_fixed_t y2
);
950 cairo_private cairo_status_t
951 _cairo_path_fixed_rel_curve_to (cairo_path_fixed_t
*path
,
952 cairo_fixed_t dx0
, cairo_fixed_t dy0
,
953 cairo_fixed_t dx1
, cairo_fixed_t dy1
,
954 cairo_fixed_t dx2
, cairo_fixed_t dy2
);
956 cairo_private cairo_status_t
957 _cairo_path_fixed_close_path (cairo_path_fixed_t
*path
);
959 cairo_private cairo_bool_t
960 _cairo_path_fixed_get_current_point (cairo_path_fixed_t
*path
,
964 typedef cairo_status_t
965 (cairo_path_fixed_move_to_func_t
) (void *closure
,
966 const cairo_point_t
*point
);
968 typedef cairo_status_t
969 (cairo_path_fixed_line_to_func_t
) (void *closure
,
970 const cairo_point_t
*point
);
972 typedef cairo_status_t
973 (cairo_path_fixed_curve_to_func_t
) (void *closure
,
974 const cairo_point_t
*p0
,
975 const cairo_point_t
*p1
,
976 const cairo_point_t
*p2
);
978 typedef cairo_status_t
979 (cairo_path_fixed_close_path_func_t
) (void *closure
);
981 cairo_private cairo_status_t
982 _cairo_path_fixed_interpret (const cairo_path_fixed_t
*path
,
983 cairo_path_fixed_move_to_func_t
*move_to
,
984 cairo_path_fixed_line_to_func_t
*line_to
,
985 cairo_path_fixed_curve_to_func_t
*curve_to
,
986 cairo_path_fixed_close_path_func_t
*close_path
,
989 cairo_private cairo_status_t
990 _cairo_path_fixed_interpret_flat (const cairo_path_fixed_t
*path
,
991 cairo_path_fixed_move_to_func_t
*move_to
,
992 cairo_path_fixed_line_to_func_t
*line_to
,
993 cairo_path_fixed_close_path_func_t
*close_path
,
998 cairo_private cairo_bool_t
999 _cairo_path_bounder_extents (const cairo_path_fixed_t
*path
,
1002 cairo_private cairo_bool_t
1003 _cairo_path_fixed_extents (const cairo_path_fixed_t
*path
,
1007 _cairo_path_fixed_approximate_clip_extents (const cairo_path_fixed_t
*path
,
1008 cairo_rectangle_int_t
*extents
);
1011 _cairo_path_fixed_approximate_fill_extents (const cairo_path_fixed_t
*path
,
1012 cairo_rectangle_int_t
*extents
);
1015 _cairo_path_fixed_fill_extents (const cairo_path_fixed_t
*path
,
1016 cairo_fill_rule_t fill_rule
,
1018 cairo_rectangle_int_t
*extents
);
1021 _cairo_path_fixed_approximate_stroke_extents (const cairo_path_fixed_t
*path
,
1022 const cairo_stroke_style_t
*style
,
1023 const cairo_matrix_t
*ctm
,
1024 cairo_rectangle_int_t
*extents
);
1026 cairo_private cairo_status_t
1027 _cairo_path_fixed_stroke_extents (const cairo_path_fixed_t
*path
,
1028 const cairo_stroke_style_t
*style
,
1029 const cairo_matrix_t
*ctm
,
1030 const cairo_matrix_t
*ctm_inverse
,
1032 cairo_rectangle_int_t
*extents
);
1035 _cairo_path_fixed_transform (cairo_path_fixed_t
*path
,
1036 const cairo_matrix_t
*matrix
);
1038 cairo_private cairo_bool_t
1039 _cairo_path_fixed_is_box (const cairo_path_fixed_t
*path
,
1042 cairo_private cairo_bool_t
1043 _cairo_path_fixed_is_rectangle (const cairo_path_fixed_t
*path
,
1046 /* cairo-path-in-fill.c */
1047 cairo_private cairo_bool_t
1048 _cairo_path_fixed_in_fill (const cairo_path_fixed_t
*path
,
1049 cairo_fill_rule_t fill_rule
,
1054 /* cairo-path-fill.c */
1055 cairo_private cairo_status_t
1056 _cairo_path_fixed_fill_to_polygon (const cairo_path_fixed_t
*path
,
1058 cairo_polygon_t
*polygon
);
1060 cairo_private cairo_status_t
1061 _cairo_path_fixed_fill_rectilinear_to_polygon (const cairo_path_fixed_t
*path
,
1062 cairo_antialias_t antialias
,
1063 cairo_polygon_t
*polygon
);
1065 cairo_private cairo_status_t
1066 _cairo_path_fixed_fill_rectilinear_to_boxes (const cairo_path_fixed_t
*path
,
1067 cairo_fill_rule_t fill_rule
,
1068 cairo_antialias_t antialias
,
1069 cairo_boxes_t
*boxes
);
1071 cairo_private cairo_region_t
*
1072 _cairo_path_fixed_fill_rectilinear_to_region (const cairo_path_fixed_t
*path
,
1073 cairo_fill_rule_t fill_rule
,
1074 const cairo_rectangle_int_t
*extents
);
1076 cairo_private cairo_status_t
1077 _cairo_path_fixed_fill_to_traps (const cairo_path_fixed_t
*path
,
1078 cairo_fill_rule_t fill_rule
,
1080 cairo_traps_t
*traps
);
1082 /* cairo-path-stroke.c */
1083 cairo_private cairo_status_t
1084 _cairo_path_fixed_stroke_to_polygon (const cairo_path_fixed_t
*path
,
1085 const cairo_stroke_style_t
*stroke_style
,
1086 const cairo_matrix_t
*ctm
,
1087 const cairo_matrix_t
*ctm_inverse
,
1089 cairo_polygon_t
*polygon
);
1091 cairo_private cairo_int_status_t
1092 _cairo_path_fixed_stroke_to_tristrip (const cairo_path_fixed_t
*path
,
1093 const cairo_stroke_style_t
*style
,
1094 const cairo_matrix_t
*ctm
,
1095 const cairo_matrix_t
*ctm_inverse
,
1097 cairo_tristrip_t
*strip
);
1099 cairo_private cairo_status_t
1100 _cairo_path_fixed_stroke_dashed_to_polygon (const cairo_path_fixed_t
*path
,
1101 const cairo_stroke_style_t
*stroke_style
,
1102 const cairo_matrix_t
*ctm
,
1103 const cairo_matrix_t
*ctm_inverse
,
1105 cairo_polygon_t
*polygon
);
1107 cairo_private cairo_int_status_t
1108 _cairo_path_fixed_stroke_rectilinear_to_boxes (const cairo_path_fixed_t
*path
,
1109 const cairo_stroke_style_t
*stroke_style
,
1110 const cairo_matrix_t
*ctm
,
1111 cairo_antialias_t antialias
,
1112 cairo_boxes_t
*boxes
);
1114 cairo_private cairo_int_status_t
1115 _cairo_path_fixed_stroke_to_traps (const cairo_path_fixed_t
*path
,
1116 const cairo_stroke_style_t
*stroke_style
,
1117 const cairo_matrix_t
*ctm
,
1118 const cairo_matrix_t
*ctm_inverse
,
1120 cairo_traps_t
*traps
);
1122 cairo_private cairo_int_status_t
1123 _cairo_path_fixed_stroke_polygon_to_traps (const cairo_path_fixed_t
*path
,
1124 const cairo_stroke_style_t
*stroke_style
,
1125 const cairo_matrix_t
*ctm
,
1126 const cairo_matrix_t
*ctm_inverse
,
1128 cairo_traps_t
*traps
);
1130 cairo_private cairo_status_t
1131 _cairo_path_fixed_stroke_to_shaper (cairo_path_fixed_t
*path
,
1132 const cairo_stroke_style_t
*stroke_style
,
1133 const cairo_matrix_t
*ctm
,
1134 const cairo_matrix_t
*ctm_inverse
,
1136 cairo_status_t (*add_triangle
) (void *closure
,
1137 const cairo_point_t triangle
[3]),
1138 cairo_status_t (*add_triangle_fan
) (void *closure
,
1139 const cairo_point_t
*midpt
,
1140 const cairo_point_t
*points
,
1142 cairo_status_t (*add_quad
) (void *closure
,
1143 const cairo_point_t quad
[4]),
1146 /* cairo-scaled-font.c */
1149 _cairo_scaled_font_freeze_cache (cairo_scaled_font_t
*scaled_font
);
1152 _cairo_scaled_font_thaw_cache (cairo_scaled_font_t
*scaled_font
);
1155 _cairo_scaled_font_reset_cache (cairo_scaled_font_t
*scaled_font
);
1157 cairo_private cairo_status_t
1158 _cairo_scaled_font_set_error (cairo_scaled_font_t
*scaled_font
,
1159 cairo_status_t status
);
1161 cairo_private cairo_scaled_font_t
*
1162 _cairo_scaled_font_create_in_error (cairo_status_t status
);
1165 _cairo_scaled_font_reset_static_data (void);
1167 cairo_private cairo_status_t
1168 _cairo_scaled_font_register_placeholder_and_unlock_font_map (cairo_scaled_font_t
*scaled_font
);
1171 _cairo_scaled_font_unregister_placeholder_and_lock_font_map (cairo_scaled_font_t
*scaled_font
);
1173 cairo_private cairo_status_t
1174 _cairo_scaled_font_init (cairo_scaled_font_t
*scaled_font
,
1175 cairo_font_face_t
*font_face
,
1176 const cairo_matrix_t
*font_matrix
,
1177 const cairo_matrix_t
*ctm
,
1178 const cairo_font_options_t
*options
,
1179 const cairo_scaled_font_backend_t
*backend
);
1181 cairo_private cairo_status_t
1182 _cairo_scaled_font_set_metrics (cairo_scaled_font_t
*scaled_font
,
1183 cairo_font_extents_t
*fs_metrics
);
1185 /* This should only be called on an error path by a scaled_font constructor */
1187 _cairo_scaled_font_fini (cairo_scaled_font_t
*scaled_font
);
1189 cairo_private cairo_status_t
1190 _cairo_scaled_font_font_extents (cairo_scaled_font_t
*scaled_font
,
1191 cairo_font_extents_t
*extents
);
1193 cairo_private cairo_status_t
1194 _cairo_scaled_font_glyph_device_extents (cairo_scaled_font_t
*scaled_font
,
1195 const cairo_glyph_t
*glyphs
,
1197 cairo_rectangle_int_t
*extents
,
1198 cairo_bool_t
*overlap
);
1200 cairo_private cairo_bool_t
1201 _cairo_scaled_font_glyph_approximate_extents (cairo_scaled_font_t
*scaled_font
,
1202 const cairo_glyph_t
*glyphs
,
1204 cairo_rectangle_int_t
*extents
);
1206 cairo_private cairo_status_t
1207 _cairo_scaled_font_show_glyphs (cairo_scaled_font_t
*scaled_font
,
1208 cairo_operator_t op
,
1209 const cairo_pattern_t
*source
,
1210 cairo_surface_t
*surface
,
1216 unsigned int height
,
1217 cairo_glyph_t
*glyphs
,
1219 cairo_region_t
*clip_region
);
1221 cairo_private cairo_status_t
1222 _cairo_scaled_font_glyph_path (cairo_scaled_font_t
*scaled_font
,
1223 const cairo_glyph_t
*glyphs
,
1225 cairo_path_fixed_t
*path
);
1228 _cairo_scaled_glyph_set_metrics (cairo_scaled_glyph_t
*scaled_glyph
,
1229 cairo_scaled_font_t
*scaled_font
,
1230 cairo_text_extents_t
*fs_metrics
);
1233 _cairo_scaled_glyph_set_surface (cairo_scaled_glyph_t
*scaled_glyph
,
1234 cairo_scaled_font_t
*scaled_font
,
1235 cairo_image_surface_t
*surface
);
1238 _cairo_scaled_glyph_set_path (cairo_scaled_glyph_t
*scaled_glyph
,
1239 cairo_scaled_font_t
*scaled_font
,
1240 cairo_path_fixed_t
*path
);
1243 _cairo_scaled_glyph_set_recording_surface (cairo_scaled_glyph_t
*scaled_glyph
,
1244 cairo_scaled_font_t
*scaled_font
,
1245 cairo_surface_t
*recording_surface
);
1247 cairo_private cairo_int_status_t
1248 _cairo_scaled_glyph_lookup (cairo_scaled_font_t
*scaled_font
,
1249 unsigned long index
,
1250 cairo_scaled_glyph_info_t info
,
1251 cairo_scaled_glyph_t
**scaled_glyph_ret
);
1253 cairo_private
double
1254 _cairo_scaled_font_get_max_scale (cairo_scaled_font_t
*scaled_font
);
1257 _cairo_scaled_font_map_destroy (void);
1259 /* cairo-stroke-style.c */
1262 _cairo_stroke_style_init (cairo_stroke_style_t
*style
);
1264 cairo_private cairo_status_t
1265 _cairo_stroke_style_init_copy (cairo_stroke_style_t
*style
,
1266 const cairo_stroke_style_t
*other
);
1269 _cairo_stroke_style_fini (cairo_stroke_style_t
*style
);
1272 _cairo_stroke_style_max_distance_from_path (const cairo_stroke_style_t
*style
,
1273 const cairo_path_fixed_t
*path
,
1274 const cairo_matrix_t
*ctm
,
1275 double *dx
, double *dy
);
1277 _cairo_stroke_style_max_line_distance_from_path (const cairo_stroke_style_t
*style
,
1278 const cairo_path_fixed_t
*path
,
1279 const cairo_matrix_t
*ctm
,
1280 double *dx
, double *dy
);
1283 _cairo_stroke_style_max_join_distance_from_path (const cairo_stroke_style_t
*style
,
1284 const cairo_path_fixed_t
*path
,
1285 const cairo_matrix_t
*ctm
,
1286 double *dx
, double *dy
);
1288 cairo_private
double
1289 _cairo_stroke_style_dash_period (const cairo_stroke_style_t
*style
);
1291 cairo_private
double
1292 _cairo_stroke_style_dash_stroked (const cairo_stroke_style_t
*style
);
1294 cairo_private cairo_bool_t
1295 _cairo_stroke_style_dash_can_approximate (const cairo_stroke_style_t
*style
,
1296 const cairo_matrix_t
*ctm
,
1300 _cairo_stroke_style_dash_approximate (const cairo_stroke_style_t
*style
,
1301 const cairo_matrix_t
*ctm
,
1303 double *dash_offset
,
1305 unsigned int *num_dashes
);
1308 /* cairo-surface.c */
1310 cairo_private cairo_status_t
1311 _cairo_surface_copy_mime_data (cairo_surface_t
*dst
,
1312 cairo_surface_t
*src
);
1314 cairo_private_no_warn cairo_int_status_t
1315 _cairo_surface_set_error (cairo_surface_t
*surface
,
1316 cairo_int_status_t status
);
1319 _cairo_surface_set_resolution (cairo_surface_t
*surface
,
1323 cairo_private cairo_surface_t
*
1324 _cairo_surface_create_for_rectangle_int (cairo_surface_t
*target
,
1325 const cairo_rectangle_int_t
*extents
);
1327 cairo_private cairo_surface_t
*
1328 _cairo_surface_create_scratch (cairo_surface_t
*other
,
1329 cairo_content_t content
,
1332 const cairo_color_t
*color
);
1335 _cairo_surface_init (cairo_surface_t
*surface
,
1336 const cairo_surface_backend_t
*backend
,
1337 cairo_device_t
*device
,
1338 cairo_content_t content
);
1341 _cairo_surface_set_font_options (cairo_surface_t
*surface
,
1342 cairo_font_options_t
*options
);
1344 cairo_private cairo_status_t
1345 _cairo_surface_paint (cairo_surface_t
*surface
,
1346 cairo_operator_t op
,
1347 const cairo_pattern_t
*source
,
1348 const cairo_clip_t
*clip
);
1350 cairo_private cairo_image_surface_t
*
1351 _cairo_surface_map_to_image (cairo_surface_t
*surface
,
1352 const cairo_rectangle_int_t
*extents
);
1354 cairo_private_no_warn cairo_int_status_t
1355 _cairo_surface_unmap_image (cairo_surface_t
*surface
,
1356 cairo_image_surface_t
*image
);
1358 cairo_private cairo_status_t
1359 _cairo_surface_mask (cairo_surface_t
*surface
,
1360 cairo_operator_t op
,
1361 const cairo_pattern_t
*source
,
1362 const cairo_pattern_t
*mask
,
1363 const cairo_clip_t
*clip
);
1365 cairo_private cairo_status_t
1366 _cairo_surface_fill_stroke (cairo_surface_t
*surface
,
1367 cairo_operator_t fill_op
,
1368 const cairo_pattern_t
*fill_source
,
1369 cairo_fill_rule_t fill_rule
,
1370 double fill_tolerance
,
1371 cairo_antialias_t fill_antialias
,
1372 cairo_path_fixed_t
*path
,
1373 cairo_operator_t stroke_op
,
1374 const cairo_pattern_t
*stroke_source
,
1375 const cairo_stroke_style_t
*stroke_style
,
1376 const cairo_matrix_t
*stroke_ctm
,
1377 const cairo_matrix_t
*stroke_ctm_inverse
,
1378 double stroke_tolerance
,
1379 cairo_antialias_t stroke_antialias
,
1380 const cairo_clip_t
*clip
);
1382 cairo_private cairo_status_t
1383 _cairo_surface_stroke (cairo_surface_t
*surface
,
1384 cairo_operator_t op
,
1385 const cairo_pattern_t
*source
,
1386 const cairo_path_fixed_t
*path
,
1387 const cairo_stroke_style_t
*style
,
1388 const cairo_matrix_t
*ctm
,
1389 const cairo_matrix_t
*ctm_inverse
,
1391 cairo_antialias_t antialias
,
1392 const cairo_clip_t
*clip
);
1394 cairo_private cairo_status_t
1395 _cairo_surface_fill (cairo_surface_t
*surface
,
1396 cairo_operator_t op
,
1397 const cairo_pattern_t
*source
,
1398 const cairo_path_fixed_t
*path
,
1399 cairo_fill_rule_t fill_rule
,
1401 cairo_antialias_t antialias
,
1402 const cairo_clip_t
*clip
);
1404 cairo_private cairo_status_t
1405 _cairo_surface_show_text_glyphs (cairo_surface_t
*surface
,
1406 cairo_operator_t op
,
1407 const cairo_pattern_t
*source
,
1410 cairo_glyph_t
*glyphs
,
1412 const cairo_text_cluster_t
*clusters
,
1414 cairo_text_cluster_flags_t cluster_flags
,
1415 cairo_scaled_font_t
*scaled_font
,
1416 const cairo_clip_t
*clip
);
1418 cairo_private cairo_status_t
1419 _cairo_surface_acquire_source_image (cairo_surface_t
*surface
,
1420 cairo_image_surface_t
**image_out
,
1421 void **image_extra
);
1424 _cairo_surface_release_source_image (cairo_surface_t
*surface
,
1425 cairo_image_surface_t
*image
,
1428 cairo_private cairo_surface_t
*
1429 _cairo_surface_snapshot (cairo_surface_t
*surface
);
1432 _cairo_surface_attach_snapshot (cairo_surface_t
*surface
,
1433 cairo_surface_t
*snapshot
,
1434 cairo_surface_func_t detach_func
);
1436 cairo_private cairo_surface_t
*
1437 _cairo_surface_has_snapshot (cairo_surface_t
*surface
,
1438 const cairo_surface_backend_t
*backend
);
1441 _cairo_surface_detach_snapshot (cairo_surface_t
*snapshot
);
1443 cairo_private cairo_status_t
1444 _cairo_surface_begin_modification (cairo_surface_t
*surface
);
1446 cairo_private_no_warn cairo_bool_t
1447 _cairo_surface_get_extents (cairo_surface_t
*surface
,
1448 cairo_rectangle_int_t
*extents
);
1450 cairo_private cairo_bool_t
1451 _cairo_surface_has_device_transform (cairo_surface_t
*surface
) cairo_pure
;
1454 _cairo_surface_release_device_reference (cairo_surface_t
*surface
);
1456 /* cairo-image-surface.c */
1458 /* XXX: In cairo 1.2.0 we added a new %CAIRO_FORMAT_RGB16_565 but
1459 * neglected to adjust this macro. The net effect is that it's
1460 * impossible to externally create an image surface with this
1461 * format. This is perhaps a good thing since we also neglected to fix
1462 * up things like cairo_surface_write_to_png() for the new format
1463 * (-Wswitch-enum will tell you where). Is it obvious that format was
1466 * The reason for the new format was to allow the xlib backend to be
1467 * used on X servers with a 565 visual. So the new format did its job
1468 * for that, even without being considered "valid" for the sake of
1469 * things like cairo_image_surface_create().
1471 * Since 1.2.0 we ran into the same situtation with X servers with BGR
1472 * visuals. This time we invented #cairo_internal_format_t instead,
1473 * (see it for more discussion).
1475 * The punchline is that %CAIRO_FORMAT_VALID must not conside any
1476 * internal format to be valid. Also we need to decide if the
1477 * RGB16_565 should be moved to instead be an internal format. If so,
1478 * this macro need not change for it. (We probably will need to leave
1479 * an RGB16_565 value in the header files for the sake of code that
1480 * might have that value in it.)
1482 * If we do decide to start fully supporting RGB16_565 as an external
1483 * format, then %CAIRO_FORMAT_VALID needs to be adjusted to include
1484 * it. But that should not happen before all necessary code is fixed
1485 * to support it (at least cairo_surface_write_to_png() and a few spots
1486 * in cairo-xlib-surface.c--again see -Wswitch-enum).
1488 #define CAIRO_FORMAT_VALID(format) ((format) >= CAIRO_FORMAT_ARGB32 && \
1489 (format) <= CAIRO_FORMAT_RGB30)
1491 /* pixman-required stride alignment in bytes. */
1492 #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))
1493 #define CAIRO_STRIDE_FOR_WIDTH_BPP(w,bpp) \
1494 ((((bpp)*(w)+7)/8 + CAIRO_STRIDE_ALIGNMENT-1) & -CAIRO_STRIDE_ALIGNMENT)
1496 #define CAIRO_CONTENT_VALID(content) ((content) && \
1497 (((content) & ~(CAIRO_CONTENT_COLOR | \
1498 CAIRO_CONTENT_ALPHA | \
1499 CAIRO_CONTENT_COLOR_ALPHA))\
1503 _cairo_format_bits_per_pixel (cairo_format_t format
) cairo_const
;
1505 cairo_private cairo_format_t
1506 _cairo_format_from_content (cairo_content_t content
) cairo_const
;
1508 cairo_private cairo_format_t
1509 _cairo_format_from_pixman_format (pixman_format_code_t pixman_format
);
1511 cairo_private cairo_content_t
1512 _cairo_content_from_format (cairo_format_t format
) cairo_const
;
1514 cairo_private cairo_content_t
1515 _cairo_content_from_pixman_format (pixman_format_code_t pixman_format
);
1517 cairo_private cairo_surface_t
*
1518 _cairo_image_surface_create_for_pixman_image (pixman_image_t
*pixman_image
,
1519 pixman_format_code_t pixman_format
);
1521 cairo_private pixman_format_code_t
1522 _cairo_format_to_pixman_format_code (cairo_format_t format
);
1524 cairo_private cairo_bool_t
1525 _pixman_format_from_masks (cairo_format_masks_t
*masks
,
1526 pixman_format_code_t
*format_ret
);
1528 cairo_private cairo_bool_t
1529 _pixman_format_to_masks (pixman_format_code_t pixman_format
,
1530 cairo_format_masks_t
*masks
);
1533 _cairo_image_scaled_glyph_fini (cairo_scaled_font_t
*scaled_font
,
1534 cairo_scaled_glyph_t
*scaled_glyph
);
1537 _cairo_image_reset_static_data (void);
1539 cairo_private cairo_surface_t
*
1540 _cairo_image_surface_create_with_pixman_format (unsigned char *data
,
1541 pixman_format_code_t pixman_format
,
1546 cairo_private cairo_surface_t
*
1547 _cairo_image_surface_create_with_content (cairo_content_t content
,
1552 _cairo_image_surface_assume_ownership_of_data (cairo_image_surface_t
*surface
);
1554 cairo_private cairo_image_surface_t
*
1555 _cairo_image_surface_coerce (cairo_image_surface_t
*surface
);
1557 cairo_private cairo_image_surface_t
*
1558 _cairo_image_surface_coerce_to_format (cairo_image_surface_t
*surface
,
1559 cairo_format_t format
);
1561 cairo_private cairo_image_transparency_t
1562 _cairo_image_analyze_transparency (cairo_image_surface_t
*image
);
1564 cairo_private cairo_image_color_t
1565 _cairo_image_analyze_color (cairo_image_surface_t
*image
);
1569 _cairo_pen_vertices_needed (double tolerance
,
1571 const cairo_matrix_t
*matrix
);
1573 cairo_private cairo_status_t
1574 _cairo_pen_init (cairo_pen_t
*pen
,
1577 const cairo_matrix_t
*ctm
);
1580 _cairo_pen_init_empty (cairo_pen_t
*pen
);
1582 cairo_private cairo_status_t
1583 _cairo_pen_init_copy (cairo_pen_t
*pen
, const cairo_pen_t
*other
);
1586 _cairo_pen_fini (cairo_pen_t
*pen
);
1588 cairo_private cairo_status_t
1589 _cairo_pen_add_points (cairo_pen_t
*pen
, cairo_point_t
*point
, int num_points
);
1592 _cairo_pen_find_active_cw_vertex_index (const cairo_pen_t
*pen
,
1593 const cairo_slope_t
*slope
);
1596 _cairo_pen_find_active_ccw_vertex_index (const cairo_pen_t
*pen
,
1597 const cairo_slope_t
*slope
);
1600 _cairo_pen_find_active_cw_vertices (const cairo_pen_t
*pen
,
1601 const cairo_slope_t
*in
,
1602 const cairo_slope_t
*out
,
1603 int *start
, int *stop
);
1606 _cairo_pen_find_active_ccw_vertices (const cairo_pen_t
*pen
,
1607 const cairo_slope_t
*in
,
1608 const cairo_slope_t
*out
,
1609 int *start
, int *stop
);
1611 /* cairo-polygon.c */
1613 _cairo_polygon_init (cairo_polygon_t
*polygon
,
1614 const cairo_box_t
*boxes
,
1618 _cairo_polygon_init_with_clip (cairo_polygon_t
*polygon
,
1619 const cairo_clip_t
*clip
);
1621 cairo_private cairo_status_t
1622 _cairo_polygon_init_boxes (cairo_polygon_t
*polygon
,
1623 const cairo_boxes_t
*boxes
);
1625 cairo_private cairo_status_t
1626 _cairo_polygon_init_box_array (cairo_polygon_t
*polygon
,
1631 _cairo_polygon_limit (cairo_polygon_t
*polygon
,
1632 const cairo_box_t
*limits
,
1636 _cairo_polygon_limit_to_clip (cairo_polygon_t
*polygon
,
1637 const cairo_clip_t
*clip
);
1640 _cairo_polygon_fini (cairo_polygon_t
*polygon
);
1642 cairo_private_no_warn cairo_status_t
1643 _cairo_polygon_add_line (cairo_polygon_t
*polygon
,
1644 const cairo_line_t
*line
,
1645 int top
, int bottom
,
1648 cairo_private_no_warn cairo_status_t
1649 _cairo_polygon_add_external_edge (void *polygon
,
1650 const cairo_point_t
*p1
,
1651 const cairo_point_t
*p2
);
1653 cairo_private_no_warn cairo_status_t
1654 _cairo_polygon_add_contour (cairo_polygon_t
*polygon
,
1655 const cairo_contour_t
*contour
);
1658 _cairo_polygon_translate (cairo_polygon_t
*polygon
, int dx
, int dy
);
1660 cairo_private cairo_status_t
1661 _cairo_polygon_reduce (cairo_polygon_t
*polygon
,
1662 cairo_fill_rule_t fill_rule
);
1664 cairo_private cairo_status_t
1665 _cairo_polygon_intersect (cairo_polygon_t
*a
, int winding_a
,
1666 cairo_polygon_t
*b
, int winding_b
);
1668 cairo_private cairo_status_t
1669 _cairo_polygon_intersect_with_boxes (cairo_polygon_t
*polygon
,
1670 cairo_fill_rule_t
*winding
,
1674 static inline cairo_bool_t
1675 _cairo_polygon_is_empty (const cairo_polygon_t
*polygon
)
1678 polygon
->num_edges
== 0 ||
1679 polygon
->extents
.p2
.x
<= polygon
->extents
.p1
.x
;
1682 #define _cairo_polygon_status(P) ((cairo_polygon_t *) (P))->status
1684 /* cairo-spline.c */
1685 cairo_private cairo_bool_t
1686 _cairo_spline_init (cairo_spline_t
*spline
,
1687 cairo_spline_add_point_func_t add_point_func
,
1689 const cairo_point_t
*a
, const cairo_point_t
*b
,
1690 const cairo_point_t
*c
, const cairo_point_t
*d
);
1692 cairo_private cairo_status_t
1693 _cairo_spline_decompose (cairo_spline_t
*spline
, double tolerance
);
1695 cairo_private cairo_status_t
1696 _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func
,
1698 const cairo_point_t
*p0
, const cairo_point_t
*p1
,
1699 const cairo_point_t
*p2
, const cairo_point_t
*p3
);
1701 /* cairo-matrix.c */
1703 _cairo_matrix_get_affine (const cairo_matrix_t
*matrix
,
1704 double *xx
, double *yx
,
1705 double *xy
, double *yy
,
1706 double *x0
, double *y0
);
1709 _cairo_matrix_transform_bounding_box (const cairo_matrix_t
*matrix
,
1710 double *x1
, double *y1
,
1711 double *x2
, double *y2
,
1712 cairo_bool_t
*is_tight
);
1715 _cairo_matrix_transform_bounding_box_fixed (const cairo_matrix_t
*matrix
,
1717 cairo_bool_t
*is_tight
);
1719 cairo_private cairo_bool_t
1720 _cairo_matrix_is_invertible (const cairo_matrix_t
*matrix
) cairo_pure
;
1722 cairo_private cairo_bool_t
1723 _cairo_matrix_is_scale_0 (const cairo_matrix_t
*matrix
) cairo_pure
;
1725 cairo_private
double
1726 _cairo_matrix_compute_determinant (const cairo_matrix_t
*matrix
) cairo_pure
;
1728 cairo_private cairo_status_t
1729 _cairo_matrix_compute_basis_scale_factors (const cairo_matrix_t
*matrix
,
1730 double *sx
, double *sy
, int x_major
);
1732 static inline cairo_bool_t
1733 _cairo_matrix_is_identity (const cairo_matrix_t
*matrix
)
1735 return (matrix
->xx
== 1.0 && matrix
->yx
== 0.0 &&
1736 matrix
->xy
== 0.0 && matrix
->yy
== 1.0 &&
1737 matrix
->x0
== 0.0 && matrix
->y0
== 0.0);
1740 static inline cairo_bool_t
1741 _cairo_matrix_is_translation (const cairo_matrix_t
*matrix
)
1743 return (matrix
->xx
== 1.0 && matrix
->yx
== 0.0 &&
1744 matrix
->xy
== 0.0 && matrix
->yy
== 1.0);
1747 static inline cairo_bool_t
1748 _cairo_matrix_is_scale (const cairo_matrix_t
*matrix
)
1750 return matrix
->yx
== 0.0 && matrix
->xy
== 0.0;
1753 cairo_private cairo_bool_t
1754 _cairo_matrix_is_integer_translation(const cairo_matrix_t
*matrix
,
1755 int *itx
, int *ity
);
1757 cairo_private cairo_bool_t
1758 _cairo_matrix_has_unity_scale (const cairo_matrix_t
*matrix
);
1760 cairo_private cairo_bool_t
1761 _cairo_matrix_is_pixel_exact (const cairo_matrix_t
*matrix
) cairo_pure
;
1763 cairo_private
double
1764 _cairo_matrix_transformed_circle_major_axis (const cairo_matrix_t
*matrix
,
1765 double radius
) cairo_pure
;
1767 cairo_private cairo_bool_t
1768 _cairo_matrix_is_pixman_translation (const cairo_matrix_t
*matrix
,
1769 cairo_filter_t filter
,
1773 cairo_private cairo_status_t
1774 _cairo_matrix_to_pixman_matrix_offset (const cairo_matrix_t
*matrix
,
1775 cairo_filter_t filter
,
1778 pixman_transform_t
*out_transform
,
1782 cairo_private cairo_status_t
1783 _cairo_bentley_ottmann_tessellate_rectilinear_polygon (cairo_traps_t
*traps
,
1784 const cairo_polygon_t
*polygon
,
1785 cairo_fill_rule_t fill_rule
);
1787 cairo_private cairo_status_t
1788 _cairo_bentley_ottmann_tessellate_polygon (cairo_traps_t
*traps
,
1789 const cairo_polygon_t
*polygon
,
1790 cairo_fill_rule_t fill_rule
);
1792 cairo_private cairo_status_t
1793 _cairo_bentley_ottmann_tessellate_traps (cairo_traps_t
*traps
,
1794 cairo_fill_rule_t fill_rule
);
1796 cairo_private cairo_status_t
1797 _cairo_bentley_ottmann_tessellate_rectangular_traps (cairo_traps_t
*traps
,
1798 cairo_fill_rule_t fill_rule
);
1800 cairo_private cairo_status_t
1801 _cairo_bentley_ottmann_tessellate_boxes (const cairo_boxes_t
*in
,
1802 cairo_fill_rule_t fill_rule
,
1803 cairo_boxes_t
*out
);
1805 cairo_private cairo_status_t
1806 _cairo_bentley_ottmann_tessellate_rectilinear_traps (cairo_traps_t
*traps
,
1807 cairo_fill_rule_t fill_rule
);
1809 cairo_private cairo_status_t
1810 _cairo_bentley_ottmann_tessellate_rectilinear_polygon_to_boxes (const cairo_polygon_t
*polygon
,
1811 cairo_fill_rule_t fill_rule
,
1812 cairo_boxes_t
*boxes
);
1815 _cairo_trapezoid_array_translate_and_scale (cairo_trapezoid_t
*offset_traps
,
1816 cairo_trapezoid_t
*src_traps
,
1818 double tx
, double ty
,
1819 double sx
, double sy
);
1821 #if CAIRO_HAS_DRM_SURFACE
1824 _cairo_drm_device_reset_static_data (void);
1829 _cairo_clip_reset_static_data (void);
1832 _cairo_pattern_reset_static_data (void);
1834 /* cairo-unicode.c */
1837 _cairo_utf8_get_char_validated (const char *p
,
1840 cairo_private cairo_status_t
1841 _cairo_utf8_to_ucs4 (const char *str
,
1844 int *items_written
);
1847 _cairo_ucs4_to_utf8 (uint32_t unicode
,
1850 #if CAIRO_HAS_WIN32_FONT || CAIRO_HAS_QUARTZ_FONT || CAIRO_HAS_PDF_OPERATORS
1851 # define CAIRO_HAS_UTF8_TO_UTF16 1
1853 #if CAIRO_HAS_UTF8_TO_UTF16
1854 cairo_private cairo_status_t
1855 _cairo_utf8_to_utf16 (const char *str
,
1858 int *items_written
);
1862 _cairo_matrix_multiply (cairo_matrix_t
*r
,
1863 const cairo_matrix_t
*a
,
1864 const cairo_matrix_t
*b
);
1866 /* cairo-observer.c */
1869 _cairo_observers_notify (cairo_list_t
*observers
, void *arg
);
1871 /* Avoid unnecessary PLT entries. */
1872 slim_hidden_proto (cairo_clip_preserve
);
1873 slim_hidden_proto (cairo_close_path
);
1874 slim_hidden_proto (cairo_create
);
1875 slim_hidden_proto (cairo_curve_to
);
1876 slim_hidden_proto (cairo_destroy
);
1877 slim_hidden_proto (cairo_fill_preserve
);
1878 slim_hidden_proto (cairo_font_face_destroy
);
1879 slim_hidden_proto (cairo_font_face_get_user_data
);
1880 slim_hidden_proto_no_warn (cairo_font_face_reference
);
1881 slim_hidden_proto (cairo_font_face_set_user_data
);
1882 slim_hidden_proto (cairo_font_options_equal
);
1883 slim_hidden_proto (cairo_font_options_hash
);
1884 slim_hidden_proto (cairo_font_options_merge
);
1885 slim_hidden_proto (cairo_font_options_set_antialias
);
1886 slim_hidden_proto (cairo_font_options_set_hint_metrics
);
1887 slim_hidden_proto (cairo_font_options_set_hint_style
);
1888 slim_hidden_proto (cairo_font_options_set_subpixel_order
);
1889 slim_hidden_proto (cairo_font_options_status
);
1890 slim_hidden_proto (cairo_format_stride_for_width
);
1891 slim_hidden_proto (cairo_get_current_point
);
1892 slim_hidden_proto (cairo_get_line_width
);
1893 slim_hidden_proto (cairo_get_matrix
);
1894 slim_hidden_proto (cairo_get_scaled_font
);
1895 slim_hidden_proto (cairo_get_target
);
1896 slim_hidden_proto (cairo_get_tolerance
);
1897 slim_hidden_proto (cairo_glyph_allocate
);
1898 slim_hidden_proto (cairo_glyph_free
);
1899 slim_hidden_proto (cairo_image_surface_create
);
1900 slim_hidden_proto (cairo_image_surface_create_for_data
);
1901 slim_hidden_proto (cairo_image_surface_get_data
);
1902 slim_hidden_proto (cairo_image_surface_get_format
);
1903 slim_hidden_proto (cairo_image_surface_get_height
);
1904 slim_hidden_proto (cairo_image_surface_get_stride
);
1905 slim_hidden_proto (cairo_image_surface_get_width
);
1906 slim_hidden_proto (cairo_line_to
);
1907 slim_hidden_proto (cairo_mask
);
1908 slim_hidden_proto (cairo_matrix_init
);
1909 slim_hidden_proto (cairo_matrix_init_identity
);
1910 slim_hidden_proto (cairo_matrix_init_rotate
);
1911 slim_hidden_proto (cairo_matrix_init_scale
);
1912 slim_hidden_proto (cairo_matrix_init_translate
);
1913 slim_hidden_proto (cairo_matrix_invert
);
1914 slim_hidden_proto (cairo_matrix_multiply
);
1915 slim_hidden_proto (cairo_matrix_scale
);
1916 slim_hidden_proto (cairo_matrix_transform_distance
);
1917 slim_hidden_proto (cairo_matrix_transform_point
);
1918 slim_hidden_proto (cairo_matrix_translate
);
1919 slim_hidden_proto (cairo_move_to
);
1920 slim_hidden_proto (cairo_new_path
);
1921 slim_hidden_proto (cairo_paint
);
1922 slim_hidden_proto (cairo_pattern_add_color_stop_rgba
);
1923 slim_hidden_proto (cairo_pattern_create_for_surface
);
1924 slim_hidden_proto (cairo_pattern_create_rgb
);
1925 slim_hidden_proto (cairo_pattern_create_rgba
);
1926 slim_hidden_proto (cairo_pattern_destroy
);
1927 slim_hidden_proto (cairo_pattern_get_extend
);
1928 slim_hidden_proto (cairo_mesh_pattern_curve_to
);
1929 slim_hidden_proto (cairo_mesh_pattern_get_control_point
);
1930 slim_hidden_proto (cairo_mesh_pattern_get_corner_color_rgba
);
1931 slim_hidden_proto (cairo_mesh_pattern_get_patch_count
);
1932 slim_hidden_proto (cairo_mesh_pattern_get_path
);
1933 slim_hidden_proto (cairo_mesh_pattern_line_to
);
1934 slim_hidden_proto (cairo_mesh_pattern_move_to
);
1935 slim_hidden_proto (cairo_mesh_pattern_set_corner_color_rgba
);
1936 slim_hidden_proto_no_warn (cairo_pattern_reference
);
1937 slim_hidden_proto (cairo_pattern_set_matrix
);
1938 slim_hidden_proto (cairo_pop_group
);
1939 slim_hidden_proto (cairo_push_group_with_content
);
1940 slim_hidden_proto_no_warn (cairo_path_destroy
);
1941 slim_hidden_proto (cairo_recording_surface_create
);
1942 slim_hidden_proto (cairo_rel_line_to
);
1943 slim_hidden_proto (cairo_restore
);
1944 slim_hidden_proto (cairo_save
);
1945 slim_hidden_proto (cairo_scale
);
1946 slim_hidden_proto (cairo_scaled_font_create
);
1947 slim_hidden_proto (cairo_scaled_font_destroy
);
1948 slim_hidden_proto (cairo_scaled_font_extents
);
1949 slim_hidden_proto (cairo_scaled_font_get_ctm
);
1950 slim_hidden_proto (cairo_scaled_font_get_font_face
);
1951 slim_hidden_proto (cairo_scaled_font_get_font_matrix
);
1952 slim_hidden_proto (cairo_scaled_font_get_font_options
);
1953 slim_hidden_proto (cairo_scaled_font_glyph_extents
);
1954 slim_hidden_proto_no_warn (cairo_scaled_font_reference
);
1955 slim_hidden_proto (cairo_scaled_font_status
);
1956 slim_hidden_proto (cairo_scaled_font_get_user_data
);
1957 slim_hidden_proto (cairo_scaled_font_set_user_data
);
1958 slim_hidden_proto (cairo_scaled_font_text_to_glyphs
);
1959 slim_hidden_proto (cairo_set_font_matrix
);
1960 slim_hidden_proto (cairo_set_font_options
);
1961 slim_hidden_proto (cairo_set_font_size
);
1962 slim_hidden_proto (cairo_set_line_cap
);
1963 slim_hidden_proto (cairo_set_line_join
);
1964 slim_hidden_proto (cairo_set_line_width
);
1965 slim_hidden_proto (cairo_set_matrix
);
1966 slim_hidden_proto (cairo_set_operator
);
1967 slim_hidden_proto (cairo_set_source
);
1968 slim_hidden_proto (cairo_set_source_rgb
);
1969 slim_hidden_proto (cairo_set_source_surface
);
1970 slim_hidden_proto (cairo_set_tolerance
);
1971 slim_hidden_proto (cairo_status
);
1972 slim_hidden_proto (cairo_stroke
);
1973 slim_hidden_proto (cairo_stroke_preserve
);
1974 slim_hidden_proto (cairo_surface_copy_page
);
1975 slim_hidden_proto (cairo_surface_create_similar_image
);
1976 slim_hidden_proto (cairo_surface_destroy
);
1977 slim_hidden_proto (cairo_surface_finish
);
1978 slim_hidden_proto (cairo_surface_flush
);
1979 slim_hidden_proto (cairo_surface_get_device_offset
);
1980 slim_hidden_proto (cairo_surface_get_device_scale
);
1981 slim_hidden_proto (cairo_surface_get_font_options
);
1982 slim_hidden_proto (cairo_surface_get_mime_data
);
1983 slim_hidden_proto (cairo_surface_has_show_text_glyphs
);
1984 slim_hidden_proto (cairo_surface_mark_dirty
);
1985 slim_hidden_proto (cairo_surface_mark_dirty_rectangle
);
1986 slim_hidden_proto_no_warn (cairo_surface_reference
);
1987 slim_hidden_proto (cairo_surface_set_device_offset
);
1988 slim_hidden_proto (cairo_surface_set_device_scale
);
1989 slim_hidden_proto (cairo_surface_set_fallback_resolution
);
1990 slim_hidden_proto (cairo_surface_set_mime_data
);
1991 slim_hidden_proto (cairo_surface_show_page
);
1992 slim_hidden_proto (cairo_surface_status
);
1993 slim_hidden_proto (cairo_surface_supports_mime_type
);
1994 slim_hidden_proto (cairo_text_cluster_allocate
);
1995 slim_hidden_proto (cairo_text_cluster_free
);
1996 slim_hidden_proto (cairo_toy_font_face_create
);
1997 slim_hidden_proto (cairo_toy_font_face_get_slant
);
1998 slim_hidden_proto (cairo_toy_font_face_get_weight
);
1999 slim_hidden_proto (cairo_translate
);
2000 slim_hidden_proto (cairo_transform
);
2001 slim_hidden_proto (cairo_user_font_face_create
);
2002 slim_hidden_proto (cairo_user_font_face_set_init_func
);
2003 slim_hidden_proto (cairo_user_font_face_set_render_glyph_func
);
2004 slim_hidden_proto (cairo_user_font_face_set_unicode_to_glyph_func
);
2005 slim_hidden_proto (cairo_device_to_user
);
2006 slim_hidden_proto (cairo_user_to_device
);
2007 slim_hidden_proto (cairo_user_to_device_distance
);
2008 slim_hidden_proto (cairo_version_string
);
2009 slim_hidden_proto (cairo_region_create
);
2010 slim_hidden_proto (cairo_region_create_rectangle
);
2011 slim_hidden_proto (cairo_region_create_rectangles
);
2012 slim_hidden_proto (cairo_region_copy
);
2013 slim_hidden_proto (cairo_region_reference
);
2014 slim_hidden_proto (cairo_region_destroy
);
2015 slim_hidden_proto (cairo_region_equal
);
2016 slim_hidden_proto (cairo_region_status
);
2017 slim_hidden_proto (cairo_region_get_extents
);
2018 slim_hidden_proto (cairo_region_num_rectangles
);
2019 slim_hidden_proto (cairo_region_get_rectangle
);
2020 slim_hidden_proto (cairo_region_is_empty
);
2021 slim_hidden_proto (cairo_region_contains_rectangle
);
2022 slim_hidden_proto (cairo_region_contains_point
);
2023 slim_hidden_proto (cairo_region_translate
);
2024 slim_hidden_proto (cairo_region_subtract
);
2025 slim_hidden_proto (cairo_region_subtract_rectangle
);
2026 slim_hidden_proto (cairo_region_intersect
);
2027 slim_hidden_proto (cairo_region_intersect_rectangle
);
2028 slim_hidden_proto (cairo_region_union
);
2029 slim_hidden_proto (cairo_region_union_rectangle
);
2030 slim_hidden_proto (cairo_region_xor
);
2031 slim_hidden_proto (cairo_region_xor_rectangle
);
2033 #if CAIRO_HAS_PNG_FUNCTIONS
2035 slim_hidden_proto (cairo_surface_write_to_png_stream
);
2041 #include "cairo-mutex-private.h"
2042 #include "cairo-fixed-private.h"
2043 #include "cairo-wideint-private.h"
2044 #include "cairo-malloc-private.h"
2045 #include "cairo-hash-private.h"
2048 #include <memcheck.h>
2053 _cairo_debug_check_image_surface_is_defined (const cairo_surface_t
*surface
);
2058 #define _cairo_debug_check_image_surface_is_defined(X)
2063 _cairo_debug_print_path (FILE *stream
, cairo_path_fixed_t
*path
);
2066 _cairo_debug_print_polygon (FILE *stream
, cairo_polygon_t
*polygon
);
2069 _cairo_debug_print_traps (FILE *file
, const cairo_traps_t
*traps
);
2072 _cairo_debug_print_clip (FILE *stream
, const cairo_clip_t
*clip
);
2075 #define TRACE(x) fprintf (stderr, "%s: ", __FILE__), fprintf x