mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-08 12:22:34 +00:00
48 lines
1.4 KiB
Diff
48 lines
1.4 KiB
Diff
Index: icformat.c
|
|
===================================================================
|
|
RCS file: /cvsroot/mozilla/gfx/cairo/libpixman/src/icformat.c,v
|
|
retrieving revision 1.2
|
|
diff -u -8 -p -r1.2 icformat.c
|
|
--- icformat.c 23 Mar 2005 19:53:40 -0000 1.2
|
|
+++ icformat.c 13 Apr 2005 16:19:35 -0000
|
|
@@ -94,17 +94,16 @@ void
|
|
pixman_format_init (pixman_format_t *format, int format_code)
|
|
{
|
|
memset (format, 0, sizeof (pixman_format_t));
|
|
|
|
/* XXX: What do we want to lodge in here?
|
|
format->id = FakeClientID (0);
|
|
*/
|
|
format->format_code = format_code;
|
|
- format->depth = PICT_FORMAT_BPP(format_code);
|
|
|
|
switch (PICT_FORMAT_TYPE(format_code)) {
|
|
case PICT_TYPE_ARGB:
|
|
|
|
format->alphaMask = Mask(PICT_FORMAT_A(format_code));
|
|
if (format->alphaMask)
|
|
format->alpha = (PICT_FORMAT_R(format_code) +
|
|
PICT_FORMAT_G(format_code) +
|
|
@@ -143,16 +142,21 @@ pixman_format_init (pixman_format_t *for
|
|
case PICT_TYPE_A:
|
|
|
|
format->alpha = 0;
|
|
format->alphaMask = Mask(PICT_FORMAT_A(format_code));
|
|
|
|
/* remaining fields already set to zero */
|
|
break;
|
|
}
|
|
+
|
|
+ format->depth = _IcOnes ((format->alphaMask << format->alpha) |
|
|
+ (format->redMask << format->red) |
|
|
+ (format->blueMask << format->blue) |
|
|
+ (format->greenMask << format->green));
|
|
}
|
|
slim_hidden_def(pixman_format_init);
|
|
|
|
void
|
|
pixman_format_destroy (pixman_format_t *format)
|
|
{
|
|
free (format);
|
|
}
|