/src/cairo/subprojects/pixman-0.44.2/pixman/pixman-private.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef PIXMAN_PRIVATE_H |
2 | | #define PIXMAN_PRIVATE_H |
3 | | |
4 | | /* |
5 | | * The defines which are shared between C and assembly code |
6 | | */ |
7 | | |
8 | | /* bilinear interpolation precision (must be < 8) */ |
9 | 0 | #define BILINEAR_INTERPOLATION_BITS 7 |
10 | 0 | #define BILINEAR_INTERPOLATION_RANGE (1 << BILINEAR_INTERPOLATION_BITS) |
11 | | |
12 | | /* |
13 | | * C specific part |
14 | | */ |
15 | | |
16 | | #ifndef __ASSEMBLER__ |
17 | | |
18 | | #ifndef PACKAGE |
19 | | # error config.h must be included before pixman-private.h |
20 | | #endif |
21 | | |
22 | | #define PIXMAN_DISABLE_DEPRECATED |
23 | | #define PIXMAN_USE_INTERNAL_API |
24 | | |
25 | | #include "pixman.h" |
26 | | #include <time.h> |
27 | | #include <assert.h> |
28 | | #include <stdio.h> |
29 | | #include <string.h> |
30 | | #include <stddef.h> |
31 | | #include <float.h> |
32 | | |
33 | | #include "pixman-compiler.h" |
34 | | |
35 | | /* |
36 | | * Images |
37 | | */ |
38 | | typedef struct image_common image_common_t; |
39 | | typedef struct solid_fill solid_fill_t; |
40 | | typedef struct gradient gradient_t; |
41 | | typedef struct linear_gradient linear_gradient_t; |
42 | | typedef struct horizontal_gradient horizontal_gradient_t; |
43 | | typedef struct vertical_gradient vertical_gradient_t; |
44 | | typedef struct conical_gradient conical_gradient_t; |
45 | | typedef struct radial_gradient radial_gradient_t; |
46 | | typedef struct bits_image bits_image_t; |
47 | | typedef struct circle circle_t; |
48 | | |
49 | | typedef struct argb_t argb_t; |
50 | | |
51 | | struct argb_t |
52 | | { |
53 | | float a; |
54 | | float r; |
55 | | float g; |
56 | | float b; |
57 | | }; |
58 | | |
59 | | typedef void (*fetch_scanline_t) (bits_image_t *image, |
60 | | int x, |
61 | | int y, |
62 | | int width, |
63 | | uint32_t *buffer, |
64 | | const uint32_t *mask); |
65 | | |
66 | | typedef uint32_t (*fetch_pixel_32_t) (bits_image_t *image, |
67 | | int x, |
68 | | int y); |
69 | | |
70 | | typedef argb_t (*fetch_pixel_float_t) (bits_image_t *image, |
71 | | int x, |
72 | | int y); |
73 | | |
74 | | typedef void (*store_scanline_t) (bits_image_t * image, |
75 | | int x, |
76 | | int y, |
77 | | int width, |
78 | | const uint32_t *values); |
79 | | |
80 | | typedef enum |
81 | | { |
82 | | BITS, |
83 | | LINEAR, |
84 | | CONICAL, |
85 | | RADIAL, |
86 | | SOLID |
87 | | } image_type_t; |
88 | | |
89 | | typedef void (*property_changed_func_t) (pixman_image_t *image); |
90 | | |
91 | | struct image_common |
92 | | { |
93 | | image_type_t type; |
94 | | int32_t ref_count; |
95 | | pixman_region32_t clip_region; |
96 | | int32_t alpha_count; /* How many times this image is being used as an alpha map */ |
97 | | pixman_bool_t have_clip_region; /* FALSE if there is no clip */ |
98 | | pixman_bool_t client_clip; /* Whether the source clip was |
99 | | set by a client */ |
100 | | pixman_bool_t clip_sources; /* Whether the clip applies when |
101 | | * the image is used as a source |
102 | | */ |
103 | | pixman_bool_t dirty; |
104 | | pixman_transform_t * transform; |
105 | | pixman_repeat_t repeat; |
106 | | pixman_filter_t filter; |
107 | | pixman_fixed_t * filter_params; |
108 | | int n_filter_params; |
109 | | bits_image_t * alpha_map; |
110 | | int alpha_origin_x; |
111 | | int alpha_origin_y; |
112 | | pixman_bool_t component_alpha; |
113 | | property_changed_func_t property_changed; |
114 | | |
115 | | pixman_image_destroy_func_t destroy_func; |
116 | | void * destroy_data; |
117 | | |
118 | | uint32_t flags; |
119 | | pixman_format_code_t extended_format_code; |
120 | | }; |
121 | | |
122 | | struct solid_fill |
123 | | { |
124 | | image_common_t common; |
125 | | pixman_color_t color; |
126 | | |
127 | | uint32_t color_32; |
128 | | argb_t color_float; |
129 | | }; |
130 | | |
131 | | struct gradient |
132 | | { |
133 | | image_common_t common; |
134 | | int n_stops; |
135 | | pixman_gradient_stop_t *stops; |
136 | | }; |
137 | | |
138 | | struct linear_gradient |
139 | | { |
140 | | gradient_t common; |
141 | | pixman_point_fixed_t p1; |
142 | | pixman_point_fixed_t p2; |
143 | | }; |
144 | | |
145 | | struct circle |
146 | | { |
147 | | pixman_fixed_t x; |
148 | | pixman_fixed_t y; |
149 | | pixman_fixed_t radius; |
150 | | }; |
151 | | |
152 | | struct radial_gradient |
153 | | { |
154 | | gradient_t common; |
155 | | |
156 | | circle_t c1; |
157 | | circle_t c2; |
158 | | |
159 | | circle_t delta; |
160 | | double a; |
161 | | double inva; |
162 | | double mindr; |
163 | | }; |
164 | | |
165 | | struct conical_gradient |
166 | | { |
167 | | gradient_t common; |
168 | | pixman_point_fixed_t center; |
169 | | double angle; |
170 | | }; |
171 | | |
172 | | struct bits_image |
173 | | { |
174 | | image_common_t common; |
175 | | pixman_format_code_t format; |
176 | | const pixman_indexed_t * indexed; |
177 | | int width; |
178 | | int height; |
179 | | uint32_t * bits; |
180 | | uint32_t * free_me; |
181 | | int rowstride; /* in number of uint32_t's */ |
182 | | |
183 | | pixman_dither_t dither; |
184 | | uint32_t dither_offset_y; |
185 | | uint32_t dither_offset_x; |
186 | | |
187 | | fetch_scanline_t fetch_scanline_32; |
188 | | fetch_pixel_32_t fetch_pixel_32; |
189 | | store_scanline_t store_scanline_32; |
190 | | |
191 | | fetch_scanline_t fetch_scanline_float; |
192 | | fetch_pixel_float_t fetch_pixel_float; |
193 | | store_scanline_t store_scanline_float; |
194 | | |
195 | | /* Used for indirect access to the bits */ |
196 | | pixman_read_memory_func_t read_func; |
197 | | pixman_write_memory_func_t write_func; |
198 | | }; |
199 | | |
200 | | union pixman_image |
201 | | { |
202 | | image_type_t type; |
203 | | image_common_t common; |
204 | | bits_image_t bits; |
205 | | gradient_t gradient; |
206 | | linear_gradient_t linear; |
207 | | conical_gradient_t conical; |
208 | | radial_gradient_t radial; |
209 | | solid_fill_t solid; |
210 | | }; |
211 | | |
212 | | typedef struct pixman_iter_t pixman_iter_t; |
213 | | typedef uint32_t *(* pixman_iter_get_scanline_t) (pixman_iter_t *iter, const uint32_t *mask); |
214 | | typedef void (* pixman_iter_write_back_t) (pixman_iter_t *iter); |
215 | | typedef void (* pixman_iter_fini_t) (pixman_iter_t *iter); |
216 | | |
217 | | typedef enum |
218 | | { |
219 | | ITER_NARROW = (1 << 0), |
220 | | ITER_WIDE = (1 << 1), |
221 | | |
222 | | /* "Localized alpha" is when the alpha channel is used only to compute |
223 | | * the alpha value of the destination. This means that the computation |
224 | | * of the RGB values of the result is independent of the alpha value. |
225 | | * |
226 | | * For example, the OVER operator has localized alpha for the |
227 | | * destination, because the RGB values of the result can be computed |
228 | | * without knowing the destination alpha. Similarly, ADD has localized |
229 | | * alpha for both source and destination because the RGB values of the |
230 | | * result can be computed without knowing the alpha value of source or |
231 | | * destination. |
232 | | * |
233 | | * When he destination is xRGB, this is useful knowledge, because then |
234 | | * we can treat it as if it were ARGB, which means in some cases we can |
235 | | * avoid copying it to a temporary buffer. |
236 | | */ |
237 | | ITER_LOCALIZED_ALPHA = (1 << 2), |
238 | | ITER_IGNORE_ALPHA = (1 << 3), |
239 | | ITER_IGNORE_RGB = (1 << 4), |
240 | | |
241 | | /* These indicate whether the iterator is for a source |
242 | | * or a destination image |
243 | | */ |
244 | | ITER_SRC = (1 << 5), |
245 | | ITER_DEST = (1 << 6) |
246 | | } iter_flags_t; |
247 | | |
248 | | struct pixman_iter_t |
249 | | { |
250 | | /* These are initialized by _pixman_implementation_{src,dest}_init */ |
251 | | pixman_image_t * image; |
252 | | uint32_t * buffer; |
253 | | int x, y; |
254 | | int width; |
255 | | int height; |
256 | | iter_flags_t iter_flags; |
257 | | uint32_t image_flags; |
258 | | |
259 | | /* These function pointers are initialized by the implementation */ |
260 | | pixman_iter_get_scanline_t get_scanline; |
261 | | pixman_iter_write_back_t write_back; |
262 | | pixman_iter_fini_t fini; |
263 | | |
264 | | /* These fields are scratch data that implementations can use */ |
265 | | void * data; |
266 | | uint8_t * bits; |
267 | | int stride; |
268 | | }; |
269 | | |
270 | | typedef struct pixman_iter_info_t pixman_iter_info_t; |
271 | | typedef void (* pixman_iter_initializer_t) (pixman_iter_t *iter, |
272 | | const pixman_iter_info_t *info); |
273 | | struct pixman_iter_info_t |
274 | | { |
275 | | pixman_format_code_t format; |
276 | | uint32_t image_flags; |
277 | | iter_flags_t iter_flags; |
278 | | pixman_iter_initializer_t initializer; |
279 | | pixman_iter_get_scanline_t get_scanline; |
280 | | pixman_iter_write_back_t write_back; |
281 | | }; |
282 | | |
283 | | void |
284 | | _pixman_bits_image_setup_accessors (bits_image_t *image); |
285 | | |
286 | | void |
287 | | _pixman_bits_image_src_iter_init (pixman_image_t *image, pixman_iter_t *iter); |
288 | | |
289 | | void |
290 | | _pixman_bits_image_dest_iter_init (pixman_image_t *image, pixman_iter_t *iter); |
291 | | |
292 | | void |
293 | | _pixman_linear_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter); |
294 | | |
295 | | void |
296 | | _pixman_radial_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter); |
297 | | |
298 | | void |
299 | | _pixman_conical_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter); |
300 | | |
301 | | void |
302 | | _pixman_image_init (pixman_image_t *image); |
303 | | |
304 | | pixman_bool_t |
305 | | _pixman_bits_image_init (pixman_image_t * image, |
306 | | pixman_format_code_t format, |
307 | | int width, |
308 | | int height, |
309 | | uint32_t * bits, |
310 | | int rowstride, |
311 | | pixman_bool_t clear); |
312 | | pixman_bool_t |
313 | | _pixman_image_fini (pixman_image_t *image); |
314 | | |
315 | | pixman_image_t * |
316 | | _pixman_image_allocate (void); |
317 | | |
318 | | pixman_bool_t |
319 | | _pixman_init_gradient (gradient_t * gradient, |
320 | | const pixman_gradient_stop_t *stops, |
321 | | int n_stops); |
322 | | void |
323 | | _pixman_image_reset_clip_region (pixman_image_t *image); |
324 | | |
325 | | void |
326 | | _pixman_image_validate (pixman_image_t *image); |
327 | | |
328 | | #define PIXMAN_IMAGE_GET_LINE(image, x, y, type, out_stride, line, mul) \ |
329 | 32 | do \ |
330 | 32 | { \ |
331 | 32 | uint32_t *__bits__; \ |
332 | 32 | int __stride__; \ |
333 | 32 | \ |
334 | 32 | __bits__ = image->bits.bits; \ |
335 | 32 | __stride__ = image->bits.rowstride; \ |
336 | 32 | (out_stride) = \ |
337 | 32 | __stride__ * (int) sizeof (uint32_t) / (int) sizeof (type); \ |
338 | 32 | (line) = \ |
339 | 32 | ((type *) __bits__) + (out_stride) * (y) + (mul) * (x); \ |
340 | 32 | } while (0) |
341 | | |
342 | | /* |
343 | | * Gradient walker |
344 | | */ |
345 | | typedef struct |
346 | | { |
347 | | float a_s, a_b; |
348 | | float r_s, r_b; |
349 | | float g_s, g_b; |
350 | | float b_s, b_b; |
351 | | pixman_fixed_48_16_t left_x; |
352 | | pixman_fixed_48_16_t right_x; |
353 | | |
354 | | pixman_gradient_stop_t *stops; |
355 | | int num_stops; |
356 | | pixman_repeat_t repeat; |
357 | | |
358 | | pixman_bool_t need_reset; |
359 | | } pixman_gradient_walker_t; |
360 | | |
361 | | void |
362 | | _pixman_gradient_walker_init (pixman_gradient_walker_t *walker, |
363 | | gradient_t * gradient, |
364 | | pixman_repeat_t repeat); |
365 | | |
366 | | void |
367 | | _pixman_gradient_walker_reset (pixman_gradient_walker_t *walker, |
368 | | pixman_fixed_48_16_t pos); |
369 | | |
370 | | typedef void (*pixman_gradient_walker_write_t) ( |
371 | | pixman_gradient_walker_t *walker, |
372 | | pixman_fixed_48_16_t x, |
373 | | uint32_t *buffer); |
374 | | |
375 | | void |
376 | | _pixman_gradient_walker_write_narrow(pixman_gradient_walker_t *walker, |
377 | | pixman_fixed_48_16_t x, |
378 | | uint32_t *buffer); |
379 | | |
380 | | void |
381 | | _pixman_gradient_walker_write_wide(pixman_gradient_walker_t *walker, |
382 | | pixman_fixed_48_16_t x, |
383 | | uint32_t *buffer); |
384 | | |
385 | | typedef void (*pixman_gradient_walker_fill_t) ( |
386 | | pixman_gradient_walker_t *walker, |
387 | | pixman_fixed_48_16_t x, |
388 | | uint32_t *buffer, |
389 | | uint32_t *end); |
390 | | |
391 | | void |
392 | | _pixman_gradient_walker_fill_narrow(pixman_gradient_walker_t *walker, |
393 | | pixman_fixed_48_16_t x, |
394 | | uint32_t *buffer, |
395 | | uint32_t *end); |
396 | | |
397 | | void |
398 | | _pixman_gradient_walker_fill_wide(pixman_gradient_walker_t *walker, |
399 | | pixman_fixed_48_16_t x, |
400 | | uint32_t *buffer, |
401 | | uint32_t *end); |
402 | | |
403 | | /* |
404 | | * Edges |
405 | | */ |
406 | | |
407 | | #define MAX_ALPHA(n) ((1 << (n)) - 1) |
408 | 2.59k | #define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n) / 2)) - 1) |
409 | 2.93k | #define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n) / 2)) + 1) |
410 | | |
411 | 1.51k | #define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC (n)) |
412 | 552 | #define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC (n) - 1) * STEP_Y_SMALL (n)) |
413 | | |
414 | 507 | #define Y_FRAC_FIRST(n) (STEP_Y_BIG (n) / 2) |
415 | 489 | #define Y_FRAC_LAST(n) (Y_FRAC_FIRST (n) + (N_Y_FRAC (n) - 1) * STEP_Y_SMALL (n)) |
416 | | |
417 | 1.95k | #define STEP_X_SMALL(n) (pixman_fixed_1 / N_X_FRAC (n)) |
418 | 978 | #define STEP_X_BIG(n) (pixman_fixed_1 - (N_X_FRAC (n) - 1) * STEP_X_SMALL (n)) |
419 | | |
420 | 978 | #define X_FRAC_FIRST(n) (STEP_X_BIG (n) / 2) |
421 | | #define X_FRAC_LAST(n) (X_FRAC_FIRST (n) + (N_X_FRAC (n) - 1) * STEP_X_SMALL (n)) |
422 | | |
423 | | #define RENDER_SAMPLES_X(x, n) \ |
424 | 978 | ((n) == 1? 0 : (pixman_fixed_frac (x) + \ |
425 | 978 | X_FRAC_FIRST (n)) / STEP_X_SMALL (n)) |
426 | | |
427 | | void |
428 | | pixman_rasterize_edges_accessors (pixman_image_t *image, |
429 | | pixman_edge_t * l, |
430 | | pixman_edge_t * r, |
431 | | pixman_fixed_t t, |
432 | | pixman_fixed_t b); |
433 | | |
434 | | /* |
435 | | * Implementations |
436 | | */ |
437 | | typedef struct pixman_implementation_t pixman_implementation_t; |
438 | | |
439 | | typedef struct |
440 | | { |
441 | | pixman_op_t op; |
442 | | pixman_image_t * src_image; |
443 | | pixman_image_t * mask_image; |
444 | | pixman_image_t * dest_image; |
445 | | int32_t src_x; |
446 | | int32_t src_y; |
447 | | int32_t mask_x; |
448 | | int32_t mask_y; |
449 | | int32_t dest_x; |
450 | | int32_t dest_y; |
451 | | int32_t width; |
452 | | int32_t height; |
453 | | |
454 | | uint32_t src_flags; |
455 | | uint32_t mask_flags; |
456 | | uint32_t dest_flags; |
457 | | } pixman_composite_info_t; |
458 | | |
459 | | #define PIXMAN_COMPOSITE_ARGS(info) \ |
460 | 188 | MAYBE_UNUSED pixman_op_t op = info->op; \ |
461 | 188 | MAYBE_UNUSED pixman_image_t * src_image = info->src_image; \ |
462 | 188 | MAYBE_UNUSED pixman_image_t * mask_image = info->mask_image; \ |
463 | 188 | MAYBE_UNUSED pixman_image_t * dest_image = info->dest_image; \ |
464 | 188 | MAYBE_UNUSED int32_t src_x = info->src_x; \ |
465 | 188 | MAYBE_UNUSED int32_t src_y = info->src_y; \ |
466 | 188 | MAYBE_UNUSED int32_t mask_x = info->mask_x; \ |
467 | 188 | MAYBE_UNUSED int32_t mask_y = info->mask_y; \ |
468 | 188 | MAYBE_UNUSED int32_t dest_x = info->dest_x; \ |
469 | 188 | MAYBE_UNUSED int32_t dest_y = info->dest_y; \ |
470 | 188 | MAYBE_UNUSED int32_t width = info->width; \ |
471 | 188 | MAYBE_UNUSED int32_t height = info->height |
472 | | |
473 | | typedef void (*pixman_combine_32_func_t) (pixman_implementation_t *imp, |
474 | | pixman_op_t op, |
475 | | uint32_t * dest, |
476 | | const uint32_t * src, |
477 | | const uint32_t * mask, |
478 | | int width); |
479 | | |
480 | | typedef void (*pixman_combine_float_func_t) (pixman_implementation_t *imp, |
481 | | pixman_op_t op, |
482 | | float * dest, |
483 | | const float * src, |
484 | | const float * mask, |
485 | | int n_pixels); |
486 | | |
487 | | typedef void (*pixman_composite_func_t) (pixman_implementation_t *imp, |
488 | | pixman_composite_info_t *info); |
489 | | typedef pixman_bool_t (*pixman_blt_func_t) (pixman_implementation_t *imp, |
490 | | uint32_t * src_bits, |
491 | | uint32_t * dst_bits, |
492 | | int src_stride, |
493 | | int dst_stride, |
494 | | int src_bpp, |
495 | | int dst_bpp, |
496 | | int src_x, |
497 | | int src_y, |
498 | | int dest_x, |
499 | | int dest_y, |
500 | | int width, |
501 | | int height); |
502 | | typedef pixman_bool_t (*pixman_fill_func_t) (pixman_implementation_t *imp, |
503 | | uint32_t * bits, |
504 | | int stride, |
505 | | int bpp, |
506 | | int x, |
507 | | int y, |
508 | | int width, |
509 | | int height, |
510 | | uint32_t filler); |
511 | | |
512 | | void _pixman_setup_combiner_functions_32 (pixman_implementation_t *imp); |
513 | | void _pixman_setup_combiner_functions_float (pixman_implementation_t *imp); |
514 | | |
515 | | typedef struct |
516 | | { |
517 | | pixman_op_t op; |
518 | | pixman_format_code_t src_format; |
519 | | uint32_t src_flags; |
520 | | pixman_format_code_t mask_format; |
521 | | uint32_t mask_flags; |
522 | | pixman_format_code_t dest_format; |
523 | | uint32_t dest_flags; |
524 | | pixman_composite_func_t func; |
525 | | } pixman_fast_path_t; |
526 | | |
527 | | struct pixman_implementation_t |
528 | | { |
529 | | pixman_implementation_t * toplevel; |
530 | | pixman_implementation_t * fallback; |
531 | | const pixman_fast_path_t * fast_paths; |
532 | | const pixman_iter_info_t * iter_info; |
533 | | |
534 | | pixman_blt_func_t blt; |
535 | | pixman_fill_func_t fill; |
536 | | |
537 | | pixman_combine_32_func_t combine_32[PIXMAN_N_OPERATORS]; |
538 | | pixman_combine_32_func_t combine_32_ca[PIXMAN_N_OPERATORS]; |
539 | | pixman_combine_float_func_t combine_float[PIXMAN_N_OPERATORS]; |
540 | | pixman_combine_float_func_t combine_float_ca[PIXMAN_N_OPERATORS]; |
541 | | }; |
542 | | |
543 | | uint32_t |
544 | | _pixman_image_get_solid (pixman_implementation_t *imp, |
545 | | pixman_image_t * image, |
546 | | pixman_format_code_t format); |
547 | | |
548 | | pixman_implementation_t * |
549 | | _pixman_implementation_create (pixman_implementation_t *fallback, |
550 | | const pixman_fast_path_t *fast_paths); |
551 | | |
552 | | void |
553 | | _pixman_implementation_lookup_composite (pixman_implementation_t *toplevel, |
554 | | pixman_op_t op, |
555 | | pixman_format_code_t src_format, |
556 | | uint32_t src_flags, |
557 | | pixman_format_code_t mask_format, |
558 | | uint32_t mask_flags, |
559 | | pixman_format_code_t dest_format, |
560 | | uint32_t dest_flags, |
561 | | pixman_implementation_t **out_imp, |
562 | | pixman_composite_func_t *out_func); |
563 | | |
564 | | pixman_combine_32_func_t |
565 | | _pixman_implementation_lookup_combiner (pixman_implementation_t *imp, |
566 | | pixman_op_t op, |
567 | | pixman_bool_t component_alpha, |
568 | | pixman_bool_t wide); |
569 | | |
570 | | pixman_bool_t |
571 | | _pixman_implementation_blt (pixman_implementation_t *imp, |
572 | | uint32_t * src_bits, |
573 | | uint32_t * dst_bits, |
574 | | int src_stride, |
575 | | int dst_stride, |
576 | | int src_bpp, |
577 | | int dst_bpp, |
578 | | int src_x, |
579 | | int src_y, |
580 | | int dest_x, |
581 | | int dest_y, |
582 | | int width, |
583 | | int height); |
584 | | |
585 | | pixman_bool_t |
586 | | _pixman_implementation_fill (pixman_implementation_t *imp, |
587 | | uint32_t * bits, |
588 | | int stride, |
589 | | int bpp, |
590 | | int x, |
591 | | int y, |
592 | | int width, |
593 | | int height, |
594 | | uint32_t filler); |
595 | | |
596 | | void |
597 | | _pixman_implementation_iter_init (pixman_implementation_t *imp, |
598 | | pixman_iter_t *iter, |
599 | | pixman_image_t *image, |
600 | | int x, |
601 | | int y, |
602 | | int width, |
603 | | int height, |
604 | | uint8_t *buffer, |
605 | | iter_flags_t flags, |
606 | | uint32_t image_flags); |
607 | | |
608 | | /* Specific implementations */ |
609 | | pixman_implementation_t * |
610 | | _pixman_implementation_create_general (void); |
611 | | |
612 | | pixman_implementation_t * |
613 | | _pixman_implementation_create_fast_path (pixman_implementation_t *fallback); |
614 | | |
615 | | pixman_implementation_t * |
616 | | _pixman_implementation_create_noop (pixman_implementation_t *fallback); |
617 | | |
618 | | #if defined USE_X86_MMX || defined USE_LOONGSON_MMI |
619 | | pixman_implementation_t * |
620 | | _pixman_implementation_create_mmx (pixman_implementation_t *fallback); |
621 | | #endif |
622 | | |
623 | | #ifdef USE_SSE2 |
624 | | pixman_implementation_t * |
625 | | _pixman_implementation_create_sse2 (pixman_implementation_t *fallback); |
626 | | #endif |
627 | | |
628 | | #ifdef USE_SSSE3 |
629 | | pixman_implementation_t * |
630 | | _pixman_implementation_create_ssse3 (pixman_implementation_t *fallback); |
631 | | #endif |
632 | | |
633 | | #ifdef USE_ARM_SIMD |
634 | | pixman_implementation_t * |
635 | | _pixman_implementation_create_arm_simd (pixman_implementation_t *fallback); |
636 | | #endif |
637 | | |
638 | | #ifdef USE_ARM_NEON |
639 | | pixman_implementation_t * |
640 | | _pixman_implementation_create_arm_neon (pixman_implementation_t *fallback); |
641 | | #endif |
642 | | |
643 | | #ifdef USE_ARM_A64_NEON |
644 | | pixman_implementation_t * |
645 | | _pixman_implementation_create_arm_neon (pixman_implementation_t *fallback); |
646 | | #endif |
647 | | |
648 | | #ifdef USE_MIPS_DSPR2 |
649 | | pixman_implementation_t * |
650 | | _pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback); |
651 | | #endif |
652 | | |
653 | | #ifdef USE_VMX |
654 | | pixman_implementation_t * |
655 | | _pixman_implementation_create_vmx (pixman_implementation_t *fallback); |
656 | | #endif |
657 | | |
658 | | #ifdef USE_RVV |
659 | | pixman_implementation_t * |
660 | | _pixman_implementation_create_rvv (pixman_implementation_t *fallback); |
661 | | #endif |
662 | | |
663 | | pixman_bool_t |
664 | | _pixman_implementation_disabled (const char *name); |
665 | | |
666 | | pixman_implementation_t * |
667 | | _pixman_x86_get_implementations (pixman_implementation_t *imp); |
668 | | |
669 | | pixman_implementation_t * |
670 | | _pixman_arm_get_implementations (pixman_implementation_t *imp); |
671 | | |
672 | | pixman_implementation_t * |
673 | | _pixman_ppc_get_implementations (pixman_implementation_t *imp); |
674 | | |
675 | | pixman_implementation_t * |
676 | | _pixman_mips_get_implementations (pixman_implementation_t *imp); |
677 | | |
678 | | pixman_implementation_t * |
679 | | _pixman_riscv_get_implementations (pixman_implementation_t *imp); |
680 | | |
681 | | pixman_implementation_t * |
682 | | _pixman_choose_implementation (void); |
683 | | |
684 | | pixman_bool_t |
685 | | _pixman_disabled (const char *name); |
686 | | |
687 | | |
688 | | /* |
689 | | * Utilities |
690 | | */ |
691 | | pixman_bool_t |
692 | | _pixman_compute_composite_region32 (pixman_region32_t * region, |
693 | | pixman_image_t * src_image, |
694 | | pixman_image_t * mask_image, |
695 | | pixman_image_t * dest_image, |
696 | | int32_t src_x, |
697 | | int32_t src_y, |
698 | | int32_t mask_x, |
699 | | int32_t mask_y, |
700 | | int32_t dest_x, |
701 | | int32_t dest_y, |
702 | | int32_t width, |
703 | | int32_t height); |
704 | | uint32_t * |
705 | | _pixman_iter_get_scanline_noop (pixman_iter_t *iter, const uint32_t *mask); |
706 | | |
707 | | void |
708 | | _pixman_iter_init_bits_stride (pixman_iter_t *iter, const pixman_iter_info_t *info); |
709 | | |
710 | | /* These "formats" all have depth 0, so they |
711 | | * will never clash with any real ones |
712 | | */ |
713 | 17.2k | #define PIXMAN_null PIXMAN_FORMAT (0, 0, 0, 0, 0, 0) |
714 | 2 | #define PIXMAN_solid PIXMAN_FORMAT (0, 1, 0, 0, 0, 0) |
715 | 0 | #define PIXMAN_pixbuf PIXMAN_FORMAT (0, 2, 0, 0, 0, 0) |
716 | 0 | #define PIXMAN_rpixbuf PIXMAN_FORMAT (0, 3, 0, 0, 0, 0) |
717 | 4 | #define PIXMAN_unknown PIXMAN_FORMAT (0, 4, 0, 0, 0, 0) |
718 | 15.1k | #define PIXMAN_any PIXMAN_FORMAT (0, 5, 0, 0, 0, 0) |
719 | | |
720 | 1.33k | #define PIXMAN_OP_any (PIXMAN_N_OPERATORS + 1) |
721 | | |
722 | 649 | #define FAST_PATH_ID_TRANSFORM (1 << 0) |
723 | 100 | #define FAST_PATH_NO_ALPHA_MAP (1 << 1) |
724 | 71 | #define FAST_PATH_NO_CONVOLUTION_FILTER (1 << 2) |
725 | 67 | #define FAST_PATH_NO_PAD_REPEAT (1 << 3) |
726 | 71 | #define FAST_PATH_NO_REFLECT_REPEAT (1 << 4) |
727 | 71 | #define FAST_PATH_NO_ACCESSORS (1 << 5) |
728 | 593 | #define FAST_PATH_NARROW_FORMAT (1 << 6) |
729 | 0 | #define FAST_PATH_COMPONENT_ALPHA (1 << 8) |
730 | 1.50k | #define FAST_PATH_SAMPLES_OPAQUE (1 << 7) |
731 | 71 | #define FAST_PATH_UNIFIED_ALPHA (1 << 9) |
732 | 1 | #define FAST_PATH_SCALE_TRANSFORM (1 << 10) |
733 | 823 | #define FAST_PATH_NEAREST_FILTER (1 << 11) |
734 | 4 | #define FAST_PATH_HAS_TRANSFORM (1 << 12) |
735 | 591 | #define FAST_PATH_IS_OPAQUE (1 << 13) |
736 | 71 | #define FAST_PATH_NO_NORMAL_REPEAT (1 << 14) |
737 | 4 | #define FAST_PATH_NO_NONE_REPEAT (1 << 15) |
738 | 69 | #define FAST_PATH_X_UNIT_POSITIVE (1 << 16) |
739 | 71 | #define FAST_PATH_AFFINE_TRANSFORM (1 << 17) |
740 | 68 | #define FAST_PATH_Y_UNIT_ZERO (1 << 18) |
741 | 752 | #define FAST_PATH_BILINEAR_FILTER (1 << 19) |
742 | 0 | #define FAST_PATH_ROTATE_90_TRANSFORM (1 << 20) |
743 | 0 | #define FAST_PATH_ROTATE_180_TRANSFORM (1 << 21) |
744 | 0 | #define FAST_PATH_ROTATE_270_TRANSFORM (1 << 22) |
745 | 946 | #define FAST_PATH_SAMPLES_COVER_CLIP_NEAREST (1 << 23) |
746 | 752 | #define FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR (1 << 24) |
747 | 65 | #define FAST_PATH_BITS_IMAGE (1 << 25) |
748 | 0 | #define FAST_PATH_SEPARABLE_CONVOLUTION_FILTER (1 << 26) |
749 | | |
750 | | #define FAST_PATH_PAD_REPEAT \ |
751 | | (FAST_PATH_NO_NONE_REPEAT | \ |
752 | | FAST_PATH_NO_NORMAL_REPEAT | \ |
753 | | FAST_PATH_NO_REFLECT_REPEAT) |
754 | | |
755 | | #define FAST_PATH_NORMAL_REPEAT \ |
756 | 0 | (FAST_PATH_NO_NONE_REPEAT | \ |
757 | 0 | FAST_PATH_NO_PAD_REPEAT | \ |
758 | 0 | FAST_PATH_NO_REFLECT_REPEAT) |
759 | | |
760 | | #define FAST_PATH_NONE_REPEAT \ |
761 | | (FAST_PATH_NO_NORMAL_REPEAT | \ |
762 | | FAST_PATH_NO_PAD_REPEAT | \ |
763 | | FAST_PATH_NO_REFLECT_REPEAT) |
764 | | |
765 | | #define FAST_PATH_REFLECT_REPEAT \ |
766 | | (FAST_PATH_NO_NONE_REPEAT | \ |
767 | | FAST_PATH_NO_NORMAL_REPEAT | \ |
768 | | FAST_PATH_NO_PAD_REPEAT) |
769 | | |
770 | | #define FAST_PATH_STANDARD_FLAGS \ |
771 | | (FAST_PATH_NO_CONVOLUTION_FILTER | \ |
772 | | FAST_PATH_NO_ACCESSORS | \ |
773 | | FAST_PATH_NO_ALPHA_MAP | \ |
774 | | FAST_PATH_NARROW_FORMAT) |
775 | | |
776 | | #define FAST_PATH_STD_DEST_FLAGS \ |
777 | | (FAST_PATH_NO_ACCESSORS | \ |
778 | | FAST_PATH_NO_ALPHA_MAP | \ |
779 | | FAST_PATH_NARROW_FORMAT) |
780 | | |
781 | | #define SOURCE_FLAGS(format) \ |
782 | | (FAST_PATH_STANDARD_FLAGS | \ |
783 | | ((PIXMAN_ ## format == PIXMAN_solid) ? \ |
784 | | 0 : (FAST_PATH_SAMPLES_COVER_CLIP_NEAREST | FAST_PATH_NEAREST_FILTER | FAST_PATH_ID_TRANSFORM))) |
785 | | |
786 | | #define MASK_FLAGS(format, extra) \ |
787 | | ((PIXMAN_ ## format == PIXMAN_null) ? 0 : (SOURCE_FLAGS (format) | extra)) |
788 | | |
789 | | #define FAST_PATH(op, src, src_flags, mask, mask_flags, dest, dest_flags, func) \ |
790 | | PIXMAN_OP_ ## op, \ |
791 | | PIXMAN_ ## src, \ |
792 | | src_flags, \ |
793 | | PIXMAN_ ## mask, \ |
794 | | mask_flags, \ |
795 | | PIXMAN_ ## dest, \ |
796 | | dest_flags, \ |
797 | | func |
798 | | |
799 | | #define PIXMAN_STD_FAST_PATH(op, src, mask, dest, func) \ |
800 | | { FAST_PATH ( \ |
801 | | op, \ |
802 | | src, SOURCE_FLAGS (src), \ |
803 | | mask, MASK_FLAGS (mask, FAST_PATH_UNIFIED_ALPHA), \ |
804 | | dest, FAST_PATH_STD_DEST_FLAGS, \ |
805 | | func) } |
806 | | |
807 | | #define PIXMAN_STD_FAST_PATH_CA(op, src, mask, dest, func) \ |
808 | | { FAST_PATH ( \ |
809 | | op, \ |
810 | | src, SOURCE_FLAGS (src), \ |
811 | | mask, MASK_FLAGS (mask, FAST_PATH_COMPONENT_ALPHA), \ |
812 | | dest, FAST_PATH_STD_DEST_FLAGS, \ |
813 | | func) } |
814 | | |
815 | | extern pixman_implementation_t *global_implementation; |
816 | | |
817 | | static force_inline pixman_implementation_t * |
818 | | get_implementation (void) |
819 | 196 | { |
820 | | #ifndef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR |
821 | | if (!global_implementation) |
822 | | global_implementation = _pixman_choose_implementation (); |
823 | | #endif |
824 | 196 | return global_implementation; |
825 | 196 | } pixman.c:get_implementation Line | Count | Source | 819 | 196 | { | 820 | | #ifndef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR | 821 | | if (!global_implementation) | 822 | | global_implementation = _pixman_choose_implementation (); | 823 | | #endif | 824 | 196 | return global_implementation; | 825 | 196 | } |
Unexecuted instantiation: pixman-bits-image.c:get_implementation Unexecuted instantiation: pixman-glyph.c:get_implementation Unexecuted instantiation: pixman-image.c:get_implementation Unexecuted instantiation: pixman-implementation.c:get_implementation Unexecuted instantiation: pixman-linear-gradient.c:get_implementation Unexecuted instantiation: pixman-matrix.c:get_implementation Unexecuted instantiation: pixman-mips.c:get_implementation Unexecuted instantiation: pixman-noop.c:get_implementation Unexecuted instantiation: pixman-ppc.c:get_implementation Unexecuted instantiation: pixman-radial-gradient.c:get_implementation Unexecuted instantiation: pixman-region32.c:get_implementation Unexecuted instantiation: pixman-riscv.c:get_implementation Unexecuted instantiation: pixman-solid-fill.c:get_implementation Unexecuted instantiation: pixman-trap.c:get_implementation Unexecuted instantiation: pixman-utils.c:get_implementation Unexecuted instantiation: pixman-x86.c:get_implementation Unexecuted instantiation: pixman-mmx.c:get_implementation Unexecuted instantiation: pixman-sse2.c:get_implementation Unexecuted instantiation: pixman-ssse3.c:get_implementation Unexecuted instantiation: pixman-access.c:get_implementation Unexecuted instantiation: pixman-access-accessors.c:get_implementation Unexecuted instantiation: pixman-arm.c:get_implementation Unexecuted instantiation: pixman-edge.c:get_implementation Unexecuted instantiation: pixman-edge-accessors.c:get_implementation Unexecuted instantiation: pixman-fast-path.c:get_implementation Unexecuted instantiation: pixman-general.c:get_implementation Unexecuted instantiation: pixman-gradient-walker.c:get_implementation Unexecuted instantiation: pixman-region16.c:get_implementation Unexecuted instantiation: pixman-combine32.c:get_implementation Unexecuted instantiation: pixman-combine-float.c:get_implementation Unexecuted instantiation: pixman-conical-gradient.c:get_implementation |
826 | | |
827 | | /* This function is exported for the sake of the test suite and not part |
828 | | * of the ABI. |
829 | | */ |
830 | | PIXMAN_EXPORT pixman_implementation_t * |
831 | | _pixman_internal_only_get_reference_implementation (void); |
832 | | |
833 | | /* This function is exported for the sake of the test suite and not part |
834 | | * of the ABI. |
835 | | */ |
836 | | PIXMAN_EXPORT pixman_implementation_t * |
837 | | _pixman_internal_only_get_implementation (void); |
838 | | |
839 | | /* This function is exported for the sake of the test suite and not part |
840 | | * of the ABI. |
841 | | */ |
842 | | PIXMAN_EXPORT pixman_fast_path_t * |
843 | | _pixman_implementation_get_reference_fast_path (void); |
844 | | |
845 | | /* This function is exported for the sake of the test suite and not part |
846 | | * of the ABI. |
847 | | */ |
848 | | PIXMAN_EXPORT int |
849 | | _pixman_implementation_get_reference_fast_path_size (); |
850 | | |
851 | | /* Memory allocation helpers */ |
852 | | void * |
853 | | pixman_malloc_ab (unsigned int n, unsigned int b); |
854 | | |
855 | | void * |
856 | | pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c); |
857 | | |
858 | | void * |
859 | | pixman_malloc_ab_plus_c (unsigned int a, unsigned int b, unsigned int c); |
860 | | |
861 | | pixman_bool_t |
862 | | _pixman_multiply_overflows_size (size_t a, size_t b); |
863 | | |
864 | | pixman_bool_t |
865 | | _pixman_multiply_overflows_int (unsigned int a, unsigned int b); |
866 | | |
867 | | pixman_bool_t |
868 | | _pixman_addition_overflows_int (unsigned int a, unsigned int b); |
869 | | |
870 | | /* Compositing utilities */ |
871 | | void |
872 | | pixman_expand_to_float (argb_t *dst, |
873 | | const uint32_t *src, |
874 | | pixman_format_code_t format, |
875 | | int width); |
876 | | |
877 | | void |
878 | | pixman_contract_from_float (uint32_t *dst, |
879 | | const argb_t *src, |
880 | | int width); |
881 | | |
882 | | /* Region Helpers */ |
883 | | pixman_bool_t |
884 | | pixman_region32_copy_from_region16 (pixman_region32_t *dst, |
885 | | const pixman_region16_t *src); |
886 | | |
887 | | pixman_bool_t |
888 | | pixman_region16_copy_from_region32 (pixman_region16_t *dst, |
889 | | const pixman_region32_t *src); |
890 | | |
891 | | /* Doubly linked lists */ |
892 | | typedef struct pixman_link_t pixman_link_t; |
893 | | struct pixman_link_t |
894 | | { |
895 | | pixman_link_t *next; |
896 | | pixman_link_t *prev; |
897 | | }; |
898 | | |
899 | | typedef struct pixman_list_t pixman_list_t; |
900 | | struct pixman_list_t |
901 | | { |
902 | | pixman_link_t *head; |
903 | | pixman_link_t *tail; |
904 | | }; |
905 | | |
906 | | static force_inline void |
907 | | pixman_list_init (pixman_list_t *list) |
908 | 0 | { |
909 | 0 | list->head = (pixman_link_t *)list; |
910 | 0 | list->tail = (pixman_link_t *)list; |
911 | 0 | } Unexecuted instantiation: pixman.c:pixman_list_init Unexecuted instantiation: pixman-bits-image.c:pixman_list_init Unexecuted instantiation: pixman-glyph.c:pixman_list_init Unexecuted instantiation: pixman-image.c:pixman_list_init Unexecuted instantiation: pixman-implementation.c:pixman_list_init Unexecuted instantiation: pixman-linear-gradient.c:pixman_list_init Unexecuted instantiation: pixman-matrix.c:pixman_list_init Unexecuted instantiation: pixman-mips.c:pixman_list_init Unexecuted instantiation: pixman-noop.c:pixman_list_init Unexecuted instantiation: pixman-ppc.c:pixman_list_init Unexecuted instantiation: pixman-radial-gradient.c:pixman_list_init Unexecuted instantiation: pixman-region32.c:pixman_list_init Unexecuted instantiation: pixman-riscv.c:pixman_list_init Unexecuted instantiation: pixman-solid-fill.c:pixman_list_init Unexecuted instantiation: pixman-trap.c:pixman_list_init Unexecuted instantiation: pixman-utils.c:pixman_list_init Unexecuted instantiation: pixman-x86.c:pixman_list_init Unexecuted instantiation: pixman-mmx.c:pixman_list_init Unexecuted instantiation: pixman-sse2.c:pixman_list_init Unexecuted instantiation: pixman-ssse3.c:pixman_list_init Unexecuted instantiation: pixman-access.c:pixman_list_init Unexecuted instantiation: pixman-access-accessors.c:pixman_list_init Unexecuted instantiation: pixman-arm.c:pixman_list_init Unexecuted instantiation: pixman-edge.c:pixman_list_init Unexecuted instantiation: pixman-edge-accessors.c:pixman_list_init Unexecuted instantiation: pixman-fast-path.c:pixman_list_init Unexecuted instantiation: pixman-general.c:pixman_list_init Unexecuted instantiation: pixman-gradient-walker.c:pixman_list_init Unexecuted instantiation: pixman-region16.c:pixman_list_init Unexecuted instantiation: pixman-combine32.c:pixman_list_init Unexecuted instantiation: pixman-combine-float.c:pixman_list_init Unexecuted instantiation: pixman-conical-gradient.c:pixman_list_init |
912 | | |
913 | | static force_inline void |
914 | | pixman_list_prepend (pixman_list_t *list, pixman_link_t *link) |
915 | 0 | { |
916 | 0 | link->next = list->head; |
917 | 0 | link->prev = (pixman_link_t *)list; |
918 | 0 | list->head->prev = link; |
919 | 0 | list->head = link; |
920 | 0 | } Unexecuted instantiation: pixman.c:pixman_list_prepend Unexecuted instantiation: pixman-bits-image.c:pixman_list_prepend Unexecuted instantiation: pixman-glyph.c:pixman_list_prepend Unexecuted instantiation: pixman-image.c:pixman_list_prepend Unexecuted instantiation: pixman-implementation.c:pixman_list_prepend Unexecuted instantiation: pixman-linear-gradient.c:pixman_list_prepend Unexecuted instantiation: pixman-matrix.c:pixman_list_prepend Unexecuted instantiation: pixman-mips.c:pixman_list_prepend Unexecuted instantiation: pixman-noop.c:pixman_list_prepend Unexecuted instantiation: pixman-ppc.c:pixman_list_prepend Unexecuted instantiation: pixman-radial-gradient.c:pixman_list_prepend Unexecuted instantiation: pixman-region32.c:pixman_list_prepend Unexecuted instantiation: pixman-riscv.c:pixman_list_prepend Unexecuted instantiation: pixman-solid-fill.c:pixman_list_prepend Unexecuted instantiation: pixman-trap.c:pixman_list_prepend Unexecuted instantiation: pixman-utils.c:pixman_list_prepend Unexecuted instantiation: pixman-x86.c:pixman_list_prepend Unexecuted instantiation: pixman-mmx.c:pixman_list_prepend Unexecuted instantiation: pixman-sse2.c:pixman_list_prepend Unexecuted instantiation: pixman-ssse3.c:pixman_list_prepend Unexecuted instantiation: pixman-access.c:pixman_list_prepend Unexecuted instantiation: pixman-access-accessors.c:pixman_list_prepend Unexecuted instantiation: pixman-arm.c:pixman_list_prepend Unexecuted instantiation: pixman-edge.c:pixman_list_prepend Unexecuted instantiation: pixman-edge-accessors.c:pixman_list_prepend Unexecuted instantiation: pixman-fast-path.c:pixman_list_prepend Unexecuted instantiation: pixman-general.c:pixman_list_prepend Unexecuted instantiation: pixman-gradient-walker.c:pixman_list_prepend Unexecuted instantiation: pixman-region16.c:pixman_list_prepend Unexecuted instantiation: pixman-combine32.c:pixman_list_prepend Unexecuted instantiation: pixman-combine-float.c:pixman_list_prepend Unexecuted instantiation: pixman-conical-gradient.c:pixman_list_prepend |
921 | | |
922 | | static force_inline void |
923 | | pixman_list_unlink (pixman_link_t *link) |
924 | 0 | { |
925 | 0 | link->prev->next = link->next; |
926 | 0 | link->next->prev = link->prev; |
927 | 0 | } Unexecuted instantiation: pixman.c:pixman_list_unlink Unexecuted instantiation: pixman-bits-image.c:pixman_list_unlink Unexecuted instantiation: pixman-glyph.c:pixman_list_unlink Unexecuted instantiation: pixman-image.c:pixman_list_unlink Unexecuted instantiation: pixman-implementation.c:pixman_list_unlink Unexecuted instantiation: pixman-linear-gradient.c:pixman_list_unlink Unexecuted instantiation: pixman-matrix.c:pixman_list_unlink Unexecuted instantiation: pixman-mips.c:pixman_list_unlink Unexecuted instantiation: pixman-noop.c:pixman_list_unlink Unexecuted instantiation: pixman-ppc.c:pixman_list_unlink Unexecuted instantiation: pixman-radial-gradient.c:pixman_list_unlink Unexecuted instantiation: pixman-region32.c:pixman_list_unlink Unexecuted instantiation: pixman-riscv.c:pixman_list_unlink Unexecuted instantiation: pixman-solid-fill.c:pixman_list_unlink Unexecuted instantiation: pixman-trap.c:pixman_list_unlink Unexecuted instantiation: pixman-utils.c:pixman_list_unlink Unexecuted instantiation: pixman-x86.c:pixman_list_unlink Unexecuted instantiation: pixman-mmx.c:pixman_list_unlink Unexecuted instantiation: pixman-sse2.c:pixman_list_unlink Unexecuted instantiation: pixman-ssse3.c:pixman_list_unlink Unexecuted instantiation: pixman-access.c:pixman_list_unlink Unexecuted instantiation: pixman-access-accessors.c:pixman_list_unlink Unexecuted instantiation: pixman-arm.c:pixman_list_unlink Unexecuted instantiation: pixman-edge.c:pixman_list_unlink Unexecuted instantiation: pixman-edge-accessors.c:pixman_list_unlink Unexecuted instantiation: pixman-fast-path.c:pixman_list_unlink Unexecuted instantiation: pixman-general.c:pixman_list_unlink Unexecuted instantiation: pixman-gradient-walker.c:pixman_list_unlink Unexecuted instantiation: pixman-region16.c:pixman_list_unlink Unexecuted instantiation: pixman-combine32.c:pixman_list_unlink Unexecuted instantiation: pixman-combine-float.c:pixman_list_unlink Unexecuted instantiation: pixman-conical-gradient.c:pixman_list_unlink |
928 | | |
929 | | static force_inline void |
930 | | pixman_list_move_to_front (pixman_list_t *list, pixman_link_t *link) |
931 | 0 | { |
932 | 0 | pixman_list_unlink (link); |
933 | 0 | pixman_list_prepend (list, link); |
934 | 0 | } Unexecuted instantiation: pixman.c:pixman_list_move_to_front Unexecuted instantiation: pixman-bits-image.c:pixman_list_move_to_front Unexecuted instantiation: pixman-glyph.c:pixman_list_move_to_front Unexecuted instantiation: pixman-image.c:pixman_list_move_to_front Unexecuted instantiation: pixman-implementation.c:pixman_list_move_to_front Unexecuted instantiation: pixman-linear-gradient.c:pixman_list_move_to_front Unexecuted instantiation: pixman-matrix.c:pixman_list_move_to_front Unexecuted instantiation: pixman-mips.c:pixman_list_move_to_front Unexecuted instantiation: pixman-noop.c:pixman_list_move_to_front Unexecuted instantiation: pixman-ppc.c:pixman_list_move_to_front Unexecuted instantiation: pixman-radial-gradient.c:pixman_list_move_to_front Unexecuted instantiation: pixman-region32.c:pixman_list_move_to_front Unexecuted instantiation: pixman-riscv.c:pixman_list_move_to_front Unexecuted instantiation: pixman-solid-fill.c:pixman_list_move_to_front Unexecuted instantiation: pixman-trap.c:pixman_list_move_to_front Unexecuted instantiation: pixman-utils.c:pixman_list_move_to_front Unexecuted instantiation: pixman-x86.c:pixman_list_move_to_front Unexecuted instantiation: pixman-mmx.c:pixman_list_move_to_front Unexecuted instantiation: pixman-sse2.c:pixman_list_move_to_front Unexecuted instantiation: pixman-ssse3.c:pixman_list_move_to_front Unexecuted instantiation: pixman-access.c:pixman_list_move_to_front Unexecuted instantiation: pixman-access-accessors.c:pixman_list_move_to_front Unexecuted instantiation: pixman-arm.c:pixman_list_move_to_front Unexecuted instantiation: pixman-edge.c:pixman_list_move_to_front Unexecuted instantiation: pixman-edge-accessors.c:pixman_list_move_to_front Unexecuted instantiation: pixman-fast-path.c:pixman_list_move_to_front Unexecuted instantiation: pixman-general.c:pixman_list_move_to_front Unexecuted instantiation: pixman-gradient-walker.c:pixman_list_move_to_front Unexecuted instantiation: pixman-region16.c:pixman_list_move_to_front Unexecuted instantiation: pixman-combine32.c:pixman_list_move_to_front Unexecuted instantiation: pixman-combine-float.c:pixman_list_move_to_front Unexecuted instantiation: pixman-conical-gradient.c:pixman_list_move_to_front |
935 | | |
936 | | /* Misc macros */ |
937 | | |
938 | | #ifndef FALSE |
939 | 186k | # define FALSE 0 |
940 | | #endif |
941 | | |
942 | | #ifndef TRUE |
943 | 821k | # define TRUE 1 |
944 | | #endif |
945 | | |
946 | | #ifndef MIN |
947 | 211k | # define MIN(a, b) ((a < b) ? a : b) |
948 | | #endif |
949 | | |
950 | | #ifndef MAX |
951 | 138k | # define MAX(a, b) ((a > b) ? a : b) |
952 | | #endif |
953 | | |
954 | | /* Integer division that rounds towards -infinity */ |
955 | | #define DIV(a, b) \ |
956 | 60 | ((((a) < 0) == ((b) < 0)) ? (a) / (b) : \ |
957 | 12 | ((a) - (b) + 1 - (((b) < 0) << 1)) / (b)) |
958 | | |
959 | | /* Modulus that produces the remainder wrt. DIV */ |
960 | 0 | #define MOD(a, b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b)) |
961 | | |
962 | 0 | #define CLIP(v, low, high) ((v) < (low) ? (low) : ((v) > (high) ? (high) : (v))) |
963 | | |
964 | 2.32k | #define FLOAT_IS_ZERO(f) (-FLT_MIN < (f) && (f) < FLT_MIN) |
965 | | |
966 | | /* Conversion between 8888 and 0565 */ |
967 | | |
968 | | static force_inline uint16_t |
969 | | convert_8888_to_0565 (uint32_t s) |
970 | 0 | { |
971 | | /* The following code can be compiled into just 4 instructions on ARM */ |
972 | 0 | uint32_t a, b; |
973 | 0 | a = (s >> 3) & 0x1F001F; |
974 | 0 | b = s & 0xFC00; |
975 | 0 | a |= a >> 5; |
976 | 0 | a |= b >> 5; |
977 | 0 | return (uint16_t)a; |
978 | 0 | } Unexecuted instantiation: pixman.c:convert_8888_to_0565 Unexecuted instantiation: pixman-bits-image.c:convert_8888_to_0565 Unexecuted instantiation: pixman-glyph.c:convert_8888_to_0565 Unexecuted instantiation: pixman-image.c:convert_8888_to_0565 Unexecuted instantiation: pixman-implementation.c:convert_8888_to_0565 Unexecuted instantiation: pixman-linear-gradient.c:convert_8888_to_0565 Unexecuted instantiation: pixman-matrix.c:convert_8888_to_0565 Unexecuted instantiation: pixman-mips.c:convert_8888_to_0565 Unexecuted instantiation: pixman-noop.c:convert_8888_to_0565 Unexecuted instantiation: pixman-ppc.c:convert_8888_to_0565 Unexecuted instantiation: pixman-radial-gradient.c:convert_8888_to_0565 Unexecuted instantiation: pixman-region32.c:convert_8888_to_0565 Unexecuted instantiation: pixman-riscv.c:convert_8888_to_0565 Unexecuted instantiation: pixman-solid-fill.c:convert_8888_to_0565 Unexecuted instantiation: pixman-trap.c:convert_8888_to_0565 Unexecuted instantiation: pixman-utils.c:convert_8888_to_0565 Unexecuted instantiation: pixman-x86.c:convert_8888_to_0565 Unexecuted instantiation: pixman-mmx.c:convert_8888_to_0565 Unexecuted instantiation: pixman-sse2.c:convert_8888_to_0565 Unexecuted instantiation: pixman-ssse3.c:convert_8888_to_0565 Unexecuted instantiation: pixman-access.c:convert_8888_to_0565 Unexecuted instantiation: pixman-access-accessors.c:convert_8888_to_0565 Unexecuted instantiation: pixman-arm.c:convert_8888_to_0565 Unexecuted instantiation: pixman-edge.c:convert_8888_to_0565 Unexecuted instantiation: pixman-edge-accessors.c:convert_8888_to_0565 Unexecuted instantiation: pixman-fast-path.c:convert_8888_to_0565 Unexecuted instantiation: pixman-general.c:convert_8888_to_0565 Unexecuted instantiation: pixman-gradient-walker.c:convert_8888_to_0565 Unexecuted instantiation: pixman-region16.c:convert_8888_to_0565 Unexecuted instantiation: pixman-combine32.c:convert_8888_to_0565 Unexecuted instantiation: pixman-combine-float.c:convert_8888_to_0565 Unexecuted instantiation: pixman-conical-gradient.c:convert_8888_to_0565 |
979 | | |
980 | | static force_inline uint32_t |
981 | | convert_0565_to_0888 (uint16_t s) |
982 | 0 | { |
983 | 0 | return (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | |
984 | 0 | ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | |
985 | 0 | ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000))); |
986 | 0 | } Unexecuted instantiation: pixman.c:convert_0565_to_0888 Unexecuted instantiation: pixman-bits-image.c:convert_0565_to_0888 Unexecuted instantiation: pixman-glyph.c:convert_0565_to_0888 Unexecuted instantiation: pixman-image.c:convert_0565_to_0888 Unexecuted instantiation: pixman-implementation.c:convert_0565_to_0888 Unexecuted instantiation: pixman-linear-gradient.c:convert_0565_to_0888 Unexecuted instantiation: pixman-matrix.c:convert_0565_to_0888 Unexecuted instantiation: pixman-mips.c:convert_0565_to_0888 Unexecuted instantiation: pixman-noop.c:convert_0565_to_0888 Unexecuted instantiation: pixman-ppc.c:convert_0565_to_0888 Unexecuted instantiation: pixman-radial-gradient.c:convert_0565_to_0888 Unexecuted instantiation: pixman-region32.c:convert_0565_to_0888 Unexecuted instantiation: pixman-riscv.c:convert_0565_to_0888 Unexecuted instantiation: pixman-solid-fill.c:convert_0565_to_0888 Unexecuted instantiation: pixman-trap.c:convert_0565_to_0888 Unexecuted instantiation: pixman-utils.c:convert_0565_to_0888 Unexecuted instantiation: pixman-x86.c:convert_0565_to_0888 Unexecuted instantiation: pixman-mmx.c:convert_0565_to_0888 Unexecuted instantiation: pixman-sse2.c:convert_0565_to_0888 Unexecuted instantiation: pixman-ssse3.c:convert_0565_to_0888 Unexecuted instantiation: pixman-access.c:convert_0565_to_0888 Unexecuted instantiation: pixman-access-accessors.c:convert_0565_to_0888 Unexecuted instantiation: pixman-arm.c:convert_0565_to_0888 Unexecuted instantiation: pixman-edge.c:convert_0565_to_0888 Unexecuted instantiation: pixman-edge-accessors.c:convert_0565_to_0888 Unexecuted instantiation: pixman-fast-path.c:convert_0565_to_0888 Unexecuted instantiation: pixman-general.c:convert_0565_to_0888 Unexecuted instantiation: pixman-gradient-walker.c:convert_0565_to_0888 Unexecuted instantiation: pixman-region16.c:convert_0565_to_0888 Unexecuted instantiation: pixman-combine32.c:convert_0565_to_0888 Unexecuted instantiation: pixman-combine-float.c:convert_0565_to_0888 Unexecuted instantiation: pixman-conical-gradient.c:convert_0565_to_0888 |
987 | | |
988 | | static force_inline uint32_t |
989 | | convert_0565_to_8888 (uint16_t s) |
990 | 0 | { |
991 | 0 | return convert_0565_to_0888 (s) | 0xff000000; |
992 | 0 | } Unexecuted instantiation: pixman.c:convert_0565_to_8888 Unexecuted instantiation: pixman-bits-image.c:convert_0565_to_8888 Unexecuted instantiation: pixman-glyph.c:convert_0565_to_8888 Unexecuted instantiation: pixman-image.c:convert_0565_to_8888 Unexecuted instantiation: pixman-implementation.c:convert_0565_to_8888 Unexecuted instantiation: pixman-linear-gradient.c:convert_0565_to_8888 Unexecuted instantiation: pixman-matrix.c:convert_0565_to_8888 Unexecuted instantiation: pixman-mips.c:convert_0565_to_8888 Unexecuted instantiation: pixman-noop.c:convert_0565_to_8888 Unexecuted instantiation: pixman-ppc.c:convert_0565_to_8888 Unexecuted instantiation: pixman-radial-gradient.c:convert_0565_to_8888 Unexecuted instantiation: pixman-region32.c:convert_0565_to_8888 Unexecuted instantiation: pixman-riscv.c:convert_0565_to_8888 Unexecuted instantiation: pixman-solid-fill.c:convert_0565_to_8888 Unexecuted instantiation: pixman-trap.c:convert_0565_to_8888 Unexecuted instantiation: pixman-utils.c:convert_0565_to_8888 Unexecuted instantiation: pixman-x86.c:convert_0565_to_8888 Unexecuted instantiation: pixman-mmx.c:convert_0565_to_8888 Unexecuted instantiation: pixman-sse2.c:convert_0565_to_8888 Unexecuted instantiation: pixman-ssse3.c:convert_0565_to_8888 Unexecuted instantiation: pixman-access.c:convert_0565_to_8888 Unexecuted instantiation: pixman-access-accessors.c:convert_0565_to_8888 Unexecuted instantiation: pixman-arm.c:convert_0565_to_8888 Unexecuted instantiation: pixman-edge.c:convert_0565_to_8888 Unexecuted instantiation: pixman-edge-accessors.c:convert_0565_to_8888 Unexecuted instantiation: pixman-fast-path.c:convert_0565_to_8888 Unexecuted instantiation: pixman-general.c:convert_0565_to_8888 Unexecuted instantiation: pixman-gradient-walker.c:convert_0565_to_8888 Unexecuted instantiation: pixman-region16.c:convert_0565_to_8888 Unexecuted instantiation: pixman-combine32.c:convert_0565_to_8888 Unexecuted instantiation: pixman-combine-float.c:convert_0565_to_8888 Unexecuted instantiation: pixman-conical-gradient.c:convert_0565_to_8888 |
993 | | |
994 | | /* Trivial versions that are useful in macros */ |
995 | | |
996 | | static force_inline uint32_t |
997 | | convert_8888_to_8888 (uint32_t s) |
998 | 0 | { |
999 | 0 | return s; |
1000 | 0 | } Unexecuted instantiation: pixman.c:convert_8888_to_8888 Unexecuted instantiation: pixman-bits-image.c:convert_8888_to_8888 Unexecuted instantiation: pixman-glyph.c:convert_8888_to_8888 Unexecuted instantiation: pixman-image.c:convert_8888_to_8888 Unexecuted instantiation: pixman-implementation.c:convert_8888_to_8888 Unexecuted instantiation: pixman-linear-gradient.c:convert_8888_to_8888 Unexecuted instantiation: pixman-matrix.c:convert_8888_to_8888 Unexecuted instantiation: pixman-mips.c:convert_8888_to_8888 Unexecuted instantiation: pixman-noop.c:convert_8888_to_8888 Unexecuted instantiation: pixman-ppc.c:convert_8888_to_8888 Unexecuted instantiation: pixman-radial-gradient.c:convert_8888_to_8888 Unexecuted instantiation: pixman-region32.c:convert_8888_to_8888 Unexecuted instantiation: pixman-riscv.c:convert_8888_to_8888 Unexecuted instantiation: pixman-solid-fill.c:convert_8888_to_8888 Unexecuted instantiation: pixman-trap.c:convert_8888_to_8888 Unexecuted instantiation: pixman-utils.c:convert_8888_to_8888 Unexecuted instantiation: pixman-x86.c:convert_8888_to_8888 Unexecuted instantiation: pixman-mmx.c:convert_8888_to_8888 Unexecuted instantiation: pixman-sse2.c:convert_8888_to_8888 Unexecuted instantiation: pixman-ssse3.c:convert_8888_to_8888 Unexecuted instantiation: pixman-access.c:convert_8888_to_8888 Unexecuted instantiation: pixman-access-accessors.c:convert_8888_to_8888 Unexecuted instantiation: pixman-arm.c:convert_8888_to_8888 Unexecuted instantiation: pixman-edge.c:convert_8888_to_8888 Unexecuted instantiation: pixman-edge-accessors.c:convert_8888_to_8888 Unexecuted instantiation: pixman-fast-path.c:convert_8888_to_8888 Unexecuted instantiation: pixman-general.c:convert_8888_to_8888 Unexecuted instantiation: pixman-gradient-walker.c:convert_8888_to_8888 Unexecuted instantiation: pixman-region16.c:convert_8888_to_8888 Unexecuted instantiation: pixman-combine32.c:convert_8888_to_8888 Unexecuted instantiation: pixman-combine-float.c:convert_8888_to_8888 Unexecuted instantiation: pixman-conical-gradient.c:convert_8888_to_8888 |
1001 | | |
1002 | | static force_inline uint32_t |
1003 | | convert_x888_to_8888 (uint32_t s) |
1004 | 0 | { |
1005 | 0 | return s | 0xff000000; |
1006 | 0 | } Unexecuted instantiation: pixman.c:convert_x888_to_8888 Unexecuted instantiation: pixman-bits-image.c:convert_x888_to_8888 Unexecuted instantiation: pixman-glyph.c:convert_x888_to_8888 Unexecuted instantiation: pixman-image.c:convert_x888_to_8888 Unexecuted instantiation: pixman-implementation.c:convert_x888_to_8888 Unexecuted instantiation: pixman-linear-gradient.c:convert_x888_to_8888 Unexecuted instantiation: pixman-matrix.c:convert_x888_to_8888 Unexecuted instantiation: pixman-mips.c:convert_x888_to_8888 Unexecuted instantiation: pixman-noop.c:convert_x888_to_8888 Unexecuted instantiation: pixman-ppc.c:convert_x888_to_8888 Unexecuted instantiation: pixman-radial-gradient.c:convert_x888_to_8888 Unexecuted instantiation: pixman-region32.c:convert_x888_to_8888 Unexecuted instantiation: pixman-riscv.c:convert_x888_to_8888 Unexecuted instantiation: pixman-solid-fill.c:convert_x888_to_8888 Unexecuted instantiation: pixman-trap.c:convert_x888_to_8888 Unexecuted instantiation: pixman-utils.c:convert_x888_to_8888 Unexecuted instantiation: pixman-x86.c:convert_x888_to_8888 Unexecuted instantiation: pixman-mmx.c:convert_x888_to_8888 Unexecuted instantiation: pixman-sse2.c:convert_x888_to_8888 Unexecuted instantiation: pixman-ssse3.c:convert_x888_to_8888 Unexecuted instantiation: pixman-access.c:convert_x888_to_8888 Unexecuted instantiation: pixman-access-accessors.c:convert_x888_to_8888 Unexecuted instantiation: pixman-arm.c:convert_x888_to_8888 Unexecuted instantiation: pixman-edge.c:convert_x888_to_8888 Unexecuted instantiation: pixman-edge-accessors.c:convert_x888_to_8888 Unexecuted instantiation: pixman-fast-path.c:convert_x888_to_8888 Unexecuted instantiation: pixman-general.c:convert_x888_to_8888 Unexecuted instantiation: pixman-gradient-walker.c:convert_x888_to_8888 Unexecuted instantiation: pixman-region16.c:convert_x888_to_8888 Unexecuted instantiation: pixman-combine32.c:convert_x888_to_8888 Unexecuted instantiation: pixman-combine-float.c:convert_x888_to_8888 Unexecuted instantiation: pixman-conical-gradient.c:convert_x888_to_8888 |
1007 | | |
1008 | | static force_inline uint16_t |
1009 | | convert_0565_to_0565 (uint16_t s) |
1010 | 0 | { |
1011 | 0 | return s; |
1012 | 0 | } Unexecuted instantiation: pixman.c:convert_0565_to_0565 Unexecuted instantiation: pixman-bits-image.c:convert_0565_to_0565 Unexecuted instantiation: pixman-glyph.c:convert_0565_to_0565 Unexecuted instantiation: pixman-image.c:convert_0565_to_0565 Unexecuted instantiation: pixman-implementation.c:convert_0565_to_0565 Unexecuted instantiation: pixman-linear-gradient.c:convert_0565_to_0565 Unexecuted instantiation: pixman-matrix.c:convert_0565_to_0565 Unexecuted instantiation: pixman-mips.c:convert_0565_to_0565 Unexecuted instantiation: pixman-noop.c:convert_0565_to_0565 Unexecuted instantiation: pixman-ppc.c:convert_0565_to_0565 Unexecuted instantiation: pixman-radial-gradient.c:convert_0565_to_0565 Unexecuted instantiation: pixman-region32.c:convert_0565_to_0565 Unexecuted instantiation: pixman-riscv.c:convert_0565_to_0565 Unexecuted instantiation: pixman-solid-fill.c:convert_0565_to_0565 Unexecuted instantiation: pixman-trap.c:convert_0565_to_0565 Unexecuted instantiation: pixman-utils.c:convert_0565_to_0565 Unexecuted instantiation: pixman-x86.c:convert_0565_to_0565 Unexecuted instantiation: pixman-mmx.c:convert_0565_to_0565 Unexecuted instantiation: pixman-sse2.c:convert_0565_to_0565 Unexecuted instantiation: pixman-ssse3.c:convert_0565_to_0565 Unexecuted instantiation: pixman-access.c:convert_0565_to_0565 Unexecuted instantiation: pixman-access-accessors.c:convert_0565_to_0565 Unexecuted instantiation: pixman-arm.c:convert_0565_to_0565 Unexecuted instantiation: pixman-edge.c:convert_0565_to_0565 Unexecuted instantiation: pixman-edge-accessors.c:convert_0565_to_0565 Unexecuted instantiation: pixman-fast-path.c:convert_0565_to_0565 Unexecuted instantiation: pixman-general.c:convert_0565_to_0565 Unexecuted instantiation: pixman-gradient-walker.c:convert_0565_to_0565 Unexecuted instantiation: pixman-region16.c:convert_0565_to_0565 Unexecuted instantiation: pixman-combine32.c:convert_0565_to_0565 Unexecuted instantiation: pixman-combine-float.c:convert_0565_to_0565 Unexecuted instantiation: pixman-conical-gradient.c:convert_0565_to_0565 |
1013 | | |
1014 | | #define PIXMAN_FORMAT_IS_WIDE(f) \ |
1015 | 65 | (PIXMAN_FORMAT_A (f) > 8 || \ |
1016 | 65 | PIXMAN_FORMAT_R (f) > 8 || \ |
1017 | 65 | PIXMAN_FORMAT_G (f) > 8 || \ |
1018 | 65 | PIXMAN_FORMAT_B (f) > 8 || \ |
1019 | 65 | PIXMAN_FORMAT_TYPE (f) == PIXMAN_TYPE_ARGB_SRGB) |
1020 | | |
1021 | | #ifdef WORDS_BIGENDIAN |
1022 | | # define SCREEN_SHIFT_LEFT(x,n) ((x) << (n)) |
1023 | | # define SCREEN_SHIFT_RIGHT(x,n) ((x) >> (n)) |
1024 | | #else |
1025 | 0 | # define SCREEN_SHIFT_LEFT(x,n) ((x) >> (n)) |
1026 | 0 | # define SCREEN_SHIFT_RIGHT(x,n) ((x) << (n)) |
1027 | | #endif |
1028 | | |
1029 | | static force_inline uint32_t |
1030 | | unorm_to_unorm (uint32_t val, int from_bits, int to_bits) |
1031 | 805 | { |
1032 | 805 | uint32_t result; |
1033 | | |
1034 | 805 | if (from_bits == 0) |
1035 | 0 | return 0; |
1036 | | |
1037 | | /* Delete any extra bits */ |
1038 | 805 | val &= ((1 << from_bits) - 1); |
1039 | | |
1040 | 805 | if (from_bits >= to_bits) |
1041 | 805 | return val >> (from_bits - to_bits); |
1042 | | |
1043 | | /* Start out with the high bit of val in the high bit of result. */ |
1044 | 0 | result = val << (to_bits - from_bits); |
1045 | | |
1046 | | /* Copy the bits in result, doubling the number of bits each time, until |
1047 | | * we fill all to_bits. Unrolled manually because from_bits and to_bits |
1048 | | * are usually known statically, so the compiler can turn all of this |
1049 | | * into a few shifts. |
1050 | | */ |
1051 | 0 | #define REPLICATE() \ |
1052 | 0 | do \ |
1053 | 0 | { \ |
1054 | 0 | if (from_bits < to_bits) \ |
1055 | 0 | { \ |
1056 | 0 | result |= result >> from_bits; \ |
1057 | 0 | \ |
1058 | 0 | from_bits *= 2; \ |
1059 | 0 | } \ |
1060 | 0 | } \ |
1061 | 0 | while (0) |
1062 | |
|
1063 | 0 | REPLICATE(); |
1064 | 0 | REPLICATE(); |
1065 | 0 | REPLICATE(); |
1066 | 0 | REPLICATE(); |
1067 | 0 | REPLICATE(); |
1068 | |
|
1069 | 0 | return result; |
1070 | 805 | } Unexecuted instantiation: pixman.c:unorm_to_unorm Unexecuted instantiation: pixman-bits-image.c:unorm_to_unorm Unexecuted instantiation: pixman-glyph.c:unorm_to_unorm Unexecuted instantiation: pixman-image.c:unorm_to_unorm Unexecuted instantiation: pixman-implementation.c:unorm_to_unorm Unexecuted instantiation: pixman-linear-gradient.c:unorm_to_unorm Unexecuted instantiation: pixman-matrix.c:unorm_to_unorm Unexecuted instantiation: pixman-mips.c:unorm_to_unorm Unexecuted instantiation: pixman-noop.c:unorm_to_unorm Unexecuted instantiation: pixman-ppc.c:unorm_to_unorm Unexecuted instantiation: pixman-radial-gradient.c:unorm_to_unorm Unexecuted instantiation: pixman-region32.c:unorm_to_unorm Unexecuted instantiation: pixman-riscv.c:unorm_to_unorm Unexecuted instantiation: pixman-solid-fill.c:unorm_to_unorm Unexecuted instantiation: pixman-trap.c:unorm_to_unorm Unexecuted instantiation: pixman-utils.c:unorm_to_unorm Unexecuted instantiation: pixman-x86.c:unorm_to_unorm Unexecuted instantiation: pixman-mmx.c:unorm_to_unorm Unexecuted instantiation: pixman-sse2.c:unorm_to_unorm Unexecuted instantiation: pixman-ssse3.c:unorm_to_unorm pixman-access.c:unorm_to_unorm Line | Count | Source | 1031 | 805 | { | 1032 | 805 | uint32_t result; | 1033 | | | 1034 | 805 | if (from_bits == 0) | 1035 | 0 | return 0; | 1036 | | | 1037 | | /* Delete any extra bits */ | 1038 | 805 | val &= ((1 << from_bits) - 1); | 1039 | | | 1040 | 805 | if (from_bits >= to_bits) | 1041 | 805 | return val >> (from_bits - to_bits); | 1042 | | | 1043 | | /* Start out with the high bit of val in the high bit of result. */ | 1044 | 0 | result = val << (to_bits - from_bits); | 1045 | | | 1046 | | /* Copy the bits in result, doubling the number of bits each time, until | 1047 | | * we fill all to_bits. Unrolled manually because from_bits and to_bits | 1048 | | * are usually known statically, so the compiler can turn all of this | 1049 | | * into a few shifts. | 1050 | | */ | 1051 | 0 | #define REPLICATE() \ | 1052 | 0 | do \ | 1053 | 0 | { \ | 1054 | 0 | if (from_bits < to_bits) \ | 1055 | 0 | { \ | 1056 | 0 | result |= result >> from_bits; \ | 1057 | 0 | \ | 1058 | 0 | from_bits *= 2; \ | 1059 | 0 | } \ | 1060 | 0 | } \ | 1061 | 0 | while (0) | 1062 | |
| 1063 | 0 | REPLICATE(); | 1064 | 0 | REPLICATE(); | 1065 | 0 | REPLICATE(); | 1066 | 0 | REPLICATE(); | 1067 | 0 | REPLICATE(); | 1068 | |
| 1069 | 0 | return result; | 1070 | 805 | } |
Unexecuted instantiation: pixman-access-accessors.c:unorm_to_unorm Unexecuted instantiation: pixman-arm.c:unorm_to_unorm Unexecuted instantiation: pixman-edge.c:unorm_to_unorm Unexecuted instantiation: pixman-edge-accessors.c:unorm_to_unorm Unexecuted instantiation: pixman-fast-path.c:unorm_to_unorm Unexecuted instantiation: pixman-general.c:unorm_to_unorm Unexecuted instantiation: pixman-gradient-walker.c:unorm_to_unorm Unexecuted instantiation: pixman-region16.c:unorm_to_unorm Unexecuted instantiation: pixman-combine32.c:unorm_to_unorm Unexecuted instantiation: pixman-combine-float.c:unorm_to_unorm Unexecuted instantiation: pixman-conical-gradient.c:unorm_to_unorm |
1071 | | |
1072 | | uint16_t pixman_float_to_unorm (float f, int n_bits); |
1073 | | float pixman_unorm_to_float (uint16_t u, int n_bits); |
1074 | | |
1075 | | /* |
1076 | | * Various debugging code |
1077 | | */ |
1078 | | |
1079 | | #define COMPILE_TIME_ASSERT(x) \ |
1080 | 188 | do { typedef int compile_time_assertion [(x)?1:-1]; } while (0) |
1081 | | |
1082 | | void |
1083 | | _pixman_log_error (const char *function, const char *message); |
1084 | | |
1085 | | #define return_if_fail(expr) \ |
1086 | 18 | do \ |
1087 | 18 | { \ |
1088 | 18 | if (unlikely (!(expr))) \ |
1089 | 18 | { \ |
1090 | 0 | _pixman_log_error (FUNC, "The expression " # expr " was false"); \ |
1091 | 0 | return; \ |
1092 | 0 | } \ |
1093 | 18 | } \ |
1094 | 18 | while (0) |
1095 | | |
1096 | | #define return_val_if_fail(expr, retval) \ |
1097 | 40.8k | do \ |
1098 | 40.8k | { \ |
1099 | 40.8k | if (unlikely (!(expr))) \ |
1100 | 40.8k | { \ |
1101 | 0 | _pixman_log_error (FUNC, "The expression " # expr " was false"); \ |
1102 | 0 | return (retval); \ |
1103 | 0 | } \ |
1104 | 40.8k | } \ |
1105 | 40.8k | while (0) |
1106 | | |
1107 | | #define critical_if_fail(expr) \ |
1108 | 633k | do \ |
1109 | 633k | { \ |
1110 | 633k | if (unlikely (!(expr))) \ |
1111 | 633k | _pixman_log_error (FUNC, "The expression " # expr " was false"); \ |
1112 | 633k | } \ |
1113 | 633k | while (0) |
1114 | | |
1115 | | /* |
1116 | | * Matrix |
1117 | | */ |
1118 | | |
1119 | | typedef struct { pixman_fixed_48_16_t v[3]; } pixman_vector_48_16_t; |
1120 | | |
1121 | | PIXMAN_EXPORT |
1122 | | pixman_bool_t |
1123 | | pixman_transform_point_31_16 (const pixman_transform_t *t, |
1124 | | const pixman_vector_48_16_t *v, |
1125 | | pixman_vector_48_16_t *result); |
1126 | | |
1127 | | PIXMAN_EXPORT |
1128 | | void |
1129 | | pixman_transform_point_31_16_3d (const pixman_transform_t *t, |
1130 | | const pixman_vector_48_16_t *v, |
1131 | | pixman_vector_48_16_t *result); |
1132 | | |
1133 | | PIXMAN_EXPORT |
1134 | | void |
1135 | | pixman_transform_point_31_16_affine (const pixman_transform_t *t, |
1136 | | const pixman_vector_48_16_t *v, |
1137 | | pixman_vector_48_16_t *result); |
1138 | | |
1139 | | /* |
1140 | | * Timers |
1141 | | */ |
1142 | | |
1143 | | #ifdef PIXMAN_TIMERS |
1144 | | |
1145 | | static inline uint64_t |
1146 | | oil_profile_stamp_rdtsc (void) |
1147 | | { |
1148 | | uint32_t hi, lo; |
1149 | | |
1150 | | __asm__ __volatile__ ("rdtsc\n" : "=a" (lo), "=d" (hi)); |
1151 | | |
1152 | | return lo | (((uint64_t)hi) << 32); |
1153 | | } |
1154 | | |
1155 | | #define OIL_STAMP oil_profile_stamp_rdtsc |
1156 | | |
1157 | | typedef struct pixman_timer_t pixman_timer_t; |
1158 | | |
1159 | | struct pixman_timer_t |
1160 | | { |
1161 | | int initialized; |
1162 | | const char * name; |
1163 | | uint64_t n_times; |
1164 | | uint64_t total; |
1165 | | pixman_timer_t *next; |
1166 | | }; |
1167 | | |
1168 | | extern int timer_defined; |
1169 | | |
1170 | | void pixman_timer_register (pixman_timer_t *timer); |
1171 | | |
1172 | | #define TIMER_BEGIN(tname) \ |
1173 | | { \ |
1174 | | static pixman_timer_t timer ## tname; \ |
1175 | | uint64_t begin ## tname; \ |
1176 | | \ |
1177 | | if (!timer ## tname.initialized) \ |
1178 | | { \ |
1179 | | timer ## tname.initialized = 1; \ |
1180 | | timer ## tname.name = # tname; \ |
1181 | | pixman_timer_register (&timer ## tname); \ |
1182 | | } \ |
1183 | | \ |
1184 | | timer ## tname.n_times++; \ |
1185 | | begin ## tname = OIL_STAMP (); |
1186 | | |
1187 | | #define TIMER_END(tname) \ |
1188 | | timer ## tname.total += OIL_STAMP () - begin ## tname; \ |
1189 | | } |
1190 | | |
1191 | | #else |
1192 | | |
1193 | | #define TIMER_BEGIN(tname) |
1194 | | #define TIMER_END(tname) |
1195 | | |
1196 | | #endif /* PIXMAN_TIMERS */ |
1197 | | |
1198 | | #endif /* __ASSEMBLER__ */ |
1199 | | |
1200 | | #endif /* PIXMAN_PRIVATE_H */ |