Fix bug in _cairo_gl_has_extension
[platform/core/graphics/cairo.git] / src / cairo-boxes-private.h
1 /* cairo - a vector graphics library with display and print output
2  *
3  * Copyright © 2009 Intel Corporation
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it either under the terms of the GNU Lesser General Public
7  * License version 2.1 as published by the Free Software Foundation
8  * (the "LGPL") or, at your option, under the terms of the Mozilla
9  * Public License Version 1.1 (the "MPL"). If you do not alter this
10  * notice, a recipient may use your version of this file under either
11  * the MPL or the LGPL.
12  *
13  * You should have received a copy of the LGPL along with this library
14  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16  * You should have received a copy of the MPL along with this library
17  * in the file COPYING-MPL-1.1
18  *
19  * The contents of this file are subject to the Mozilla Public License
20  * Version 1.1 (the "License"); you may not use this file except in
21  * compliance with the License. You may obtain a copy of the License at
22  * http://www.mozilla.org/MPL/
23  *
24  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
25  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
26  * the specific language governing rights and limitations.
27  *
28  * The Original Code is the cairo graphics library.
29  *
30  * Contributor(s):
31  *      Chris Wilson <chris@chris-wilson.co.uk>
32  */
33
34 #ifndef CAIRO_BOXES_H
35 #define CAIRO_BOXES_H
36
37 #include "cairo-types-private.h"
38 #include "cairo-compiler-private.h"
39
40 #include <stdio.h>
41 #include <stdlib.h>
42
43 struct _cairo_boxes_t {
44     cairo_status_t status;
45
46     cairo_box_t limit;
47     const cairo_box_t *limits;
48     int num_limits;
49
50     int num_boxes;
51
52     unsigned int is_pixel_aligned;
53
54     struct _cairo_boxes_chunk {
55         struct _cairo_boxes_chunk *next;
56         cairo_box_t *base;
57         int count;
58         int size;
59     } chunks, *tail;
60     cairo_box_t boxes_embedded[32];
61 };
62
63 cairo_private void
64 _cairo_boxes_init (cairo_boxes_t *boxes);
65
66 cairo_private void
67 _cairo_boxes_init_with_clip (cairo_boxes_t *boxes,
68                              cairo_clip_t *clip);
69
70 cairo_private void
71 _cairo_boxes_init_for_array (cairo_boxes_t *boxes,
72                              cairo_box_t *array,
73                              int num_boxes);
74
75 cairo_private void
76 _cairo_boxes_init_from_rectangle (cairo_boxes_t *boxes,
77                                   int x, int y, int w, int h);
78
79 cairo_private void
80 _cairo_boxes_limit (cairo_boxes_t       *boxes,
81                     const cairo_box_t   *limits,
82                     int                  num_limits);
83
84 cairo_private cairo_status_t
85 _cairo_boxes_add (cairo_boxes_t *boxes,
86                   cairo_antialias_t antialias,
87                   const cairo_box_t *box);
88
89 cairo_private void
90 _cairo_boxes_extents (const cairo_boxes_t *boxes,
91                       cairo_box_t *box);
92
93 cairo_private cairo_box_t *
94 _cairo_boxes_to_array (const cairo_boxes_t *boxes,
95                        int *num_boxes,
96                        cairo_bool_t force_allocation);
97
98 cairo_private cairo_status_t
99 _cairo_boxes_intersect (const cairo_boxes_t *a,
100                         const cairo_boxes_t *b,
101                         cairo_boxes_t *out);
102
103 cairo_private void
104 _cairo_boxes_clear (cairo_boxes_t *boxes);
105
106 cairo_private_no_warn cairo_bool_t
107 _cairo_boxes_for_each_box (cairo_boxes_t *boxes,
108                            cairo_bool_t (*func) (cairo_box_t *box, void *data),
109                            void *data);
110
111 cairo_private cairo_status_t
112 _cairo_rasterise_polygon_to_boxes (cairo_polygon_t                      *polygon,
113                                    cairo_fill_rule_t                     fill_rule,
114                                    cairo_boxes_t *boxes);
115
116 cairo_private void
117 _cairo_boxes_fini (cairo_boxes_t *boxes);
118
119 cairo_private void
120 _cairo_debug_print_boxes (FILE *stream,
121                           const cairo_boxes_t *boxes);
122
123 #endif /* CAIRO_BOXES_H */