Commit df58bb7f authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Add a fallback for unaligned source data for FORMAT_ARGB_MASK. (#117217)

Mon Aug 18 11:48:51 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdrawable-x11.c (convert_to_format):
        Add a fallback for unaligned source data for
        FORMAT_ARGB_MASK. (#117217)
parent 7a3ce1db
Mon Aug 18 11:48:51 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c (convert_to_format):
Add a fallback for unaligned source data for
FORMAT_ARGB_MASK. (#117217)
Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com>
* configure.in: Rework handling of REBUILD_PNGS, * configure.in: Rework handling of REBUILD_PNGS,
......
Mon Aug 18 11:48:51 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c (convert_to_format):
Add a fallback for unaligned source data for
FORMAT_ARGB_MASK. (#117217)
Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com>
* configure.in: Rework handling of REBUILD_PNGS, * configure.in: Rework handling of REBUILD_PNGS,
......
Mon Aug 18 11:48:51 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c (convert_to_format):
Add a fallback for unaligned source data for
FORMAT_ARGB_MASK. (#117217)
Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com>
* configure.in: Rework handling of REBUILD_PNGS, * configure.in: Rework handling of REBUILD_PNGS,
......
Mon Aug 18 11:48:51 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c (convert_to_format):
Add a fallback for unaligned source data for
FORMAT_ARGB_MASK. (#117217)
Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com>
* configure.in: Rework handling of REBUILD_PNGS, * configure.in: Rework handling of REBUILD_PNGS,
......
Mon Aug 18 11:48:51 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdrawable-x11.c (convert_to_format):
Add a fallback for unaligned source data for
FORMAT_ARGB_MASK. (#117217)
Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com> Mon Aug 18 10:51:57 2003 Owen Taylor <otaylor@redhat.com>
* configure.in: Rework handling of REBUILD_PNGS, * configure.in: Rework handling of REBUILD_PNGS,
......
...@@ -1079,9 +1079,25 @@ convert_to_format (guchar *src_buf, ...@@ -1079,9 +1079,25 @@ convert_to_format (guchar *src_buf,
} }
case FORMAT_ARGB_MASK: case FORMAT_ARGB_MASK:
{ {
guint *p = (guint *)(src_buf + i * src_rowstride); guchar *row = src_buf + i * src_rowstride;
guint *q = (guint *)(dest_buf + i * dest_rowstride); if (((gsize)row & 3) != 0)
guint *end = p + width; {
guchar *p = row;
guint32 *q = (guint32 *)(dest_buf + i * dest_rowstride);
guchar *end = p + 4 * width;
while (p < end)
{
*q = (p[3] << 24) | (p[0] << 16) | (p[1] << 8) | p[2];
p += 4;
q++;
}
}
else
{
guint32 *p = (guint32 *)row;
guint32 *q = (guint32 *)(dest_buf + i * dest_rowstride);
guint32 *end = p + width;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN #if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (dest_byteorder == GDK_LSB_FIRST) if (dest_byteorder == GDK_LSB_FIRST)
...@@ -1136,6 +1152,7 @@ convert_to_format (guchar *src_buf, ...@@ -1136,6 +1152,7 @@ convert_to_format (guchar *src_buf,
} }
} }
#endif /* G_BYTE_ORDER*/ #endif /* G_BYTE_ORDER*/
}
break; break;
} }
case FORMAT_ARGB: case FORMAT_ARGB:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment