Subversion Repositories Kolibri OS

Rev

Rev 1891 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1891 Rev 3931
Line -... Line 1...
-
 
1
/*
1
/* WARNING: This file is generated by combine.pl from combine.inc.
2
 * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
2
   Please edit one of those files rather than this one. */
3
 *             2005 Lars Knoll & Zack Rusin, Trolltech
3
 
4
 *
-
 
5
 * Permission to use, copy, modify, distribute, and sell this software and its
-
 
6
 * documentation for any purpose is hereby granted without fee, provided that
-
 
7
 * the above copyright notice appear in all copies and that both that
-
 
8
 * copyright notice and this permission notice appear in supporting
-
 
9
 * documentation, and that the name of Keith Packard not be used in
-
 
10
 * advertising or publicity pertaining to distribution of the software without
-
 
11
 * specific, written prior permission.  Keith Packard makes no
-
 
12
 * representations about the suitability of this software for any purpose.  It
4
#line 1 "pixman-combine.c.template"
13
 * is provided "as is" without express or implied warranty.
-
 
14
 *
-
 
15
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-
 
16
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-
 
17
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-
 
18
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-
 
19
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-
 
20
 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
-
 
21
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-
 
22
 * SOFTWARE.
-
 
23
 */
5
#ifdef HAVE_CONFIG_H
24
#ifdef HAVE_CONFIG_H
6
#include 
25
#include 
7
#endif
26
#endif
Line 8... Line 27...
8
 
27
 
9
#include 
28
#include 
Line 10... Line 29...
10
#include 
29
#include 
11
 
-
 
12
#include "pixman-private.h"
30
 
Line 13... Line 31...
13
 
31
#include "pixman-private.h"
Line 14... Line 32...
14
#include "pixman-combine32.h"
32
#include "pixman-combine32.h"
15
 
33
 
16
/*** per channel helper functions ***/
34
/* component alpha helper functions */
17
 
35
 
Line 93... Line 111...
93
}
111
}
Line 94... Line 112...
94
 
112
 
95
/*
113
/*
96
 * There are two ways of handling alpha -- either as a single unified value or
114
 * There are two ways of handling alpha -- either as a single unified value or
97
 * a separate value for each component, hence each macro must have two
115
 * a separate value for each component, hence each macro must have two
98
 * versions.  The unified alpha version has a 'U' at the end of the name,
116
 * versions.  The unified alpha version has a 'u' at the end of the name,
99
 * the component version has a 'C'.  Similarly, functions which deal with
117
 * the component version has a 'ca'.  Similarly, functions which deal with
100
 * this difference will have two versions using the same convention.
118
 * this difference will have two versions using the same convention.
Line 101... Line -...
101
 */
-
 
102
 
-
 
103
/*
-
 
104
 * All of the composing functions
-
 
105
 */
119
 */
106
 
120
 
107
static force_inline uint32_t
121
static force_inline uint32_t
108
combine_mask (const uint32_t *src, const uint32_t *mask, int i)
122
combine_mask (const uint32_t *src, const uint32_t *mask, int i)
Line 156... Line 170...
156
               int                      width)
170
               int                      width)
157
{
171
{
158
    int i;
172
    int i;
Line 159... Line 173...
159
 
173
 
-
 
174
    if (!mask)
160
    if (!mask)
175
    {
-
 
176
	memcpy (dest, src, width * sizeof (uint32_t));
161
	memcpy (dest, src, width * sizeof (uint32_t));
177
    }
162
    else
178
    else
163
    {
179
    {
164
	for (i = 0; i < width; ++i)
180
	for (i = 0; i < width; ++i)
165
	{
181
	{
Line 168... Line 184...
168
	    *(dest + i) = s;
184
	    *(dest + i) = s;
169
	}
185
	}
170
    }
186
    }
171
}
187
}
Line 172... Line -...
172
 
-
 
173
/* if the Src is opaque, call combine_src_u */
188
 
174
static void
189
static void
175
combine_over_u (pixman_implementation_t *imp,
190
combine_over_u (pixman_implementation_t *imp,
176
                pixman_op_t              op,
191
                pixman_op_t              op,
177
                uint32_t *                dest,
192
                uint32_t *                dest,
178
                const uint32_t *          src,
193
                const uint32_t *          src,
179
                const uint32_t *          mask,
194
                const uint32_t *          mask,
180
                int                      width)
195
                int                      width)
181
{
196
{
Line -... Line 197...
-
 
197
    int i;
-
 
198
 
182
    int i;
199
    if (!mask)
183
 
200
    {
184
    for (i = 0; i < width; ++i)
201
	for (i = 0; i < width; ++i)
-
 
202
	{
-
 
203
	    uint32_t s = *(src + i);
-
 
204
	    uint32_t a = ALPHA_8 (s);
-
 
205
	    if (a == 0xFF)
-
 
206
	    {
-
 
207
		*(dest + i) = s;
-
 
208
	    }
185
    {
209
	    else if (s)
186
	uint32_t s = combine_mask (src, mask, i);
210
	    {
187
	uint32_t d = *(dest + i);
-
 
188
	uint32_t ia = ALPHA_8 (~s);
211
		uint32_t d = *(dest + i);
189
 
212
		uint32_t ia = a ^ 0xFF;
190
	UN8x4_MUL_UN8_ADD_UN8x4 (d, ia, s);
213
		UN8x4_MUL_UN8_ADD_UN8x4 (d, ia, s);
191
	*(dest + i) = d;
214
		*(dest + i) = d;
-
 
215
	    }
-
 
216
	}
-
 
217
    }
-
 
218
    else
-
 
219
    {
-
 
220
	for (i = 0; i < width; ++i)
-
 
221
	{
-
 
222
	    uint32_t m = ALPHA_8 (*(mask + i));
-
 
223
	    if (m == 0xFF)
-
 
224
	    {
-
 
225
		uint32_t s = *(src + i);
-
 
226
		uint32_t a = ALPHA_8 (s);
-
 
227
		if (a == 0xFF)
-
 
228
		{
-
 
229
		    *(dest + i) = s;
-
 
230
		}
-
 
231
		else if (s)
-
 
232
		{
-
 
233
		    uint32_t d = *(dest + i);
-
 
234
		    uint32_t ia = a ^ 0xFF;
-
 
235
		    UN8x4_MUL_UN8_ADD_UN8x4 (d, ia, s);
-
 
236
		    *(dest + i) = d;
-
 
237
		}
-
 
238
	    }
-
 
239
	    else if (m)
-
 
240
	    {
-
 
241
		uint32_t s = *(src + i);
-
 
242
		if (s)
-
 
243
		{
-
 
244
		    uint32_t d = *(dest + i);
-
 
245
		    UN8x4_MUL_UN8 (s, m);
-
 
246
		    UN8x4_MUL_UN8_ADD_UN8x4 (d, ALPHA_8 (~s), s);
-
 
247
		    *(dest + i) = d;
-
 
248
		}
-
 
249
	    }
-
 
250
	}
Line 192... Line -...
192
    }
-
 
193
}
251
    }
194
 
252
}
195
/* if the Dst is opaque, this is a noop */
253
 
196
static void
254
static void
197
combine_over_reverse_u (pixman_implementation_t *imp,
255
combine_over_reverse_u (pixman_implementation_t *imp,
Line 211... Line 269...
211
	UN8x4_MUL_UN8_ADD_UN8x4 (s, ia, d);
269
	UN8x4_MUL_UN8_ADD_UN8x4 (s, ia, d);
212
	*(dest + i) = s;
270
	*(dest + i) = s;
213
    }
271
    }
214
}
272
}
Line 215... Line -...
215
 
-
 
216
/* if the Dst is opaque, call combine_src_u */
273
 
217
static void
274
static void
218
combine_in_u (pixman_implementation_t *imp,
275
combine_in_u (pixman_implementation_t *imp,
219
              pixman_op_t              op,
276
              pixman_op_t              op,
220
              uint32_t *                dest,
277
              uint32_t *                dest,
Line 231... Line 288...
231
	UN8x4_MUL_UN8 (s, a);
288
	UN8x4_MUL_UN8 (s, a);
232
	*(dest + i) = s;
289
	*(dest + i) = s;
233
    }
290
    }
234
}
291
}
Line 235... Line -...
235
 
-
 
236
/* if the Src is opaque, this is a noop */
292
 
237
static void
293
static void
238
combine_in_reverse_u (pixman_implementation_t *imp,
294
combine_in_reverse_u (pixman_implementation_t *imp,
239
                      pixman_op_t              op,
295
                      pixman_op_t              op,
240
                      uint32_t *                dest,
296
                      uint32_t *                dest,
Line 252... Line 308...
252
	UN8x4_MUL_UN8 (d, a);
308
	UN8x4_MUL_UN8 (d, a);
253
	*(dest + i) = d;
309
	*(dest + i) = d;
254
    }
310
    }
255
}
311
}
Line 256... Line -...
256
 
-
 
257
/* if the Dst is opaque, call combine_clear */
312
 
258
static void
313
static void
259
combine_out_u (pixman_implementation_t *imp,
314
combine_out_u (pixman_implementation_t *imp,
260
               pixman_op_t              op,
315
               pixman_op_t              op,
261
               uint32_t *                dest,
316
               uint32_t *                dest,
Line 272... Line 327...
272
	UN8x4_MUL_UN8 (s, a);
327
	UN8x4_MUL_UN8 (s, a);
273
	*(dest + i) = s;
328
	*(dest + i) = s;
274
    }
329
    }
275
}
330
}
Line 276... Line -...
276
 
-
 
277
/* if the Src is opaque, call combine_clear */
331
 
278
static void
332
static void
279
combine_out_reverse_u (pixman_implementation_t *imp,
333
combine_out_reverse_u (pixman_implementation_t *imp,
280
                       pixman_op_t              op,
334
                       pixman_op_t              op,
281
                       uint32_t *                dest,
335
                       uint32_t *                dest,
Line 293... Line 347...
293
	UN8x4_MUL_UN8 (d, a);
347
	UN8x4_MUL_UN8 (d, a);
294
	*(dest + i) = d;
348
	*(dest + i) = d;
295
    }
349
    }
296
}
350
}
Line 297... Line -...
297
 
-
 
298
/* if the Src is opaque, call combine_in_u */
-
 
299
/* if the Dst is opaque, call combine_over_u */
-
 
300
/* if both the Src and Dst are opaque, call combine_src_u */
351
 
301
static void
352
static void
302
combine_atop_u (pixman_implementation_t *imp,
353
combine_atop_u (pixman_implementation_t *imp,
303
                pixman_op_t              op,
354
                pixman_op_t              op,
304
                uint32_t *                dest,
355
                uint32_t *                dest,
Line 318... Line 369...
318
	UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (s, dest_a, d, src_ia);
369
	UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (s, dest_a, d, src_ia);
319
	*(dest + i) = s;
370
	*(dest + i) = s;
320
    }
371
    }
321
}
372
}
Line 322... Line -...
322
 
-
 
323
/* if the Src is opaque, call combine_over_reverse_u */
-
 
324
/* if the Dst is opaque, call combine_in_reverse_u */
-
 
325
/* if both the Src and Dst are opaque, call combine_dst_u */
373
 
326
static void
374
static void
327
combine_atop_reverse_u (pixman_implementation_t *imp,
375
combine_atop_reverse_u (pixman_implementation_t *imp,
328
                        pixman_op_t              op,
376
                        pixman_op_t              op,
329
                        uint32_t *                dest,
377
                        uint32_t *                dest,
Line 343... Line 391...
343
	UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (s, dest_ia, d, src_a);
391
	UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (s, dest_ia, d, src_a);
344
	*(dest + i) = s;
392
	*(dest + i) = s;
345
    }
393
    }
346
}
394
}
Line 347... Line -...
347
 
-
 
348
/* if the Src is opaque, call combine_over_u */
-
 
349
/* if the Dst is opaque, call combine_over_reverse_u */
-
 
350
/* if both the Src and Dst are opaque, call combine_clear */
395
 
351
static void
396
static void
352
combine_xor_u (pixman_implementation_t *imp,
397
combine_xor_u (pixman_implementation_t *imp,
353
               pixman_op_t              op,
398
               pixman_op_t              op,
354
               uint32_t *                dest,
399
               uint32_t *                dest,
Line 387... Line 432...
387
	UN8x4_ADD_UN8x4 (d, s);
432
	UN8x4_ADD_UN8x4 (d, s);
388
	*(dest + i) = d;
433
	*(dest + i) = d;
389
    }
434
    }
390
}
435
}
Line 391... Line -...
391
 
-
 
392
/* if the Src is opaque, call combine_add_u */
-
 
393
/* if the Dst is opaque, call combine_add_u */
-
 
394
/* if both the Src and Dst are opaque, call combine_add_u */
436
 
395
static void
437
static void
396
combine_saturate_u (pixman_implementation_t *imp,
438
combine_saturate_u (pixman_implementation_t *imp,
397
                    pixman_op_t              op,
439
                    pixman_op_t              op,
398
                    uint32_t *                dest,
440
                    uint32_t *                dest,
Line 439... Line 481...
439
 *
481
 *
440
 * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and
482
 * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and
441
 * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an
483
 * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an
442
 * argument. Note that this implementation operates on premultiplied colors,
484
 * argument. Note that this implementation operates on premultiplied colors,
443
 * while the PDF specification does not. Therefore the code uses the formula
485
 * while the PDF specification does not. Therefore the code uses the formula
444
 * ar.Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
486
 * Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
445
 */
487
 */
Line 446... Line 488...
446
 
488
 
447
/*
489
/*
448
 * Multiply
490
 * Multiply
449
 * B(Dca, ad, Sca, as) = Dca.Sca
491
 * B(Dca, ad, Sca, as) = Dca.Sca
450
 */
-
 
451
 
492
 */
452
static void
493
static void
453
combine_multiply_u (pixman_implementation_t *imp,
494
combine_multiply_u (pixman_implementation_t *imp,
454
                    pixman_op_t              op,
495
                    pixman_op_t              op,
455
                    uint32_t *                dest,
496
                    uint32_t *                dest,
Line 491... Line 532...
491
	uint32_t s = *(src + i);
532
	uint32_t s = *(src + i);
492
	uint32_t d = *(dest + i);
533
	uint32_t d = *(dest + i);
493
	uint32_t r = d;
534
	uint32_t r = d;
494
	uint32_t dest_ia = ALPHA_8 (~d);
535
	uint32_t dest_ia = ALPHA_8 (~d);
Line 495... Line 536...
495
 
536
 
Line 496... Line 537...
496
	combine_mask_value_ca (&s, &m);
537
	combine_mask_ca (&s, &m);
497
 
538
 
498
	UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (r, ~m, s, dest_ia);
539
	UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (r, ~m, s, dest_ia);
Line 524... Line 565...
524
									\
565
									\
525
	    result = d;							\
566
	    result = d;							\
526
	    UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (result, isa, s, ida);	\
567
	    UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (result, isa, s, ida);	\
527
	    								\
568
	    								\
528
	    *(dest + i) = result +					\
569
	    *(dest + i) = result +					\
529
		(DIV_ONE_UN8 (sa * da) << A_SHIFT) +			\
570
		(DIV_ONE_UN8 (sa * (uint32_t)da) << A_SHIFT) +		\
530
		(blend_ ## name (RED_8 (d), da, RED_8 (s), sa) << R_SHIFT) + \
571
		(blend_ ## name (RED_8 (d), da, RED_8 (s), sa) << R_SHIFT) + \
531
		(blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), sa) << G_SHIFT) + \
572
		(blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), sa) << G_SHIFT) + \
532
		(blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), sa));	\
573
		(blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), sa));	\
533
	}								\
574
	}								\
534
    }									\
575
    }									\
Line 548... Line 589...
548
	    uint32_t d = *(dest + i);					\
589
	    uint32_t d = *(dest + i);					\
549
	    uint8_t da = ALPHA_8 (d);					\
590
	    uint8_t da = ALPHA_8 (d);					\
550
	    uint8_t ida = ~da;						\
591
	    uint8_t ida = ~da;						\
551
	    uint32_t result;						\
592
	    uint32_t result;						\
552
            								\
593
            								\
553
	    combine_mask_value_ca (&s, &m);				\
594
	    combine_mask_ca (&s, &m);					\
554
            								\
595
            								\
555
	    result = d;							\
596
	    result = d;							\
556
	    UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (result, ~m, s, ida);     \
597
	    UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (result, ~m, s, ida);     \
557
            								\
598
            								\
558
	    result +=							\
599
	    result +=							\
559
	        (DIV_ONE_UN8 (ALPHA_8 (m) * da) << A_SHIFT) +		\
600
	        (DIV_ONE_UN8 (ALPHA_8 (m) * (uint32_t)da) << A_SHIFT) +	\
560
	        (blend_ ## name (RED_8 (d), da, RED_8 (s), RED_8 (m)) << R_SHIFT) + \
601
	        (blend_ ## name (RED_8 (d), da, RED_8 (s), RED_8 (m)) << R_SHIFT) + \
561
	        (blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), GREEN_8 (m)) << G_SHIFT) + \
602
	        (blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), GREEN_8 (m)) << G_SHIFT) + \
562
	        (blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), BLUE_8 (m))); \
603
	        (blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), BLUE_8 (m))); \
563
	    								\
604
	    								\
564
	    *(dest + i) = result;					\
605
	    *(dest + i) = result;					\
Line 851... Line 892...
851
 *
892
 *
852
 * Finally, set_sat:
893
 * Finally, set_sat:
853
 *
894
 *
854
 *    r * set_sat (C, s) = set_sat (x * C, r * s)
895
 *    r * set_sat (C, s) = set_sat (x * C, r * s)
855
 *
896
 *
856
 * The above holds for all non-zero x, because they x'es in the fraction for
897
 * The above holds for all non-zero x, because the x'es in the fraction for
857
 * C_mid cancel out. Specifically, it holds for x = r:
898
 * C_mid cancel out. Specifically, it holds for x = r:
858
 *
899
 *
859
 *    r * set_sat (C, s) = set_sat (r_c, rs)
900
 *    r * set_sat (C, s) = set_sat (r_c, rs)
860
 *
901
 *
861
 */
902
 */
Line 887... Line 928...
887
 *
928
 *
888
 *   Hue:
929
 *   Hue:
889
 *
930
 *
890
 *     a_s * a_d * B(s, d)
931
 *     a_s * a_d * B(s, d)
891
 *   = a_s * a_d * set_lum (set_sat (S/a_s, SAT (D/a_d)), LUM (D/a_d), 1)
932
 *   = a_s * a_d * set_lum (set_sat (S/a_s, SAT (D/a_d)), LUM (D/a_d), 1)
892
 *   = a_s * a_d * set_lum (set_sat (a_d * S, a_s * SAT (D)),
-
 
893
 *                                        a_s * LUM (D), a_s * a_d)
933
 *   = set_lum (set_sat (a_d * S, a_s * SAT (D)), a_s * LUM (D), a_s * a_d)
894
 *
934
 *
895
 */
935
 */
Line 896... Line 936...
896
 
936
 
897
#define CH_MIN(c) (c[0] < c[1] ? (c[0] < c[2] ? c[0] : c[2]) : (c[1] < c[2] ? c[1] : c[2]))
937
#define CH_MIN(c) (c[0] < c[1] ? (c[0] < c[2] ? c[0] : c[2]) : (c[1] < c[2] ? c[1] : c[2]))
Line 929... Line 969...
929
	    dc[2] = BLUE_8 (d);						\
969
	    dc[2] = BLUE_8 (d);						\
930
	    sc[2] = BLUE_8 (s);						\
970
	    sc[2] = BLUE_8 (s);						\
931
	    blend_ ## name (c, dc, da, sc, sa);				\
971
	    blend_ ## name (c, dc, da, sc, sa);				\
932
            								\
972
            								\
933
	    *(dest + i) = result +					\
973
	    *(dest + i) = result +					\
934
		(DIV_ONE_UN8 (sa * da) << A_SHIFT) +			\
974
		(DIV_ONE_UN8 (sa * (uint32_t)da) << A_SHIFT) +		\
935
		(DIV_ONE_UN8 (c[0]) << R_SHIFT) +			\
975
		(DIV_ONE_UN8 (c[0]) << R_SHIFT) +			\
936
		(DIV_ONE_UN8 (c[1]) << G_SHIFT) +			\
976
		(DIV_ONE_UN8 (c[1]) << G_SHIFT) +			\
937
		(DIV_ONE_UN8 (c[2]));					\
977
		(DIV_ONE_UN8 (c[2]));					\
938
	}								\
978
	}								\
939
    }
979
    }
Line 1146... Line 1186...
1146
#undef LUM
1186
#undef LUM
1147
#undef CH_MAX
1187
#undef CH_MAX
1148
#undef CH_MIN
1188
#undef CH_MIN
1149
#undef PDF_NON_SEPARABLE_BLEND_MODE
1189
#undef PDF_NON_SEPARABLE_BLEND_MODE
Line 1150... Line -...
1150
 
-
 
1151
/* Overlay
-
 
1152
 *
1190
 
1153
 * All of the disjoint composing functions
1191
/* All of the disjoint/conjoint composing functions
1154
 *
1192
 *
1155
 * The four entries in the first column indicate what source contributions
1193
 * The four entries in the first column indicate what source contributions
1156
 * come from each of the four areas of the picture -- areas covered by neither
1194
 * come from each of the four areas of the picture -- areas covered by neither
1157
 * A nor B, areas covered only by A, areas covered only by B and finally
1195
 * A nor B, areas covered only by A, areas covered only by B and finally
Line 1169... Line 1207...
1169
 * (0,A,0,0)	min(1,(1-b)/a)	0		max(1-b/a,0)	0
1207
 * (0,A,0,0)	min(1,(1-b)/a)	0		max(1-b/a,0)	0
1170
 * (0,0,B,0)	0		min(1,(1-a)/b)	0		max(1-a/b,0)
1208
 * (0,0,B,0)	0		min(1,(1-a)/b)	0		max(1-a/b,0)
1171
 * (0,0,B,A)	max(1-(1-b)/a,0) min(1,(1-a)/b)	 min(1,b/a)	max(1-a/b,0)
1209
 * (0,0,B,A)	max(1-(1-b)/a,0) min(1,(1-a)/b)	 min(1,b/a)	max(1-a/b,0)
1172
 * (0,A,0,B)	min(1,(1-b)/a)	max(1-(1-a)/b,0) max(1-b/a,0)	min(1,a/b)
1210
 * (0,A,0,B)	min(1,(1-b)/a)	max(1-(1-a)/b,0) max(1-b/a,0)	min(1,a/b)
1173
 * (0,A,B,0)	min(1,(1-b)/a)	min(1,(1-a)/b)	max(1-b/a,0)	max(1-a/b,0)
1211
 * (0,A,B,0)	min(1,(1-b)/a)	min(1,(1-a)/b)	max(1-b/a,0)	max(1-a/b,0)
-
 
1212
 *
-
 
1213
 * See  http://marc.info/?l=xfree-render&m=99792000027857&w=2  for more
-
 
1214
 * information about these operators.
1174
 */
1215
 */
Line 1175... Line 1216...
1175
 
1216
 
1176
#define COMBINE_A_OUT 1
1217
#define COMBINE_A_OUT 1
1177
#define COMBINE_A_IN  2
1218
#define COMBINE_A_IN  2
Line 1581... Line 1622...
1581
                        int                      width)
1622
                        int                      width)
1582
{
1623
{
1583
    combine_conjoint_general_u (dest, src, mask, width, COMBINE_XOR);
1624
    combine_conjoint_general_u (dest, src, mask, width, COMBINE_XOR);
1584
}
1625
}
Line 1585... Line -...
1585
 
-
 
-
 
1626
 
1586
/************************************************************************/
1627
 
1587
/*********************** Per Channel functions **************************/
-
 
Line 1588... Line 1628...
1588
/************************************************************************/
1628
/* Component alpha combiners */
1589
 
1629
 
1590
static void
1630
static void
1591
combine_clear_ca (pixman_implementation_t *imp,
1631
combine_clear_ca (pixman_implementation_t *imp,
Line 2460... Line 2500...
2460
    imp->combine_32_ca[PIXMAN_OP_HSL_HUE] = combine_dst;
2500
    imp->combine_32_ca[PIXMAN_OP_HSL_HUE] = combine_dst;
2461
    imp->combine_32_ca[PIXMAN_OP_HSL_SATURATION] = combine_dst;
2501
    imp->combine_32_ca[PIXMAN_OP_HSL_SATURATION] = combine_dst;
2462
    imp->combine_32_ca[PIXMAN_OP_HSL_COLOR] = combine_dst;
2502
    imp->combine_32_ca[PIXMAN_OP_HSL_COLOR] = combine_dst;
2463
    imp->combine_32_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst;
2503
    imp->combine_32_ca[PIXMAN_OP_HSL_LUMINOSITY] = combine_dst;
2464
}
2504
}
2465
-