Debian Codegraph @

src/sna/sna_trapezoids.c

raw symbols SCIP
1 /*
2 * Copyright (c) 2007 David Turner
3 * Copyright (c) 2008 M Joonas Pihlaja
4 * Copyright (c) 2011 Intel Corporation
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 * Authors:
26 * Chris Wilson <[email protected]>
27 *
28 */
29
30 #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:410:9`!
31 #include "config.h"cxx . . $ `<file>/config.h`/
32 #endif
33
34 #include "sna.h"cxx . . $ `<file>/src/sna/sna.h`/
35 #include "sna_render.h"cxx . . $ `<file>/src/sna/sna_render.h`/
36 #include "sna_render_inline.h"cxx . . $ `<file>/src/sna/sna_render_inline.h`/
37 #include "sna_trapezoids.h"cxx . . $ `<file>/src/sna/sna_trapezoids.h`/
38 #include "fb/fbpict.h"cxx . . $ `<file>/src/sna/fb/fbpict.h`/
39
40 #include <mipict.h>
41
42 /* TODO: Emit unantialiased and MSAA triangles. */
43
44 #ifndef MAXcxx . . $ `src/sna/sna.h:549:9`!
45 #define MAX(x,y) ((x) >= (y) ? (x) : (y))
46 #endif
47
48 #ifndef MINcxx . . $ `src/sna/sna.h:545:9`!
49 #define MIN(x,y) ((x) <= (y) ? (x) : (y))
50 #endif
51
52 #define region_countcxx . . $ `src/sna/sna_trapezoids.c:52:9`!(r) ((r)->data ? (r)->data->numRects : 1)
53 #define region_boxescxx . . $ `src/sna/sna_trapezoids.c:53:9`!(r) ((r)->data ? (BoxPtr)((r)->data + 1) : &(r)->extents)
54
55 inline static xFixedcxx . . $ xFixed#
56 line_x_for_ycxx . . $ line_x_for_y(3ada8f52860e3673).(const xLineFixedcxx . . $ xLineFixed# *l, xFixedcxx . . $ xFixed# y, boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! ceil)
57 {
58 xFixed_32_32cxx . . $ xFixed_32_32# ex = (xFixed_32_32cxx . . $ xFixed_32_32#)(y - l->p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y.) * (l->p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. - l->p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.);
59 xFixedcxx . . $ xFixed# d = l->p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y. - l->p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y.;
60
61 if (ceil)
62 ex += (d - 1);
63
64 return l->p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. + (xFixedcxx . . $ xFixed#) (ex / d);
65 }
66
67 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! trapezoids_boundscxx . . $ trapezoids_bounds(62af1b300b1e57d8).(int n, const xTrapezoidcxx . . $ xTrapezoid# *t, BoxPtrcxx . . $ BoxPtr# box)
68 {
69 xFixedcxx . . $ xFixed# x1, y1, x2, y2;
70
71 /* XXX need 33 bits... */
72 x1 = y1 = INT_MAXcxx . . $ `<external>/67164224788392828/limits.h:120:9`! / 2;
73 x2 = y2 = INT_MINcxx . . $ `<external>/67164224788392828/limits.h:118:9`! / 2;
74
75 do {
76 xFixedcxx . . $ xFixed# fx1, fx2, v;
77
78 if (!xTrapezoidValidcxx . . $ `<external>/15484583900196244369/picture.h:215:9`!(t)) {
79 __DBGcxx . . $ `src/sna/sna_trapezoids.h:19:9`!(("%s: skipping invalid trapezoid: top=%d, bottom=%d, left=(%d, %d), (%d, %d), right=(%d, %d), (%d, %d)\n",
80 __FUNCTION__,
81 t->top, t->bottom,
82 t->left.p1.x, t->left.p1.y,
83 t->left.p2.x, t->left.p2.y,
84 t->right.p1.x, t->right.p1.y,
85 t->right.p2.x, t->right.p2.y));
86 continue;
87 }
88
89 if (t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top. < y1)
90 y1 = t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top.;
91 if (t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom. > y2)
92 y2 = t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom.;
93
94 if (((t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. - x1) | (t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. - x1)) < 0) {
95 if (pixman_fixed_floorcxx . . $ `<external>/17639638556090915931/pixman.h:134:9`!(t->left.p1.x) == pixman_fixed_floorcxx . . $ `<external>/17639638556090915931/pixman.h:134:9`!(t->left.p2.x)) {
96 x1 = pixman_fixed_floorcxx . . $ `<external>/17639638556090915931/pixman.h:134:9`!(t->left.p1.x);
97 } else {
98 if (t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y. == t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top.)
99 fx1 = t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.;
100 else
101 fx1 = line_x_for_ycxx . . $ line_x_for_y(3ada8f52860e3673).(&t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left., t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
102
103 if (t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y. == t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom.)
104 fx2 = t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.;
105 else
106 fx2 = line_x_for_ycxx . . $ line_x_for_y(3ada8f52860e3673).(&t->leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left., t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom., falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
107
108 v = mincxx . . $ `<external>/18388808314464358495/misc.h:136:9`!(fx1, fx2);
109 if (v < x1)
110 x1 = pixman_fixed_floorcxx . . $ `<external>/17639638556090915931/pixman.h:134:9`!(v);
111 }
112 }
113
114 if (((x2 - t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.) | (x2 - t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.)) < 0) {
115 if (pixman_fixed_ceilcxx . . $ `<external>/17639638556090915931/pixman.h:135:9`!(t->right.p1.x) == pixman_fixed_ceilcxx . . $ `<external>/17639638556090915931/pixman.h:135:9`!(t->right.p2.x)) {
116 x2 = pixman_fixed_ceilcxx . . $ `<external>/17639638556090915931/pixman.h:135:9`!(t->right.p1.x);
117 } else {
118 if (t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y. == t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top.)
119 fx1 = t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.;
120 else
121 fx1 = line_x_for_ycxx . . $ line_x_for_y(3ada8f52860e3673).(&t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right., t->topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
122
123 if (t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..ycxx . . $ $anonymous_type_d4be3316d06f2656_7#y. == t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom.)
124 fx2 = t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.;
125 else
126 fx2 = line_x_for_ycxx . . $ line_x_for_y(3ada8f52860e3673).(&t->rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right., t->bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom., truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
127
128 v = maxcxx . . $ `<external>/18388808314464358495/misc.h:137:9`!(fx1, fx2);
129 if (v > x2)
130 x2 = pixman_fixed_ceilcxx . . $ `<external>/17639638556090915931/pixman.h:135:9`!(v);
131 }
132 }
133 } while (t++, --n);
134
135 box->x1cxx . . $ pixman_box16#x1. = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(x1);
136 box->x2cxx . . $ pixman_box16#x2. = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(x2);
137 box->y1cxx . . $ pixman_box16#y1. = pixman_fixed_integer_floorcxx . . $ `src/sna/sna_trapezoids.h:386:9`!(y1);
138 box->y2cxx . . $ pixman_box16#y2. = pixman_fixed_integer_ceilcxx . . $ `src/sna/sna_trapezoids.h:387:9`!(y2);
139
140 return box->x2cxx . . $ pixman_box16#x2. > box->x1cxx . . $ pixman_box16#x1. && box->y2cxx . . $ pixman_box16#y2. > box->y1cxx . . $ pixman_box16#y1.;
141 }
142
143 static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!
144 trapezoids_inplace_fallbackcxx . . $ trapezoids_inplace_fallback(926b567a9dab3085).(struct snacxx . . $ sna# *sna,
145 CARD8cxx . . $ CARD8# op,
146 PicturePtrcxx . . $ PicturePtr# src, PicturePtrcxx . . $ PicturePtr# dst, PictFormatPtrcxx . . $ PictFormatPtr# mask,
147 int ntrap, xTrapezoidcxx . . $ xTrapezoid# *traps)
148 {
149 pixman_image_tcxx . . $ pixman_image_t# *image;
150 BoxReccxx . . $ BoxRec# box;
151 uint32_tcxx . . $ uint32_t# color;
152 int dx, dy;
153
154 if (op != PictOpAddcxx . . $ `<external>/2369207440537731940/render.h:105:9`!)
155 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
156
157 if (is_monocxx . . $ is_mono(c85b09bd898fd3d4).(dst, mask)) {
158 if (dst->formatcxx . . $ _Picture#format. != PICT_a1cxx . . $ PICT_a1.)
159 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
160 } else {
161 if (dst->formatcxx . . $ _Picture#format. != PICT_a8cxx . . $ PICT_a8.)
162 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
163 }
164
165 if (!sna_picture_is_solidcxx . . $ sna_picture_is_solid(be9f52a5c21c8702).(src, &color) || (color >> 24) != 0xff) {
166 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: not an opaque solid source\n", __FUNCTION__));
167 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
168 }
169
170 box.x1cxx . . $ pixman_box16#x1. = dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
171 box.y1cxx . . $ pixman_box16#y1. = dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
172 box.x2cxx . . $ pixman_box16#x2. = dst->pDrawablecxx . . $ _Picture#pDrawable.->widthcxx . . $ _Drawable#width.;
173 box.y2cxx . . $ pixman_box16#y2. = dst->pDrawablecxx . . $ _Picture#pDrawable.->heightcxx . . $ _Drawable#height.;
174 if (pixman_region_contains_rectanglecxx . . $ pixman_region_contains_rectangle(f0f78f83a872e4f4).(dst->pCompositeClipcxx . . $ _Picture#pCompositeClip.,
175 &box) != PIXMAN_REGION_INcxx . . $ PIXMAN_REGION_IN.) {
176 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: requires clipping, drawable (%d,%d), (%d, %d), clip (%d, %d), (%d, %d)\n", __FUNCTION__,
177 box.x1, box.y1, box.x2, box.y2,
178 dst->pCompositeClip->extents.x1,
179 dst->pCompositeClip->extents.y1,
180 dst->pCompositeClip->extents.x2,
181 dst->pCompositeClip->extents.y2));
182 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
183 }
184
185 if (is_gpucxx . . $ is_gpu(498366498b5b8c6e).(sna, dst->pDrawablecxx . . $ _Picture#pDrawable., PREFER_GPU_SPANScxx . . $ `src/sna/sna_render.h:236:9`!)) {
186 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: not performing inplace as dst is already on the GPU\n",
187 __FUNCTION__));
188 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
189 }
190
191 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s\n", __FUNCTION__));
192
193 image = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
194 if (sna_drawable_move_to_cpucxx . . $ sna_drawable_move_to_cpu(9292e414f0ecdf4a).(dst->pDrawablecxx . . $ _Picture#pDrawable., MOVE_READcxx . . $ `src/sna/sna.h:815:9`! | MOVE_WRITEcxx . . $ `src/sna/sna.h:814:9`!))
195 image = image_from_pictcxx . . $ `./fb/sfb.h:39:9`!(dst, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, &dx, &dy);
196 if (image) {
197 dx += dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
198 dy += dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
199
200 if (sigtrap_getcxx . . $ `src/sna/sna.h:1371:9`!() == 0) {
201 for (; ntrap; ntrap--, traps++)
202 if (xTrapezoidValidcxx . . $ `<external>/15484583900196244369/picture.h:215:9`!(traps))
203 pixman_rasterize_trapezoidcxx . . $ pixman_rasterize_trapezoid(9d1abdd3f906ac20).(image,
204 (pixman_trapezoid_tcxx . . $ pixman_trapezoid_t# *)traps,
205 dx, dy);
206 sigtrap_putcxx . . $ sigtrap_put(49f6e7a06ebc5aa8).();
207 }
208
209 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
210 }
211
212 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
213 }
214
215 struct rasterize_traps_threadcxx . . $ rasterize_traps_thread# {
216 xTrapezoidcxx . . $ xTrapezoid# *trapscxx . . $ rasterize_traps_thread#traps.;
217 char *ptrcxx . . $ rasterize_traps_thread#ptr.;
218 int stridecxx . . $ rasterize_traps_thread#stride.;
219 BoxReccxx . . $ BoxRec# boundscxx . . $ rasterize_traps_thread#bounds.;
220 pixman_format_code_tcxx . . $ pixman_format_code_t# formatcxx . . $ rasterize_traps_thread#format.;
221 int ntrapcxx . . $ rasterize_traps_thread#ntrap.;
222 };
223
224 static void rasterize_traps_threadcxx . . $ rasterize_traps_thread(5d22bdacc48458e8).(void *arg)
225 {
226 struct rasterize_traps_threadcxx . . $ rasterize_traps_thread# *thread = arg;
227 pixman_image_tcxx . . $ pixman_image_t# *image;
228 int width, height, n;
229
230 width = thread->boundscxx . . $ rasterize_traps_thread#bounds..x2cxx . . $ pixman_box16#x2. - thread->boundscxx . . $ rasterize_traps_thread#bounds..x1cxx . . $ pixman_box16#x1.;
231 height = thread->boundscxx . . $ rasterize_traps_thread#bounds..y2cxx . . $ pixman_box16#y2. - thread->boundscxx . . $ rasterize_traps_thread#bounds..y1cxx . . $ pixman_box16#y1.;
232
233 memsetcxx . . $ memset(d1de1e4fb215f1c6).(thread->ptrcxx . . $ rasterize_traps_thread#ptr., 0, thread->stridecxx . . $ rasterize_traps_thread#stride.*height);
234 if (PIXMAN_FORMAT_DEPTHcxx . . $ `<external>/17639638556090915931/pixman.h:1030:9`!(thread->format) < 8)
235 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(thread->formatcxx . . $ rasterize_traps_thread#format.,
236 width, height,
237 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0);
238 else
239 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(thread->formatcxx . . $ rasterize_traps_thread#format.,
240 width, height,
241 (uint32_tcxx . . $ uint32_t# *)thread->ptrcxx . . $ rasterize_traps_thread#ptr.,
242 thread->stridecxx . . $ rasterize_traps_thread#stride.);
243 if (image == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
244 return;
245
246 for (n = 0; n < thread->ntrapcxx . . $ rasterize_traps_thread#ntrap.; n++)
247 if (xTrapezoidValidcxx . . $ `<external>/15484583900196244369/picture.h:215:9`!(&thread->traps[n]))
248 pixman_rasterize_trapezoidcxx . . $ pixman_rasterize_trapezoid(9d1abdd3f906ac20).(image,
249 (pixman_trapezoid_tcxx . . $ pixman_trapezoid_t# *)&thread->trapscxx . . $ rasterize_traps_thread#traps.[n],
250 -thread->boundscxx . . $ rasterize_traps_thread#bounds..x1cxx . . $ pixman_box16#x1., -thread->boundscxx . . $ rasterize_traps_thread#bounds..y1cxx . . $ pixman_box16#y1.);
251
252 if (PIXMAN_FORMAT_DEPTHcxx . . $ `<external>/17639638556090915931/pixman.h:1030:9`!(thread->format) < 8) {
253 pixman_image_tcxx . . $ pixman_image_t# *a8;
254
255 a8 = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(PIXMAN_a8cxx . . $ PIXMAN_a8.,
256 width, height,
257 (uint32_tcxx . . $ uint32_t# *)thread->ptrcxx . . $ rasterize_traps_thread#ptr.,
258 thread->stridecxx . . $ rasterize_traps_thread#stride.);
259 if (a8) {
260 pixman_image_compositecxx . . $ pixman_image_composite(191c842ee49e5cd7).(PIXMAN_OP_SRCcxx . . $ PIXMAN_OP_SRC.,
261 image, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, a8,
262 0, 0,
263 0, 0,
264 0, 0,
265 width, height);
266 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(a8);
267 }
268 }
269
270 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
271 }
272
273 static void
274 trapezoids_fallbackcxx . . $ trapezoids_fallback(d39792d1def39ea3).(struct snacxx . . $ sna# *sna,
275 CARD8cxx . . $ CARD8# op, PicturePtrcxx . . $ PicturePtr# src, PicturePtrcxx . . $ PicturePtr# dst,
276 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat, INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
277 int ntrap, xTrapezoidcxx . . $ xTrapezoid# * traps)
278 {
279 ScreenPtrcxx . . $ ScreenPtr# screen = dst->pDrawablecxx . . $ _Picture#pDrawable.->pScreencxx . . $ _Drawable#pScreen.;
280
281 if (maskFormat) {
282 PixmapPtrcxx . . $ PixmapPtr# scratch;
283 PicturePtrcxx . . $ PicturePtr# mask;
284 INT16cxx . . $ INT16# dst_x, dst_y;
285 BoxReccxx . . $ BoxRec# bounds;
286 int width, height, depth;
287 pixman_image_tcxx . . $ pixman_image_t# *image;
288 pixman_format_code_tcxx . . $ pixman_format_code_t# format;
289 int error;
290
291 trapezoid_origincxx . . $ trapezoid_origin(8b25c708ed16fcd4).(&traps[0].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left., &dst_x, &dst_y);
292
293 if (!trapezoids_boundscxx . . $ trapezoids_bounds(62af1b300b1e57d8).(ntrap, traps, &bounds))
294 return;
295
296 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: bounds (%d, %d), (%d, %d)\n", __FUNCTION__,
297 bounds.x1, bounds.y1, bounds.x2, bounds.y2));
298
299 if (!sna_compute_composite_extentscxx . . $ sna_compute_composite_extents(a0260ea3bed58da3).(&bounds,
300 src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, dst,
301 xSrc, ySrc,
302 0, 0,
303 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
304 bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.,
305 bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.))
306 return;
307
308 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: extents (%d, %d), (%d, %d)\n", __FUNCTION__,
309 bounds.x1, bounds.y1, bounds.x2, bounds.y2));
310
311 width = bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.;
312 height = bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.;
313 bounds.x1cxx . . $ pixman_box16#x1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
314 bounds.y1cxx . . $ pixman_box16#y1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
315 bounds.x2cxx . . $ pixman_box16#x2. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
316 bounds.y2cxx . . $ pixman_box16#y2. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
317 depth = maskFormat->depthcxx . . $ _PictFormat#depth.;
318 if (depth == 1) {
319 format = PIXMAN_a1cxx . . $ PIXMAN_a1.;
320 } else if (depth <= 4) {
321 format = PIXMAN_a4cxx . . $ PIXMAN_a4.;
322 depth = 4;
323 } else
324 format = PIXMAN_a8cxx . . $ PIXMAN_a8.;
325
326 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: mask (%dx%d) depth=%d, format=%08x\n",
327 __FUNCTION__, width, height, depth, format));
328 if (is_gpucxx . . $ is_gpu(498366498b5b8c6e).(sna, dst->pDrawablecxx . . $ _Picture#pDrawable., PREFER_GPU_RENDERcxx . . $ `src/sna/sna_render.h:235:9`!) ||
329 picture_is_gpucxx . . $ picture_is_gpu(13816b93a452efd5).(sna, src, PREFER_GPU_RENDERcxx . . $ `src/sna/sna_render.h:235:9`!)) {
330 int num_threads;
331
332 scratch = sna_pixmap_create_uploadcxx . . $ sna_pixmap_create_upload(cfec897c9247a908).(screen,
333 width, height, 8,
334 KGEM_BUFFER_WRITEcxx . . $ `src/sna/kgem.h:830:9`!);
335 if (!scratch)
336 return;
337
338 num_threads = sna_use_threadscxx . . $ sna_use_threads(2326284602b0bb2d).(width, height, 8);
339 if (num_threads == 1) {
340 if (depth < 8) {
341 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
342 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0);
343 } else {
344 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, scratch->devKindcxx . . $ _Pixmap#devKind.*height);
345
346 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
347 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
348 scratch->devKindcxx . . $ _Pixmap#devKind.);
349 }
350 if (image) {
351 for (; ntrap; ntrap--, traps++)
352 if (xTrapezoidValidcxx . . $ `<external>/15484583900196244369/picture.h:215:9`!(traps))
353 pixman_rasterize_trapezoidcxx . . $ pixman_rasterize_trapezoid(9d1abdd3f906ac20).(image,
354 (pixman_trapezoid_tcxx . . $ pixman_trapezoid_t# *)traps,
355 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.);
356 if (depth < 8) {
357 pixman_image_tcxx . . $ pixman_image_t# *a8;
358
359 a8 = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(PIXMAN_a8cxx . . $ PIXMAN_a8., width, height,
360 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
361 scratch->devKindcxx . . $ _Pixmap#devKind.);
362 if (a8) {
363 pixman_image_compositecxx . . $ pixman_image_composite(191c842ee49e5cd7).(PIXMAN_OP_SRCcxx . . $ PIXMAN_OP_SRC.,
364 image, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, a8,
365 0, 0,
366 0, 0,
367 0, 0,
368 width, height);
369 format = PIXMAN_a8cxx . . $ PIXMAN_a8.;
370 depth = 8;
371 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(a8);
372 }
373 }
374
375 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
376 }
377 if (format != PIXMAN_a8cxx . . $ PIXMAN_a8.) {
378 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
379 return;
380 }
381 } else {
382 struct rasterize_traps_threadcxx . . $ rasterize_traps_thread# threads[num_threads];
383 int y, dy, n;
384
385 threads[0].ptrcxx . . $ rasterize_traps_thread#ptr. = scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.;
386 threads[0].stridecxx . . $ rasterize_traps_thread#stride. = scratch->devKindcxx . . $ _Pixmap#devKind.;
387 threads[0].trapscxx . . $ rasterize_traps_thread#traps. = traps;
388 threads[0].ntrapcxx . . $ rasterize_traps_thread#ntrap. = ntrap;
389 threads[0].boundscxx . . $ rasterize_traps_thread#bounds. = bounds;
390 threads[0].formatcxx . . $ rasterize_traps_thread#format. = format;
391
392 y = bounds.y1cxx . . $ pixman_box16#y1.;
393 dy = (height + num_threads - 1) / num_threads;
394 num_threads -= (num_threads-1) * dy >= bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.;
395
396 if (sigtrap_getcxx . . $ `src/sna/sna.h:1371:9`!() == 0) {
397 for (n = 1; n < num_threads; n++) {
398 threads[n] = threads[0];
399 threads[n].ptrcxx . . $ rasterize_traps_thread#ptr. += (y - bounds.y1cxx . . $ pixman_box16#y1.) * threads[n].stridecxx . . $ rasterize_traps_thread#stride.;
400 threads[n].boundscxx . . $ rasterize_traps_thread#bounds..y1cxx . . $ pixman_box16#y1. = y;
401 threads[n].boundscxx . . $ rasterize_traps_thread#bounds..y2cxx . . $ pixman_box16#y2. = y += dy;
402
403 sna_threads_runcxx . . $ sna_threads_run(97352b2dcfaf2b).(n, rasterize_traps_threadcxx . . $ rasterize_traps_thread(5d22bdacc48458e8)., &threads[n]);
404 }
405
406 assertcxx . . $ `<external>/4398592474888995393/assert.h:50:10`!(y < threads[0].bounds.y2);
407 threads[0].ptrcxx . . $ rasterize_traps_thread#ptr. += (y - bounds.y1cxx . . $ pixman_box16#y1.) * threads[0].stridecxx . . $ rasterize_traps_thread#stride.;
408 threads[0].boundscxx . . $ rasterize_traps_thread#bounds..y1cxx . . $ pixman_box16#y1. = y;
409 rasterize_traps_threadcxx . . $ rasterize_traps_thread(5d22bdacc48458e8).(&threads[0]);
410
411 sna_threads_waitcxx . . $ sna_threads_wait(49f6e7a06ebc5aa8).();
412 sigtrap_putcxx . . $ sigtrap_put(49f6e7a06ebc5aa8).();
413 } else
414 sna_threads_killcxx . . $ sna_threads_kill(49f6e7a06ebc5aa8).();
415
416 format = PIXMAN_a8cxx . . $ PIXMAN_a8.;
417 depth = 8;
418 }
419 } else {
420 scratch = sna_pixmap_create_unattachedcxx . . $ sna_pixmap_create_unattached(4b105803fd261a60).(screen,
421 width, height,
422 depth);
423 if (!scratch)
424 return;
425
426 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, scratch->devKindcxx . . $ _Pixmap#devKind.*height);
427 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
428 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
429 scratch->devKindcxx . . $ _Pixmap#devKind.);
430 if (image) {
431 for (; ntrap; ntrap--, traps++)
432 if (xTrapezoidValidcxx . . $ `<external>/15484583900196244369/picture.h:215:9`!(traps))
433 pixman_rasterize_trapezoidcxx . . $ pixman_rasterize_trapezoid(9d1abdd3f906ac20).(image,
434 (pixman_trapezoid_tcxx . . $ pixman_trapezoid_t# *)traps,
435 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.);
436 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
437 }
438 }
439
440 mask = CreatePicturecxx . . $ CreatePicture(f47001d5eb332be6).(0, &scratch->drawablecxx . . $ _Pixmap#drawable.,
441 PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, depth, format),
442 0, 0, serverClientcxx . . $ serverClient., &error);
443 if (mask) {
444 CompositePicturecxx . . $ CompositePicture(842e5d8f7bc57502).(op, src, mask, dst,
445 xSrc + bounds.x1cxx . . $ pixman_box16#x1. - dst_x,
446 ySrc + bounds.y1cxx . . $ pixman_box16#y1. - dst_y,
447 0, 0,
448 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
449 width, height);
450 FreePicturecxx . . $ FreePicture(6fe7d876f9648735).(mask, 0);
451 }
452 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
453 } else {
454 if (dst->polyEdgecxx . . $ _Picture#polyEdge. == PolyEdgeSharpcxx . . $ `<external>/2369207440537731940/render.h:163:9`!)
455 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 1, PICT_a1cxx . . $ PICT_a1.);
456 else
457 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 8, PICT_a8cxx . . $ PICT_a8.);
458
459 for (; ntrap; ntrap--, traps++)
460 trapezoids_fallbackcxx . . $ trapezoids_fallback(d39792d1def39ea3).(sna, op,
461 src, dst, maskFormat,
462 xSrc, ySrc, 1, traps);
463 }
464 }
465
466 static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!
467 trapezoid_spans_maybe_inplacecxx . . $ trapezoid_spans_maybe_inplace(5bb10984a4c3f877).(struct snacxx . . $ sna# *sna,
468 CARD8cxx . . $ CARD8# op, PicturePtrcxx . . $ PicturePtr# src, PicturePtrcxx . . $ PicturePtr# dst,
469 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat)
470 {
471 struct sna_pixmapcxx . . $ sna_pixmap# *priv;
472
473 if (NO_SCAN_CONVERTERcxx . . $ `src/sna/sna_trapezoids.h:10:9`!)
474 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
475
476 if (dst->alphaMapcxx . . $ _Picture#alphaMap.)
477 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
478 if (is_monocxx . . $ is_mono(c85b09bd898fd3d4).(dst, maskFormat))
479 goto out;
480
481 switch ((int)dst->formatcxx . . $ _Picture#format.) {
482 case PICT_a8cxx . . $ PICT_a8.:
483 if (!sna_picture_is_solidcxx . . $ sna_picture_is_solid(be9f52a5c21c8702).(src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
484 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
485
486 switch (op) {
487 case PictOpIncxx . . $ `<external>/2369207440537731940/render.h:98:9`!:
488 case PictOpAddcxx . . $ `<external>/2369207440537731940/render.h:105:9`!:
489 case PictOpSrccxx . . $ `<external>/2369207440537731940/render.h:94:9`!:
490 break;
491 default:
492 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
493 }
494 break;
495
496 case PICT_x8r8g8b8cxx . . $ PICT_x8r8g8b8.:
497 case PICT_a8r8g8b8cxx . . $ PICT_a8r8g8b8.:
498 if (picture_is_gpucxx . . $ picture_is_gpu(13816b93a452efd5).(sna, src, 0))
499 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
500
501 switch (op) {
502 case PictOpOvercxx . . $ `<external>/2369207440537731940/render.h:96:9`!:
503 case PictOpAddcxx . . $ `<external>/2369207440537731940/render.h:105:9`!:
504 case PictOpOutReversecxx . . $ `<external>/2369207440537731940/render.h:101:9`!:
505 break;
506 case PictOpSrccxx . . $ `<external>/2369207440537731940/render.h:94:9`!:
507 if (sna_picture_is_solidcxx . . $ sna_picture_is_solid(be9f52a5c21c8702).(src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!))
508 break;
509
510 if (!sna_drawable_is_clearcxx . . $ sna_drawable_is_clear(ea9641e720ac7327).(dst->pDrawablecxx . . $ _Picture#pDrawable.))
511 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
512 break;
513 default:
514 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
515 }
516 break;
517 default:
518 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
519 }
520
521 out:
522 priv = sna_pixmap_from_drawablecxx . . $ sna_pixmap_from_drawable(b9f7f57c3c40bed3).(dst->pDrawablecxx . . $ _Picture#pDrawable.);
523 if (priv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
524 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? yes -- unattached\n", __FUNCTION__));
525 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
526 }
527
528 if (priv->cpu_bocxx . . $ sna_pixmap#cpu_bo. && kgem_bo_is_busycxx . . $ kgem_bo_is_busy(42b81767c09ba51c).(priv->cpu_bocxx . . $ sna_pixmap#cpu_bo.)) {
529 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? no -- CPU bo is busy\n", __FUNCTION__));
530 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
531 }
532
533 if (DAMAGE_IS_ALLcxx . . $ `src/sna/sna_damage.h:25:9`!(priv->cpu_damage) || priv->gpu_damagecxx . . $ sna_pixmap#gpu_damage. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
534 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? yes -- damaged on CPU only (all? %d)\n", __FUNCTION__, DAMAGE_IS_ALL(priv->cpu_damage)));
535 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
536 }
537
538 if (priv->clearcxx . . $ sna_pixmap#clear.) {
539 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? clear, %s\n", __FUNCTION__,
540 dst->pDrawable->width <= TOR_INPLACE_SIZE ? "yes" : "no"));
541 return dst->pDrawablecxx . . $ _Picture#pDrawable.->widthcxx . . $ _Drawable#width. <= TOR_INPLACE_SIZEcxx . . $ `src/sna/sna_trapezoids.h:396:9`!;
542 }
543
544 if (kgem_bo_is_busycxx . . $ kgem_bo_is_busy(42b81767c09ba51c).(priv->gpu_bocxx . . $ sna_pixmap#gpu_bo.)) {
545 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? no, GPU bo is busy\n", __FUNCTION__));
546 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
547 }
548
549 if (priv->cpu_damagecxx . . $ sna_pixmap#cpu_damage.) {
550 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? yes, idle GPU bo and damage on idle CPU\n", __FUNCTION__));
551 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
552 }
553
554 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s? small enough? %s\n", __FUNCTION__,
555 dst->pDrawable->width <= TOR_INPLACE_SIZE ? "yes" : "no"));
556 return dst->pDrawablecxx . . $ _Picture#pDrawable.->widthcxx . . $ _Drawable#width. <= TOR_INPLACE_SIZEcxx . . $ `src/sna/sna_trapezoids.h:396:9`!;
557 }
558
559 void
560 sna_composite_trapezoidscxx . . $ sna_composite_trapezoids(b799eecf52fec6e0).(CARD8cxx . . $ CARD8# op,
561 PicturePtrcxx . . $ PicturePtr# src,
562 PicturePtrcxx . . $ PicturePtr# dst,
563 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
564 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
565 int ntrap, xTrapezoidcxx . . $ xTrapezoid# *traps)
566 {
567 PixmapPtrcxx . . $ PixmapPtr# pixmap = get_drawable_pixmapcxx . . $ get_drawable_pixmap(37fca7f3554b94d5).(dst->pDrawablecxx . . $ _Picture#pDrawable.);
568 struct snacxx . . $ sna# *sna = to_sna_from_pixmapcxx . . $ to_sna_from_pixmap(243f11b5bd8a3947).(pixmap);
569 struct sna_pixmapcxx . . $ sna_pixmap# *priv;
570 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! force_fallback = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
571 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! rectilinear, pixel_aligned;
572 unsigned flags;
573 int n;
574
575 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s(op=%d, src=(%d, %d), mask=%08x, ntrap=%d)\n", __FUNCTION__,
576 op, xSrc, ySrc,
577 maskFormat ? (int)maskFormat->format : 0,
578 ntrap));
579
580 if (ntrap == 0)
581 return;
582
583 if (NO_ACCELcxx . . $ `src/sna/sna_trapezoids.h:6:9`!)
584 goto force_fallback;
585
586 if (FORCE_FALLBACKcxx . . $ `src/sna/sna_trapezoids.h:7:9`! > 0)
587 goto force_fallback;
588
589 if (wedgedcxx . . $ wedged(99a00183d23f5b6).(sna)) {
590 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: fallback -- wedged\n", __FUNCTION__));
591 goto force_fallback;
592 }
593
594 if (dst->alphaMapcxx . . $ _Picture#alphaMap.) {
595 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: fallback -- dst alpha map\n", __FUNCTION__));
596 goto force_fallback;
597 }
598
599 priv = sna_pixmapcxx . . $ sna_pixmap(7ecb3578b4f1181f).(pixmap);
600 if (priv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) {
601 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: fallback -- dst is unattached\n", __FUNCTION__));
602 goto force_fallback;
603 }
604
605 if (FORCE_FALLBACKcxx . . $ `src/sna/sna_trapezoids.h:7:9`! == 0 &&
606 !is_gpu_dstcxx . . $ is_gpu_dst(8b21012079062e81).(priv) && !picture_is_gpucxx . . $ picture_is_gpu(13816b93a452efd5).(sna, src, 0) && untransformedcxx . . $ untransformed(5a85b3426b538a74).(src)) {
607 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: force fallbacks -- (!gpu dst, %dx%d? %d) && (src-is-cpu? %d && untransformed? %d)\n",
608 __FUNCTION__, dst->pDrawable->width, dst->pDrawable->height,
609 !is_gpu_dst(priv), !picture_is_gpu(sna, src, 0), untransformed(src)));
610
611 force_fallback:
612 force_fallback = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
613 }
614
615 /* scan through for fast rectangles */
616 rectilinear = pixel_aligned = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
617 if (is_monocxx . . $ is_mono(c85b09bd898fd3d4).(dst, maskFormat)) {
618 for (n = 0; n < ntrap && rectilinear; n++) {
619 int lx1 = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(traps[n].left.p1.x + pixman_fixed_1_minus_ecxx . . $ `<external>/17639638556090915931/pixman.h:127:9`!/2);
620 int lx2 = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(traps[n].left.p2.x + pixman_fixed_1_minus_ecxx . . $ `<external>/17639638556090915931/pixman.h:127:9`!/2);
621 int rx1 = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(traps[n].right.p1.x + pixman_fixed_1_minus_ecxx . . $ `<external>/17639638556090915931/pixman.h:127:9`!/2);
622 int rx2 = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(traps[n].right.p2.x + pixman_fixed_1_minus_ecxx . . $ `<external>/17639638556090915931/pixman.h:127:9`!/2);
623 rectilinear &= lx1 == lx2 && rx1 == rx2;
624 }
625 } else if (dst->polyModecxx . . $ _Picture#polyMode. != PolyModePrecisecxx . . $ `<external>/2369207440537731940/render.h:166:9`!) {
626 for (n = 0; n < ntrap && rectilinear; n++) {
627 int lx1 = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.);
628 int lx2 = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.);
629 int rx1 = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.);
630 int rx2 = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.);
631 int top = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top.);
632 int bot = pixman_fixed_to_fastcxx . . $ pixman_fixed_to_fast(7864480464b09eea).(traps[n].bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom.);
633
634 rectilinear &= lx1 == lx2 && rx1 == rx2;
635 pixel_aligned &= ((top | bot | lx1 | lx2 | rx1 | rx2) & FAST_SAMPLES_maskcxx . . $ `src/sna/sna_trapezoids.h:384:9`!) == 0;
636 }
637 } else {
638 for (n = 0; n < ntrap && rectilinear; n++) {
639 rectilinear &=
640 traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. == traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. &&
641 traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. == traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.;
642 pixel_aligned &=
643 ((traps[n].topcxx . . $ $anonymous_type_d4be3316d06f2656_10#top. | traps[n].bottomcxx . . $ $anonymous_type_d4be3316d06f2656_10#bottom. |
644 traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. | traps[n].leftcxx . . $ $anonymous_type_d4be3316d06f2656_10#left..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. |
645 traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p1cxx . . $ $anonymous_type_d4be3316d06f2656_8#p1..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x. | traps[n].rightcxx . . $ $anonymous_type_d4be3316d06f2656_10#right..p2cxx . . $ $anonymous_type_d4be3316d06f2656_8#p2..xcxx . . $ $anonymous_type_d4be3316d06f2656_7#x.)
646 & pixman_fixed_1_minus_ecxx . . $ `<external>/17639638556090915931/pixman.h:127:9`!) == 0;
647 }
648 }
649
650 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: rectilinear? %d, pixel-aligned? %d, mono? %d precise? %d\n",
651 __FUNCTION__, rectilinear, pixel_aligned,
652 is_mono(dst, maskFormat), is_precise(dst, maskFormat)));
653
654 flags = 0;
655 if (rectilinear) {
656 if (pixel_aligned) {
657 if (composite_aligned_boxescxx . . $ composite_aligned_boxes(ddd36e1a3e80d7e).(sna, op, src, dst,
658 maskFormat,
659 xSrc, ySrc,
660 ntrap, traps,
661 force_fallback))
662 return;
663 } else {
664 if (composite_unaligned_boxescxx . . $ composite_unaligned_boxes(ddd36e1a3e80d7e).(sna, op, src, dst,
665 maskFormat,
666 xSrc, ySrc,
667 ntrap, traps,
668 force_fallback))
669 return;
670 }
671 flags |= COMPOSITE_SPANS_RECTILINEARcxx . . $ `src/sna/sna_render.h:260:9`!;
672 }
673
674 if (force_fallback)
675 goto fallback;
676
677 if (is_monocxx . . $ is_mono(c85b09bd898fd3d4).(dst, maskFormat) &&
678 mono_trapezoids_span_convertercxx . . $ mono_trapezoids_span_converter(ea83a1c0962ccbd6).(sna, op, src, dst,
679 xSrc, ySrc,
680 ntrap, traps))
681 return;
682
683 if (trapezoid_spans_maybe_inplacecxx . . $ trapezoid_spans_maybe_inplace(5bb10984a4c3f877).(sna, op, src, dst, maskFormat)) {
684 flags |= COMPOSITE_SPANS_INPLACE_HINTcxx . . $ `src/sna/sna_render.h:261:9`!;
685 if (trapezoid_span_inplacecxx . . $ trapezoid_span_inplace(163a8b00052c43b0).(sna, op, src, dst, maskFormat, flags,
686 xSrc, ySrc, ntrap, traps,
687 falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!))
688 return;
689 }
690
691 if (trapezoid_span_convertercxx . . $ trapezoid_span_converter(a67285f08a98579e).(sna, op, src, dst, maskFormat, flags,
692 xSrc, ySrc, ntrap, traps))
693 return;
694
695 if (trapezoid_span_inplacecxx . . $ trapezoid_span_inplace(163a8b00052c43b0).(sna, op, src, dst, maskFormat, flags,
696 xSrc, ySrc, ntrap, traps,
697 falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!))
698 return;
699
700 if (trapezoid_mask_convertercxx . . $ trapezoid_mask_converter(5084879483bef6d).(op, src, dst, maskFormat, flags,
701 xSrc, ySrc, ntrap, traps))
702 return;
703
704 fallback:
705 if (trapezoid_span_inplacecxx . . $ trapezoid_span_inplace(163a8b00052c43b0).(sna, op, src, dst, maskFormat, flags,
706 xSrc, ySrc, ntrap, traps,
707 truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!))
708 return;
709
710 if (trapezoid_span_fallbackcxx . . $ trapezoid_span_fallback(5084879483bef6d).(op, src, dst, maskFormat, flags,
711 xSrc, ySrc, ntrap, traps))
712 return;
713
714 if (trapezoids_inplace_fallbackcxx . . $ trapezoids_inplace_fallback(926b567a9dab3085).(sna, op, src, dst, maskFormat,
715 ntrap, traps))
716 return;
717
718 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: fallback mask=%08x, ntrap=%d\n", __FUNCTION__,
719 maskFormat ? (unsigned)maskFormat->format : 0, ntrap));
720 trapezoids_fallbackcxx . . $ trapezoids_fallback(d39792d1def39ea3).(sna, op, src, dst, maskFormat,
721 xSrc, ySrc,
722 ntrap, traps);
723 }
724
725 static void mark_damagedcxx . . $ mark_damaged(6b7c630e28cafd8b).(PixmapPtrcxx . . $ PixmapPtr# pixmap, struct sna_pixmapcxx . . $ sna_pixmap# *priv,
726 BoxPtrcxx . . $ BoxPtr# box, int16_tcxx . . $ int16_t# x, int16_tcxx . . $ int16_t# y)
727 {
728 box->x1cxx . . $ pixman_box16#x1. += x; box->x2cxx . . $ pixman_box16#x2. += x;
729 box->y1cxx . . $ pixman_box16#y1. += y; box->y2cxx . . $ pixman_box16#y2. += y;
730 if (box->x1cxx . . $ pixman_box16#x1. <= 0 && box->y1cxx . . $ pixman_box16#y1. <= 0 &&
731 box->x2cxx . . $ pixman_box16#x2. >= pixmap->drawablecxx . . $ _Pixmap#drawable..widthcxx . . $ _Drawable#width. &&
732 box->y2cxx . . $ pixman_box16#y2. >= pixmap->drawablecxx . . $ _Pixmap#drawable..heightcxx . . $ _Drawable#height.) {
733 sna_damage_destroycxx . . $ sna_damage_destroy(ac81b9135298ee21).(&priv->cpu_damagecxx . . $ sna_pixmap#cpu_damage.);
734 sna_damage_allcxx . . $ sna_damage_all(2f0005bdac237422).(&priv->gpu_damagecxx . . $ sna_pixmap#gpu_damage., pixmap);
735 list_delcxx . . $ list_del(aab7549c8b706ca7).(&priv->flush_listcxx . . $ sna_pixmap#flush_list.);
736 } else {
737 sna_damage_add_boxcxx . . $ sna_damage_add_box(25dbe9b0da56bda9).(&priv->gpu_damagecxx . . $ sna_pixmap#gpu_damage., box);
738 sna_damage_subtract_boxcxx . . $ sna_damage_subtract_box(25dbe9b0da56bda9).(&priv->cpu_damagecxx . . $ sna_pixmap#cpu_damage., box);
739 }
740 }
741
742 static boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`!
743 trap_uploadcxx . . $ trap_upload(f5f9d8b859215d7e).(PicturePtrcxx . . $ PicturePtr# picture,
744 INT16cxx . . $ INT16# x, INT16cxx . . $ INT16# y,
745 int ntrap, xTrapcxx . . $ xTrap# *trap)
746 {
747 ScreenPtrcxx . . $ ScreenPtr# screen = picture->pDrawablecxx . . $ _Picture#pDrawable.->pScreencxx . . $ _Drawable#pScreen.;
748 struct snacxx . . $ sna# *sna = to_sna_from_screencxx . . $ to_sna_from_screen(7e3d30a85546b920).(screen);
749 PixmapPtrcxx . . $ PixmapPtr# pixmap = get_drawable_pixmapcxx . . $ get_drawable_pixmap(37fca7f3554b94d5).(picture->pDrawablecxx . . $ _Picture#pDrawable.);
750 PixmapPtrcxx . . $ PixmapPtr# scratch;
751 struct sna_pixmapcxx . . $ sna_pixmap# *priv;
752 BoxReccxx . . $ BoxRec# extents;
753 pixman_image_tcxx . . $ pixman_image_t# *image;
754 int width, height, depth;
755 int n;
756
757 priv = sna_pixmap_move_to_gpucxx . . $ sna_pixmap_move_to_gpu(616af655358a404f).(pixmap, MOVE_READcxx . . $ `src/sna/sna.h:815:9`! | MOVE_WRITEcxx . . $ `src/sna/sna.h:814:9`!);
758 if (priv == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
759 return falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
760
761 extents = *RegionExtentscxx . . $ RegionExtents(1fec39518143ba42).(picture->pCompositeClipcxx . . $ _Picture#pCompositeClip.);
762 for (n = 0; n < ntrap; n++) {
763 int v;
764
765 v = x + pixman_fixed_integer_floorcxx . . $ `src/sna/sna_trapezoids.h:386:9`! (MINcxx . . $ `src/sna/sna.h:545:9`!(trap[n].top.l, trap[n].bot.l));
766 if (v < extents.x1cxx . . $ pixman_box16#x1.)
767 extents.x1cxx . . $ pixman_box16#x1. = v;
768
769 v = x + pixman_fixed_integer_ceilcxx . . $ `src/sna/sna_trapezoids.h:387:9`! (MAXcxx . . $ `src/sna/sna.h:549:9`!(trap[n].top.r, trap[n].bot.r));
770 if (v > extents.x2cxx . . $ pixman_box16#x2.)
771 extents.x2cxx . . $ pixman_box16#x2. = v;
772
773 v = y + pixman_fixed_integer_floorcxx . . $ `src/sna/sna_trapezoids.h:386:9`! (trap[n].top.y);
774 if (v < extents.y1cxx . . $ pixman_box16#y1.)
775 extents.y1cxx . . $ pixman_box16#y1. = v;
776
777 v = y + pixman_fixed_integer_ceilcxx . . $ `src/sna/sna_trapezoids.h:387:9`! (trap[n].bot.y);
778 if (v > extents.y2cxx . . $ pixman_box16#y2.)
779 extents.y2cxx . . $ pixman_box16#y2. = v;
780 }
781
782 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: extents (%d, %d), (%d, %d)\n",
783 __FUNCTION__, extents.x1, extents.y1, extents.x2, extents.y2));
784
785 width = extents.x2cxx . . $ pixman_box16#x2. - extents.x1cxx . . $ pixman_box16#x1.;
786 height = extents.y2cxx . . $ pixman_box16#y2. - extents.y1cxx . . $ pixman_box16#y1.;
787 depth = picture->pDrawablecxx . . $ _Picture#pDrawable.->depthcxx . . $ _Drawable#depth.;
788
789 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: tmp (%dx%d) depth=%d\n",
790 __FUNCTION__, width, height, depth));
791 scratch = sna_pixmap_create_uploadcxx . . $ sna_pixmap_create_upload(cfec897c9247a908).(screen,
792 width, height, depth,
793 KGEM_BUFFER_WRITEcxx . . $ `src/sna/kgem.h:830:9`!);
794 if (!scratch)
795 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
796
797 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, scratch->devKindcxx . . $ _Pixmap#devKind.*height);
798 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).((pixman_format_code_tcxx . . $ pixman_format_code_t#)picture->formatcxx . . $ _Picture#format.,
799 width, height,
800 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
801 scratch->devKindcxx . . $ _Pixmap#devKind.);
802 if (image) {
803 pixman_add_trapscxx . . $ pixman_add_traps(7ae8ce07e55eab09). (image, -extents.x1cxx . . $ pixman_box16#x1., -extents.y1cxx . . $ pixman_box16#y1.,
804 ntrap, (pixman_trap_tcxx . . $ pixman_trap_t# *)trap);
805
806 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
807 }
808
809 /* XXX clip boxes */
810 get_drawable_deltascxx . . $ get_drawable_deltas(a4553520d213bbca).(picture->pDrawablecxx . . $ _Picture#pDrawable., pixmap, &x, &y);
811 sna->rendercxx . . $ sna#render..copy_boxescxx . . $ sna_render#copy_boxes.(sna, GXcopycxx . . $ `<external>/1208737181511191802/X.h:488:9`!,
812 &scratch->drawablecxx . . $ _Pixmap#drawable., __sna_pixmap_get_bocxx . . $ __sna_pixmap_get_bo(7de55692dd6e3c3b).(scratch), -extents.x1cxx . . $ pixman_box16#x1., -extents.x1cxx . . $ pixman_box16#x1.,
813 &pixmap->drawablecxx . . $ _Pixmap#drawable., priv->gpu_bocxx . . $ sna_pixmap#gpu_bo., x, y,
814 &extents, 1, 0);
815 mark_damagedcxx . . $ mark_damaged(6b7c630e28cafd8b).(pixmap, priv, &extents, x, y);
816
817 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
818 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
819 }
820
821 void
822 sna_add_trapscxx . . $ sna_add_traps(6149af98a9d5abfe).(PicturePtrcxx . . $ PicturePtr# picture, INT16cxx . . $ INT16# x, INT16cxx . . $ INT16# y, int n, xTrapcxx . . $ xTrap# *t)
823 {
824 PixmapPtrcxx . . $ PixmapPtr# pixmap = get_drawable_pixmapcxx . . $ get_drawable_pixmap(37fca7f3554b94d5).(picture->pDrawablecxx . . $ _Picture#pDrawable.);
825 struct snacxx . . $ sna# *sna = to_sna_from_pixmapcxx . . $ to_sna_from_pixmap(243f11b5bd8a3947).(pixmap);
826 struct sna_pixmapcxx . . $ sna_pixmap# *priv = sna_pixmapcxx . . $ sna_pixmap(7ecb3578b4f1181f).(pixmap);
827
828 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s (%d, %d) x %d\n", __FUNCTION__, x, y, n));
829
830 if (priv && is_gpu_dstcxx . . $ is_gpu_dst(8b21012079062e81).(priv)) {
831 if (trap_span_convertercxx . . $ trap_span_converter(d9295e17c335489d).(sna, picture, x, y, n, t))
832 return;
833 }
834
835 if (is_gpucxx . . $ is_gpu(498366498b5b8c6e).(sna, picture->pDrawablecxx . . $ _Picture#pDrawable., PREFER_GPU_RENDERcxx . . $ `src/sna/sna_render.h:235:9`!)) {
836 if (trap_mask_convertercxx . . $ trap_mask_converter(d9295e17c335489d).(sna, picture, x, y, n, t))
837 return;
838
839 if (trap_uploadcxx . . $ trap_upload(f5f9d8b859215d7e).(picture, x, y, n, t))
840 return;
841 }
842
843 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s -- fallback\n", __FUNCTION__));
844 if (sna_pixmap_move_to_cpucxx . . $ sna_pixmap_move_to_cpu(3671c2afb46bb0e8).(pixmap, MOVE_READcxx . . $ `src/sna/sna.h:815:9`! | MOVE_WRITEcxx . . $ `src/sna/sna.h:814:9`!)) {
845 pixman_image_tcxx . . $ pixman_image_t# *image;
846 int dx, dy;
847
848 if (!(image = image_from_pictcxx . . $ `./fb/sfb.h:39:9`!(picture, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, &dx, &dy)))
849 return;
850
851 if (sigtrap_getcxx . . $ `src/sna/sna.h:1371:9`!() == 0) {
852 pixman_add_trapscxx . . $ pixman_add_traps(7ae8ce07e55eab09).(image, x + dx, y + dy, n, (pixman_trap_tcxx . . $ pixman_trap_t# *)t);
853 sigtrap_putcxx . . $ sigtrap_put(49f6e7a06ebc5aa8).();
854 }
855
856 free_pixman_pictcxx . . $ free_pixman_pict(59481076768b36a0).(picture, image);
857 }
858 }
859
860 #if HAS_PIXMAN_TRIANGLEScxx . . $ `config.h:38:9`!
861 static void
862 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(CARD8cxx . . $ CARD8# op,
863 PicturePtrcxx . . $ PicturePtr# src,
864 PicturePtrcxx . . $ PicturePtr# dst,
865 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
866 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
867 int n, xTrianglecxx . . $ xTriangle# *tri)
868 {
869 ScreenPtrcxx . . $ ScreenPtr# screen = dst->pDrawablecxx . . $ _Picture#pDrawable.->pScreencxx . . $ _Drawable#pScreen.;
870
871 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s op=%d, count=%d\n", __FUNCTION__, op, n));
872
873 if (maskFormat) {
874 PixmapPtrcxx . . $ PixmapPtr# scratch;
875 PicturePtrcxx . . $ PicturePtr# mask;
876 INT16cxx . . $ INT16# dst_x, dst_y;
877 BoxReccxx . . $ BoxRec# bounds;
878 int width, height, depth;
879 pixman_image_tcxx . . $ pixman_image_t# *image;
880 pixman_format_code_tcxx . . $ pixman_format_code_t# format;
881 int error;
882
883 dst_x = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(tri[0].p1.x);
884 dst_y = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(tri[0].p1.y);
885
886 miTriangleBoundscxx . . $ miTriangleBounds(af3afcf3173678d5).(n, tri, &bounds);
887 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: bounds (%d, %d), (%d, %d)\n",
888 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
889
890 if (bounds.y1cxx . . $ pixman_box16#y1. >= bounds.y2cxx . . $ pixman_box16#y2. || bounds.x1cxx . . $ pixman_box16#x1. >= bounds.x2cxx . . $ pixman_box16#x2.)
891 return;
892
893 if (!sna_compute_composite_extentscxx . . $ sna_compute_composite_extents(a0260ea3bed58da3).(&bounds,
894 src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, dst,
895 xSrc, ySrc,
896 0, 0,
897 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
898 bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.,
899 bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.))
900 return;
901
902 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: extents (%d, %d), (%d, %d)\n",
903 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
904
905 width = bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.;
906 height = bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.;
907 bounds.x1cxx . . $ pixman_box16#x1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
908 bounds.y1cxx . . $ pixman_box16#y1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
909 depth = maskFormat->depthcxx . . $ _PictFormat#depth.;
910 format = maskFormat->formatcxx . . $ _PictFormat#format. | (BitsPerPixelcxx . . $ `<external>/6888719942695738040/servermd.h:109:9`!(depth) << 24);
911
912 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: mask (%dx%d) depth=%d, format=%08x\n",
913 __FUNCTION__, width, height, depth, format));
914 scratch = sna_pixmap_create_uploadcxx . . $ sna_pixmap_create_upload(cfec897c9247a908).(screen,
915 width, height, depth,
916 KGEM_BUFFER_WRITEcxx . . $ `src/sna/kgem.h:830:9`!);
917 if (!scratch)
918 return;
919
920 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, (size_t)scratch->devKindcxx . . $ _Pixmap#devKind.*height);
921 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
922 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
923 scratch->devKindcxx . . $ _Pixmap#devKind.);
924 if (image) {
925 pixman_add_trianglescxx . . $ pixman_add_triangles(992376933304df5c).(image,
926 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.,
927 n, (pixman_triangle_tcxx . . $ pixman_triangle_t# *)tri);
928 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
929 }
930
931 mask = CreatePicturecxx . . $ CreatePicture(f47001d5eb332be6).(0, &scratch->drawablecxx . . $ _Pixmap#drawable.,
932 PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, depth, format),
933 0, 0, serverClientcxx . . $ serverClient., &error);
934 if (mask) {
935 CompositePicturecxx . . $ CompositePicture(842e5d8f7bc57502).(op, src, mask, dst,
936 xSrc + bounds.x1cxx . . $ pixman_box16#x1. - dst_x,
937 ySrc + bounds.y1cxx . . $ pixman_box16#y1. - dst_y,
938 0, 0,
939 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
940 width, height);
941 FreePicturecxx . . $ FreePicture(6fe7d876f9648735).(mask, 0);
942 }
943 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
944 } else {
945 if (dst->polyEdgecxx . . $ _Picture#polyEdge. == PolyEdgeSharpcxx . . $ `<external>/2369207440537731940/render.h:163:9`!)
946 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 1, PICT_a1cxx . . $ PICT_a1.);
947 else
948 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 8, PICT_a8cxx . . $ PICT_a8.);
949
950 for (; n--; tri++)
951 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op,
952 src, dst, maskFormat,
953 xSrc, ySrc, 1, tri);
954 }
955 }
956
957 void
958 sna_composite_trianglescxx . . $ sna_composite_triangles(6d3f6e8e923ce4b4).(CARD8cxx . . $ CARD8# op,
959 PicturePtrcxx . . $ PicturePtr# src,
960 PicturePtrcxx . . $ PicturePtr# dst,
961 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
962 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
963 int n, xTrianglecxx . . $ xTriangle# *tri)
964 {
965 struct snacxx . . $ sna# *sna = to_sna_from_drawablecxx . . $ to_sna_from_drawable(4225bd5a2f54f9ee).(dst->pDrawablecxx . . $ _Picture#pDrawable.);
966
967 if (triangles_span_convertercxx . . $ triangles_span_converter(34d6e00c9947c922).(sna, op, src, dst, maskFormat,
968 xSrc, ySrc,
969 n, tri))
970 return;
971
972 if (triangles_mask_convertercxx . . $ triangles_mask_converter(47d258fe103ebf3c).(op, src, dst, maskFormat,
973 xSrc, ySrc,
974 n, tri))
975 return;
976
977 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op, src, dst, maskFormat, xSrc, ySrc, n, tri);
978 }
979
980 static void
981 tristrip_fallbackcxx . . $ tristrip_fallback(fcc91de3558baa67).(CARD8cxx . . $ CARD8# op,
982 PicturePtrcxx . . $ PicturePtr# src,
983 PicturePtrcxx . . $ PicturePtr# dst,
984 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
985 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
986 int n, xPointFixedcxx . . $ xPointFixed# *points)
987 {
988 ScreenPtrcxx . . $ ScreenPtr# screen = dst->pDrawablecxx . . $ _Picture#pDrawable.->pScreencxx . . $ _Drawable#pScreen.;
989
990 if (maskFormat) {
991 PixmapPtrcxx . . $ PixmapPtr# scratch;
992 PicturePtrcxx . . $ PicturePtr# mask;
993 INT16cxx . . $ INT16# dst_x, dst_y;
994 BoxReccxx . . $ BoxRec# bounds;
995 int width, height, depth;
996 pixman_image_tcxx . . $ pixman_image_t# *image;
997 pixman_format_code_tcxx . . $ pixman_format_code_t# format;
998 int error;
999
1000 dst_x = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(points->x);
1001 dst_y = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(points->y);
1002
1003 miPointFixedBoundscxx . . $ miPointFixedBounds(3fe41db4e9ac2e5d).(n, points, &bounds);
1004 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: bounds (%d, %d), (%d, %d)\n",
1005 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
1006
1007 if (bounds.y1cxx . . $ pixman_box16#y1. >= bounds.y2cxx . . $ pixman_box16#y2. || bounds.x1cxx . . $ pixman_box16#x1. >= bounds.x2cxx . . $ pixman_box16#x2.)
1008 return;
1009
1010 if (!sna_compute_composite_extentscxx . . $ sna_compute_composite_extents(a0260ea3bed58da3).(&bounds,
1011 src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, dst,
1012 xSrc, ySrc,
1013 0, 0,
1014 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
1015 bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.,
1016 bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.))
1017 return;
1018
1019 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: extents (%d, %d), (%d, %d)\n",
1020 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
1021
1022 width = bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.;
1023 height = bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.;
1024 bounds.x1cxx . . $ pixman_box16#x1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
1025 bounds.y1cxx . . $ pixman_box16#y1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
1026 depth = maskFormat->depthcxx . . $ _PictFormat#depth.;
1027 format = maskFormat->formatcxx . . $ _PictFormat#format. | (BitsPerPixelcxx . . $ `<external>/6888719942695738040/servermd.h:109:9`!(depth) << 24);
1028
1029 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: mask (%dx%d) depth=%d, format=%08x\n",
1030 __FUNCTION__, width, height, depth, format));
1031 scratch = sna_pixmap_create_uploadcxx . . $ sna_pixmap_create_upload(cfec897c9247a908).(screen,
1032 width, height, depth,
1033 KGEM_BUFFER_WRITEcxx . . $ `src/sna/kgem.h:830:9`!);
1034 if (!scratch)
1035 return;
1036
1037 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, scratch->devKindcxx . . $ _Pixmap#devKind.*height);
1038 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
1039 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
1040 scratch->devKindcxx . . $ _Pixmap#devKind.);
1041 if (image) {
1042 xTrianglecxx . . $ xTriangle# tri;
1043 xPointFixedcxx . . $ xPointFixed# *p[3] = { &tri.p1cxx . . $ $anonymous_type_d4be3316d06f2656_9#p1., &tri.p2cxx . . $ $anonymous_type_d4be3316d06f2656_9#p2., &tri.p3cxx . . $ $anonymous_type_d4be3316d06f2656_9#p3. };
1044 int i;
1045
1046 *p[0] = points[0];
1047 *p[1] = points[1];
1048 *p[2] = points[2];
1049 pixman_add_trianglescxx . . $ pixman_add_triangles(992376933304df5c).(image,
1050 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.,
1051 1, (pixman_triangle_tcxx . . $ pixman_triangle_t# *)&tri);
1052 for (i = 3; i < n; i++) {
1053 *p[i%3] = points[i];
1054 pixman_add_trianglescxx . . $ pixman_add_triangles(992376933304df5c).(image,
1055 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.,
1056 1, (pixman_triangle_tcxx . . $ pixman_triangle_t# *)&tri);
1057 }
1058 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
1059 }
1060
1061 mask = CreatePicturecxx . . $ CreatePicture(f47001d5eb332be6).(0, &scratch->drawablecxx . . $ _Pixmap#drawable.,
1062 PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, depth, format),
1063 0, 0, serverClientcxx . . $ serverClient., &error);
1064 if (mask) {
1065 CompositePicturecxx . . $ CompositePicture(842e5d8f7bc57502).(op, src, mask, dst,
1066 xSrc + bounds.x1cxx . . $ pixman_box16#x1. - dst_x,
1067 ySrc + bounds.y1cxx . . $ pixman_box16#y1. - dst_y,
1068 0, 0,
1069 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
1070 width, height);
1071 FreePicturecxx . . $ FreePicture(6fe7d876f9648735).(mask, 0);
1072 }
1073 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
1074 } else {
1075 xTrianglecxx . . $ xTriangle# tri;
1076 xPointFixedcxx . . $ xPointFixed# *p[3] = { &tri.p1cxx . . $ $anonymous_type_d4be3316d06f2656_9#p1., &tri.p2cxx . . $ $anonymous_type_d4be3316d06f2656_9#p2., &tri.p3cxx . . $ $anonymous_type_d4be3316d06f2656_9#p3. };
1077 int i;
1078
1079 if (dst->polyEdgecxx . . $ _Picture#polyEdge. == PolyEdgeSharpcxx . . $ `<external>/2369207440537731940/render.h:163:9`!)
1080 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 1, PICT_a1cxx . . $ PICT_a1.);
1081 else
1082 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 8, PICT_a8cxx . . $ PICT_a8.);
1083
1084 *p[0] = points[0];
1085 *p[1] = points[1];
1086 *p[2] = points[2];
1087 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op,
1088 src, dst, maskFormat,
1089 xSrc, ySrc, 1, &tri);
1090 for (i = 3; i < n; i++) {
1091 *p[i%3] = points[i];
1092 /* Should xSrc,ySrc be updated? */
1093 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op,
1094 src, dst, maskFormat,
1095 xSrc, ySrc, 1, &tri);
1096 }
1097 }
1098 }
1099
1100 void
1101 sna_composite_tristripcxx . . $ sna_composite_tristrip(fcc91de3558baa67).(CARD8cxx . . $ CARD8# op,
1102 PicturePtrcxx . . $ PicturePtr# src,
1103 PicturePtrcxx . . $ PicturePtr# dst,
1104 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
1105 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
1106 int n, xPointFixedcxx . . $ xPointFixed# *points)
1107 {
1108 struct snacxx . . $ sna# *sna = to_sna_from_drawablecxx . . $ to_sna_from_drawable(4225bd5a2f54f9ee).(dst->pDrawablecxx . . $ _Picture#pDrawable.);
1109
1110 if (tristrip_span_convertercxx . . $ tristrip_span_converter(3370fc6869cd177b).(sna, op, src, dst, maskFormat, xSrc, ySrc, n, points))
1111 return;
1112
1113 tristrip_fallbackcxx . . $ tristrip_fallback(fcc91de3558baa67).(op, src, dst, maskFormat, xSrc, ySrc, n, points);
1114 }
1115
1116 static void
1117 trifan_fallbackcxx . . $ trifan_fallback(fcc91de3558baa67).(CARD8cxx . . $ CARD8# op,
1118 PicturePtrcxx . . $ PicturePtr# src,
1119 PicturePtrcxx . . $ PicturePtr# dst,
1120 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
1121 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
1122 int n, xPointFixedcxx . . $ xPointFixed# *points)
1123 {
1124 ScreenPtrcxx . . $ ScreenPtr# screen = dst->pDrawablecxx . . $ _Picture#pDrawable.->pScreencxx . . $ _Drawable#pScreen.;
1125
1126 if (maskFormat) {
1127 PixmapPtrcxx . . $ PixmapPtr# scratch;
1128 PicturePtrcxx . . $ PicturePtr# mask;
1129 INT16cxx . . $ INT16# dst_x, dst_y;
1130 BoxReccxx . . $ BoxRec# bounds;
1131 int width, height, depth;
1132 pixman_image_tcxx . . $ pixman_image_t# *image;
1133 pixman_format_code_tcxx . . $ pixman_format_code_t# format;
1134 int error;
1135
1136 dst_x = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(points->x);
1137 dst_y = pixman_fixed_to_intcxx . . $ `<external>/17639638556090915931/pixman.h:129:9`!(points->y);
1138
1139 miPointFixedBoundscxx . . $ miPointFixedBounds(3fe41db4e9ac2e5d).(n, points, &bounds);
1140 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: bounds (%d, %d), (%d, %d)\n",
1141 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
1142
1143 if (bounds.y1cxx . . $ pixman_box16#y1. >= bounds.y2cxx . . $ pixman_box16#y2. || bounds.x1cxx . . $ pixman_box16#x1. >= bounds.x2cxx . . $ pixman_box16#x2.)
1144 return;
1145
1146 if (!sna_compute_composite_extentscxx . . $ sna_compute_composite_extents(a0260ea3bed58da3).(&bounds,
1147 src, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, dst,
1148 xSrc, ySrc,
1149 0, 0,
1150 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
1151 bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.,
1152 bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.))
1153 return;
1154
1155 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: extents (%d, %d), (%d, %d)\n",
1156 __FUNCTION__, bounds.x1, bounds.y1, bounds.x2, bounds.y2));
1157
1158 width = bounds.x2cxx . . $ pixman_box16#x2. - bounds.x1cxx . . $ pixman_box16#x1.;
1159 height = bounds.y2cxx . . $ pixman_box16#y2. - bounds.y1cxx . . $ pixman_box16#y1.;
1160 bounds.x1cxx . . $ pixman_box16#x1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->xcxx . . $ _Drawable#x.;
1161 bounds.y1cxx . . $ pixman_box16#y1. -= dst->pDrawablecxx . . $ _Picture#pDrawable.->ycxx . . $ _Drawable#y.;
1162 depth = maskFormat->depthcxx . . $ _PictFormat#depth.;
1163 format = maskFormat->formatcxx . . $ _PictFormat#format. | (BitsPerPixelcxx . . $ `<external>/6888719942695738040/servermd.h:109:9`!(depth) << 24);
1164
1165 DBGcxx . . $ `src/sna/debug.h:35:9`!(("%s: mask (%dx%d) depth=%d, format=%08x\n",
1166 __FUNCTION__, width, height, depth, format));
1167 scratch = sna_pixmap_create_uploadcxx . . $ sna_pixmap_create_upload(cfec897c9247a908).(screen,
1168 width, height, depth,
1169 KGEM_BUFFER_WRITEcxx . . $ `src/sna/kgem.h:830:9`!);
1170 if (!scratch)
1171 return;
1172
1173 memsetcxx . . $ memset(d1de1e4fb215f1c6).(scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr., 0, scratch->devKindcxx . . $ _Pixmap#devKind.*height);
1174 image = pixman_image_create_bitscxx . . $ pixman_image_create_bits(7aecbb5f67bee13).(format, width, height,
1175 scratch->devPrivatecxx . . $ _Pixmap#devPrivate..ptrcxx . . $ _DevUnion#ptr.,
1176 scratch->devKindcxx . . $ _Pixmap#devKind.);
1177 if (image) {
1178 xTrianglecxx . . $ xTriangle# tri;
1179 xPointFixedcxx . . $ xPointFixed# *p[3] = { &tri.p1cxx . . $ $anonymous_type_d4be3316d06f2656_9#p1., &tri.p2cxx . . $ $anonymous_type_d4be3316d06f2656_9#p2., &tri.p3cxx . . $ $anonymous_type_d4be3316d06f2656_9#p3. };
1180 int i;
1181
1182 *p[0] = points[0];
1183 *p[1] = points[1];
1184 *p[2] = points[2];
1185 pixman_add_trianglescxx . . $ pixman_add_triangles(992376933304df5c).(image,
1186 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.,
1187 1, (pixman_triangle_tcxx . . $ pixman_triangle_t# *)&tri);
1188 for (i = 3; i < n; i++) {
1189 *p[2 - (i&1)] = points[i];
1190 pixman_add_trianglescxx . . $ pixman_add_triangles(992376933304df5c).(image,
1191 -bounds.x1cxx . . $ pixman_box16#x1., -bounds.y1cxx . . $ pixman_box16#y1.,
1192 1, (pixman_triangle_tcxx . . $ pixman_triangle_t# *)&tri);
1193 }
1194 pixman_image_unrefcxx . . $ pixman_image_unref(1233b5bf7ad32299).(image);
1195 }
1196
1197 mask = CreatePicturecxx . . $ CreatePicture(f47001d5eb332be6).(0, &scratch->drawablecxx . . $ _Pixmap#drawable.,
1198 PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, depth, format),
1199 0, 0, serverClientcxx . . $ serverClient., &error);
1200 if (mask) {
1201 CompositePicturecxx . . $ CompositePicture(842e5d8f7bc57502).(op, src, mask, dst,
1202 xSrc + bounds.x1cxx . . $ pixman_box16#x1. - dst_x,
1203 ySrc + bounds.y1cxx . . $ pixman_box16#y1. - dst_y,
1204 0, 0,
1205 bounds.x1cxx . . $ pixman_box16#x1., bounds.y1cxx . . $ pixman_box16#y1.,
1206 width, height);
1207 FreePicturecxx . . $ FreePicture(6fe7d876f9648735).(mask, 0);
1208 }
1209 sna_pixmap_destroycxx . . $ sna_pixmap_destroy(2f6e21ec3a00cbb6).(scratch);
1210 } else {
1211 xTrianglecxx . . $ xTriangle# tri;
1212 xPointFixedcxx . . $ xPointFixed# *p[3] = { &tri.p1cxx . . $ $anonymous_type_d4be3316d06f2656_9#p1., &tri.p2cxx . . $ $anonymous_type_d4be3316d06f2656_9#p2., &tri.p3cxx . . $ $anonymous_type_d4be3316d06f2656_9#p3. };
1213 int i;
1214
1215 if (dst->polyEdgecxx . . $ _Picture#polyEdge. == PolyEdgeSharpcxx . . $ `<external>/2369207440537731940/render.h:163:9`!)
1216 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 1, PICT_a1cxx . . $ PICT_a1.);
1217 else
1218 maskFormat = PictureMatchFormatcxx . . $ PictureMatchFormat(5efec2175191ef14).(screen, 8, PICT_a8cxx . . $ PICT_a8.);
1219
1220 *p[0] = points[0];
1221 *p[1] = points[1];
1222 *p[2] = points[2];
1223 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op,
1224 src, dst, maskFormat,
1225 xSrc, ySrc, 1, &tri);
1226 for (i = 3; i < n; i++) {
1227 *p[2 - (i&1)] = points[i];
1228 /* Should xSrc,ySrc be updated? */
1229 triangles_fallbackcxx . . $ triangles_fallback(6d3f6e8e923ce4b4).(op,
1230 src, dst, maskFormat,
1231 xSrc, ySrc, 1, &tri);
1232 }
1233 }
1234 }
1235
1236 void
1237 sna_composite_trifancxx . . $ sna_composite_trifan(fcc91de3558baa67).(CARD8cxx . . $ CARD8# op,
1238 PicturePtrcxx . . $ PicturePtr# src,
1239 PicturePtrcxx . . $ PicturePtr# dst,
1240 PictFormatPtrcxx . . $ PictFormatPtr# maskFormat,
1241 INT16cxx . . $ INT16# xSrc, INT16cxx . . $ INT16# ySrc,
1242 int n, xPointFixedcxx . . $ xPointFixed# *points)
1243 {
1244 trifan_fallbackcxx . . $ trifan_fallback(fcc91de3558baa67).(op, src, dst, maskFormat, xSrc, ySrc, n, points);
1245 }
1246 #endif