Debian Codegraph @

gsk/gskrectprivate.h

raw symbols SCIP
1 #cxx . . $ `<file>/gsk/gskrectprivate.h`/pragma once
2
3 #include "gdk/gdkdihedralprivate.h"cxx . . $ `<file>/gdk/gdkdihedralprivate.h`/
4
5 #include <graphene.h>
6 #include <math.h>
7
8 #define GSK_RECT_INIT_CAIROcxx . . $ `gsk/gskrectprivate.h:8:9`!(cairo_rect) GRAPHENE_RECT_INIT((cairo_rect)->x, (cairo_rect)->y, (cairo_rect)->width, (cairo_rect)->height)
9
10 static inline void
11 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (graphene_rect_tcxx . . $ graphene_rect_t# *r,
12 float x,
13 float y,
14 float width,
15 float height)
16 {
17 r->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. = x;
18 r->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. = y;
19 r->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. = width;
20 r->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. = height;
21 }
22
23 static inline void
24 gsk_rect_init_from_rectcxx . . $ gsk_rect_init_from_rect(623ff7421a19ef75). (graphene_rect_tcxx . . $ graphene_rect_t# *r,
25 const graphene_rect_tcxx . . $ graphene_rect_t# *r1)
26 {
27 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (r, r1->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x., r1->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y., r1->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width., r1->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.);
28 }
29
30 static inline void
31 gsk_rect_init_offsetcxx . . $ gsk_rect_init_offset(e7313100f310f207). (graphene_rect_tcxx . . $ graphene_rect_t# *r,
32 const graphene_rect_tcxx . . $ graphene_rect_t# *src,
33 const graphene_point_tcxx . . $ graphene_point_t# *offset)
34 {
35 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (r, src->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + offset->xcxx . . $ _graphene_point_t#x., src->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + offset->ycxx . . $ _graphene_point_t#y., src->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width., src->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.);
36 }
37
38 static inline gbooleancxx . . $ gboolean# G_GNUC_PUREcxx . . $ `<external>/12741050725406041920/gmacros.h:291:9`!
39 gsk_rect_contains_rectcxx . . $ gsk_rect_contains_rect(5869f32967be43fe). (const graphene_rect_tcxx . . $ graphene_rect_t# *r1,
40 const graphene_rect_tcxx . . $ graphene_rect_t# *r2)
41 {
42 return r2->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. >= r1->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. &&
43 (r2->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + r2->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.) <= (r1->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + r1->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.) &&
44 r2->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. >= r1->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. &&
45 (r2->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + r2->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.) <= (r1->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + r1->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.);
46 }
47
48 static inline gbooleancxx . . $ gboolean# G_GNUC_PUREcxx . . $ `<external>/12741050725406041920/gmacros.h:291:9`!
49 gsk_rect_intersectscxx . . $ gsk_rect_intersects(5869f32967be43fe). (const graphene_rect_tcxx . . $ graphene_rect_t# *r1,
50 const graphene_rect_tcxx . . $ graphene_rect_t# *r2)
51 {
52 float x1, y1, x2, y2;
53
54 /* Assume both rects are already normalized, as they usually are */
55 x1 = MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (r1->origin.x, r2->origin.x);
56 y1 = MAXcxx . . $ _graphene_point_t#y. (r1->origin.y, r2->origin.y);
57 x2 = MINcxx . . $ _graphene_size_t#width. (r1->origin.x + r1->size.width, r2->origin.x + r2->size.width);
58 y2 = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (r1->origin.y + r1->size.height, r2->origin.y + r2->size.height);
59
60 if (x1 >= x2 || y1 >= y2)
61 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
62 else
63 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
64 }
65
66 static inline gbooleancxx . . $ gboolean# G_GNUC_WARN_UNUSED_RESULTcxx . . $ `<external>/12741050725406041920/gmacros.h:850:9`!
67 gsk_rect_intersectioncxx . . $ gsk_rect_intersection(780c660fd2a2d0af). (const graphene_rect_tcxx . . $ graphene_rect_t# *r1,
68 const graphene_rect_tcxx . . $ graphene_rect_t# *r2,
69 graphene_rect_tcxx . . $ graphene_rect_t# *res)
70 {
71 float x1, y1, x2, y2;
72
73 /* Assume both rects are already normalized, as they usually are */
74 x1 = MAXcxx . . $ _graphene_rect_t#origin. (r1->origin.x, r2->origin.x);
75 y1 = MAXcxx . . $ _graphene_rect_t#origin. (r1->origin.y, r2->origin.y);
76 x2 = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (r1->origin.x + r1->size.width, r2->origin.x + r2->size.width);
77 y2 = MINcxx . . $ _graphene_size_t#height. (r1->origin.y + r1->size.height, r2->origin.y + r2->size.height);
78
79 if (x1 >= x2 || y1 >= y2)
80 {
81 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (res, 0.f, 0.f, 0.f, 0.f);
82 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
83 }
84 else
85 {
86 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (res, x1, y1, x2 - x1, y2 - y1);
87 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
88 }
89 }
90
91 /**
92 * gsk_rect_coverage:
93 * @r1: a valid rectangle
94 * @r2: another valid rectangle
95 * @res: The result, may be one of r1/r2
96 *
97 * Computes the largest rectangle that is fully covered by
98 * r1 and r2.
99 *
100 * Note that this is different from a union, which is the smallest
101 * rectangle that covers the rectangles.
102 *
103 * The use case for this function is joining opaque rectangles.
104 **/
105 static inline void
106 gsk_rect_coveragecxx . . $ gsk_rect_coverage(fce9ca854a08cbe3). (const graphene_rect_tcxx . . $ graphene_rect_t# *r1,
107 const graphene_rect_tcxx . . $ graphene_rect_t# *r2,
108 graphene_rect_tcxx . . $ graphene_rect_t# *res)
109 {
110 float x1min, y1min, x2min, y2min;
111 float x1max, y1max, x2max, y2max;
112 float size, size2;
113 graphene_rect_tcxx . . $ graphene_rect_t# r;
114
115 /* Assumes both rects are already normalized, as they usually are */
116 size = r1->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * r1->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
117 size2 = r2->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * r2->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
118 if (size >= size2)
119 {
120 r = *r1;
121 }
122 else
123 {
124 r = *r2;
125 size = size2;
126 }
127
128 x1min = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (r1->origin.x, r2->origin.x);
129 y1min = MINcxx . . $ _graphene_point_t#y. (r1->origin.y, r2->origin.y);
130 x1max = MAXcxx . . $ _graphene_point_t#x. (r1->origin.x, r2->origin.x);
131 y1max = MAXcxx . . $ _graphene_point_t#y. (r1->origin.y, r2->origin.y);
132 x2min = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (r1->origin.x + r1->size.width, r2->origin.x + r2->size.width);
133 y2min = MINcxx . . $ _graphene_size_t#height. (r1->origin.y + r1->size.height, r2->origin.y + r2->size.height);
134 x2max = MAXcxx . . $ _graphene_size_t#width. (r1->origin.x + r1->size.width, r2->origin.x + r2->size.width);
135 y2max = MAXcxx . . $ _graphene_point_t#y. (r1->origin.y + r1->size.height, r2->origin.y + r2->size.height);
136
137 if (x2min >= x1max && y2min >= y1max)
138 {
139 float w, h;
140
141 w = x2min - x1max;
142 h = y2max - y1min;
143 size2 = w * h;
144 if (size2 > size)
145 {
146 r = GRAPHENE_RECT_INITcxx . . $ `<external>/7539008420172022992/graphene-rect.h:50:9`! (x1max, y1min, w, h);
147 size = size2;
148 }
149
150 w = x2max - x1min;
151 h = y2min - y1max;
152 size2 = w * h;
153 if (size2 > size)
154 {
155 r = GRAPHENE_RECT_INITcxx . . $ `<external>/7539008420172022992/graphene-rect.h:50:9`! (x1min, y1max, w, h);
156 size = size2;
157 }
158 }
159
160 *res = r;
161 }
162
163 /**
164 * gsk_rect_subtract:
165 * @m: a valid rectangle for the minuend
166 * @s: a valid rectangle for the subtrahend
167 * @res: The result, may be the same as `m` or `s`
168 *
169 * Computes the largest rectangle that is fully covered by
170 * m and does not contain any part of s.
171 *
172 * Returns: TRUE if a rectangle was returned, FALSE if the subtrahend
173 * fully covers the minuend and no valid rectangle remains.
174 **/
175 static inline gbooleancxx . . $ gboolean#
176 gsk_rect_subtractcxx . . $ gsk_rect_subtract(780c660fd2a2d0af). (const graphene_rect_tcxx . . $ graphene_rect_t# *m,
177 const graphene_rect_tcxx . . $ graphene_rect_t# *s,
178 graphene_rect_tcxx . . $ graphene_rect_t# *res)
179 {
180 graphene_rect_tcxx . . $ graphene_rect_t# cur = GRAPHENE_RECT_INITcxx . . $ graphene_rect_t# (0, 0, 0, 0);
181 float tmp, size = 0.0f;
182
183 /* left */
184 tmp = MINcxx . . $ _graphene_rect_t#origin. (s->origin.x - m->origin.x, m->size.width);
185 if (tmp * m->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. > size)
186 {
187 cur = GRAPHENE_RECT_INITcxx . . $ _graphene_point_t#y. (m->origin.x,
188 m->origin.y,
189 tmp,
190 m->size.height);
191 size = cur.sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * cur.sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
192 }
193
194 /* right */
195 tmp = MINcxx . . $ _graphene_point_t#x. (m->origin.x + m->size.width - (s->origin.x + s->size.width), m->size.width);
196 if (tmp * m->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. > size)
197 {
198 cur = GRAPHENE_RECT_INITcxx . . $ _graphene_point_t#y. (MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (m->origin.x, s->origin.x + s->size.width),
199 m->origin.y,
200 tmp,
201 m->size.height);
202 size = cur.sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * cur.sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
203 }
204
205 /* top */
206 tmp = MINcxx . . $ _graphene_rect_t#origin. (s->origin.y - m->origin.y, m->size.height);
207 if (tmp * m->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. > size)
208 {
209 cur = GRAPHENE_RECT_INITcxx . . $ _graphene_rect_t#size. (m->origin.x,
210 m->origin.y,
211 m->size.width,
212 tmp);
213 size = cur.sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * cur.sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
214 }
215
216 /* bottom */
217 tmp = MINcxx . . $ _graphene_size_t#height. (m->origin.y + m->size.height - (s->origin.y + s->size.height), m->size.height);
218 if (tmp * m->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. > size)
219 {
220 cur = GRAPHENE_RECT_INITcxx . . $ `<external>/7539008420172022992/graphene-rect.h:50:9`! (m->origin.x,
221 MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (m->origin.y, s->origin.y + s->size.height),
222 m->size.width,
223 tmp);
224 size = cur.sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * cur.sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
225 }
226
227 if (size <= 0)
228 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
229
230 *res = cur;
231 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
232 }
233
234 /**
235 * gsk_rect_snap_to_grid:
236 * @src: rectangle to snap
237 * @grid_scale: the scale of the grid
238 * @grid_offset: the offset of the grid
239 * @dest: target to snap to. Can be identical to source
240 *
241 * Snaps @src to the grid specified by the given scale
242 * and offset.
243 * Grid points to snap to will be at the given offset and
244 * then spaced apart by the inverse of the given scale,
245 * ie an offset of 0.5 and a scale of 3 will snap to
246 * (..., 0.1667, 0.5, 0.8333, 1.1667, 1.5, ...).
247 *
248 * Snapping is done by growing the rectangle.
249 *
250 * Note that floating point rounding issues might result
251 * in the snapping not being perfectly exact.
252 *
253 * Returns false if the resulting rect has zero width/height
254 **/
255 static inline gbooleancxx . . $ gboolean# G_GNUC_WARN_UNUSED_RESULTcxx . . $ `<external>/12741050725406041920/gmacros.h:850:9`!
256 gsk_rect_snap_to_gridcxx . . $ gsk_rect_snap_to_grid(8c254ebb11f99f99). (const graphene_rect_tcxx . . $ graphene_rect_t# *src,
257 const graphene_vec2_tcxx . . $ graphene_vec2_t# *grid_scale,
258 const graphene_point_tcxx . . $ graphene_point_t# *grid_offset,
259 graphene_rect_tcxx . . $ graphene_rect_t# *dest)
260 {
261 float x, y, xscale, yscale;
262
263 xscale = graphene_vec2_get_xcxx . . $ graphene_vec2_get_x(3ea319d7328b016e). (grid_scale);
264 yscale = graphene_vec2_get_ycxx . . $ graphene_vec2_get_y(3ea319d7328b016e). (grid_scale);
265
266 x = floorf ((src->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + grid_offset->xcxx . . $ _graphene_point_t#x.) * xscale);
267 y = floorf ((src->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + grid_offset->ycxx . . $ _graphene_point_t#y.) * yscale);
268 *dest = GRAPHENE_RECT_INITcxx . . $ _graphene_rect_t#origin. (
269 x / xscale - grid_offset->x,
270 y / yscale - grid_offset->y,
271 (ceilf ((src->origin.x + grid_offset->x + src->size.width) * xscale) - x) / xscale,
272 (ceilf ((src->origin.y + grid_offset->y + src->size.height) * yscale) - y) / yscale);
273
274 if (dest->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. <= 0.0 || dest->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. <= 0.0)
275 return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!;
276
277 return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!;
278 }
279
280 static inline gbooleancxx . . $ gboolean# G_GNUC_PUREcxx . . $ `<external>/12741050725406041920/gmacros.h:291:9`!
281 gsk_rect_is_emptycxx . . $ gsk_rect_is_empty(5bc492ff68711017). (const graphene_rect_tcxx . . $ graphene_rect_t# *rect)
282 {
283 return rect->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. == 0 || rect->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. == 0;
284 }
285
286 static inline void
287 gsk_rect_to_floatcxx . . $ gsk_rect_to_float(b6135c07a0e73d0c). (const graphene_rect_tcxx . . $ graphene_rect_t# *rect,
288 float values[4])
289 {
290 values[0] = rect->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x.;
291 values[1] = rect->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.;
292 values[2] = rect->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.;
293 values[3] = rect->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
294 }
295
296 static inline void
297 gsk_rect_to_cairo_growcxx . . $ gsk_rect_to_cairo_grow(28a524355fff5c1e). (const graphene_rect_tcxx . . $ graphene_rect_t# *graphene,
298 cairo_rectangle_int_tcxx . . $ cairo_rectangle_int_t# *cairo)
299 {
300 cairo->xcxx . . $ _cairo_rectangle_int#x. = floorf (graphene->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x.);
301 cairo->ycxx . . $ _cairo_rectangle_int#y. = floorf (graphene->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.);
302 cairo->widthcxx . . $ _cairo_rectangle_int#width. = ceilf (graphene->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + graphene->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.) - cairo->xcxx . . $ _cairo_rectangle_int#x.;
303 cairo->heightcxx . . $ _cairo_rectangle_int#height. = ceilf (graphene->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + graphene->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.) - cairo->ycxx . . $ _cairo_rectangle_int#y.;
304 }
305
306 static inline gbooleancxx . . $ gboolean# G_GNUC_WARN_UNUSED_RESULTcxx . . $ `<external>/12741050725406041920/gmacros.h:850:9`!
307 gsk_rect_to_cairo_shrinkcxx . . $ gsk_rect_to_cairo_shrink(384f04d8213402e7). (const graphene_rect_tcxx . . $ graphene_rect_t# *graphene,
308 cairo_rectangle_int_tcxx . . $ cairo_rectangle_int_t# *cairo)
309 {
310 cairo->xcxx . . $ _cairo_rectangle_int#x. = ceilf (graphene->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x.);
311 cairo->ycxx . . $ _cairo_rectangle_int#y. = ceilf (graphene->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.);
312 cairo->widthcxx . . $ _cairo_rectangle_int#width. = floorf (graphene->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + graphene->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.) - cairo->xcxx . . $ _cairo_rectangle_int#x.;
313 cairo->heightcxx . . $ _cairo_rectangle_int#height. = floorf (graphene->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + graphene->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.) - cairo->ycxx . . $ _cairo_rectangle_int#y.;
314
315 return cairo->widthcxx . . $ _cairo_rectangle_int#width. > 0 && cairo->heightcxx . . $ _cairo_rectangle_int#height. > 0;
316 }
317
318 static inline gbooleancxx . . $ gboolean#
319 gsk_rect_equalcxx . . $ gsk_rect_equal(5869f32967be43fe). (const graphene_rect_tcxx . . $ graphene_rect_t# *r1,
320 const graphene_rect_tcxx . . $ graphene_rect_t# *r2)
321 {
322 return r1->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. == r2->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. &&
323 r1->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. == r2->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. &&
324 r1->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. == r2->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. &&
325 r1->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. == r2->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
326 }
327
328 static inline void
329 gsk_gpu_rect_to_floatcxx . . $ gsk_gpu_rect_to_float(30640fee0e0cfd21). (const graphene_rect_tcxx . . $ graphene_rect_t# *rect,
330 const graphene_point_tcxx . . $ graphene_point_t# *offset,
331 float values[4])
332 {
333 values[0] = rect->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + offset->xcxx . . $ _graphene_point_t#x.;
334 values[1] = rect->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. + offset->ycxx . . $ _graphene_point_t#y.;
335 values[2] = rect->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.;
336 values[3] = rect->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.;
337 }
338
339 static inline void
340 gsk_rect_round_largercxx . . $ gsk_rect_round_larger(25fa20c7bd5ffa61). (graphene_rect_tcxx . . $ graphene_rect_t# *rect)
341 {
342 float x = floor (rect->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x.);
343 float y = floor (rect->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.);
344 *rect = GRAPHENE_RECT_INITcxx . . $ _graphene_rect_t#origin. (x, y,
345 ceil (rect->origin.x + rect->size.width) - x,
346 ceil (rect->origin.y + rect->size.height) - y);
347 }
348
349 static inline void
350 gsk_rect_scalecxx . . $ gsk_rect_scale(ac5935993e19972d). (const graphene_rect_tcxx . . $ graphene_rect_t# *r,
351 float sx,
352 float sy,
353 graphene_rect_tcxx . . $ graphene_rect_t# *res)
354 {
355 if (G_UNLIKELYcxx . . $ `<external>/12741050725406041920/gmacros.h:1285:9`! (sx < 0 || sy < 0))
356 {
357 graphene_rect_scalecxx . . $ graphene_rect_scale(ac5935993e19972d). (r, sx, sy, res);
358 return;
359 }
360
361 res->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. = r->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. * sx;
362 res->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. = r->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. * sy;
363 res->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. = r->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. * sx;
364 res->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. = r->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. * sy;
365 }
366
367 static inline void
368 gsk_rect_normalizecxx . . $ gsk_rect_normalize(25fa20c7bd5ffa61). (graphene_rect_tcxx . . $ graphene_rect_t# *r)
369 {
370 if (r->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. < 0.f)
371 {
372 float size = fabsf (r->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width.);
373
374 r->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. -= size;
375 r->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. = size;
376 }
377
378 if (r->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. < 0.f)
379 {
380 float size = fabsf (r->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.);
381
382 r->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y. -= size;
383 r->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height. = size;
384 }
385 }
386
387 static inline void
388 gsk_rect_dihedralcxx . . $ gsk_rect_dihedral(fb5d704ec2161b01). (const graphene_rect_tcxx . . $ graphene_rect_t# *src,
389 GdkDihedralcxx . . $ GdkDihedral# dihedral,
390 graphene_rect_tcxx . . $ graphene_rect_t# *res)
391 {
392 float xx, xy, yx, yy;
393
394 gdk_dihedral_get_mat2cxx . . $ gdk_dihedral_get_mat2(28b0c0e89123d677). (dihedral, &xx, &xy, &yx, &yy);
395
396 graphene_rect_initcxx . . $ graphene_rect_init(41a513f04ded43b4). (res,
397 (xx * src->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + xy * src->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.),
398 (yx * src->origincxx . . $ _graphene_rect_t#origin..xcxx . . $ _graphene_point_t#x. + yy * src->origincxx . . $ _graphene_rect_t#origin..ycxx . . $ _graphene_point_t#y.),
399 (xx * src->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. + xy * src->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.),
400 (yx * src->sizecxx . . $ _graphene_rect_t#size..widthcxx . . $ _graphene_size_t#width. + yy * src->sizecxx . . $ _graphene_rect_t#size..heightcxx . . $ _graphene_size_t#height.));
401
402 gsk_rect_normalizecxx . . $ gsk_rect_normalize(25fa20c7bd5ffa61). (res);
403 }
404
405 static inline void
406 _graphene_rect_init_from_clip_extentscxx . . $ _graphene_rect_init_from_clip_extents(e584819679f7d575). (graphene_rect_tcxx . . $ graphene_rect_t# *rect,
407 cairo_tcxx . . $ cairo_t# *cr)
408 {
409 double x1c, y1c, x2c, y2c;
410
411 cairo_clip_extentscxx . . $ cairo_clip_extents(68188b4bdeb3c77a). (cr, &x1c, &y1c, &x2c, &y2c);
412 gsk_rect_initcxx . . $ gsk_rect_init(3fb0d66f2a5e64ba). (rect, x1c, y1c, x2c - x1c, y2c - y1c);
413 }