summaryrefslogtreecommitdiff
path: root/gdk/gdkcairo.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@daenzer.net>2011-11-19 12:23:27 -0500
committerMatthias Clasen <mclasen@redhat.com>2011-11-19 12:23:27 -0500
commitab34c7989620db3890efdfb6849c64d5c70c1b76 (patch)
tree48d2fe899bbb52a8065cc1e1825000ec5643afa4 /gdk/gdkcairo.c
parent6bb495f6bdfc4fc0135be973bcd4dca9c6281434 (diff)
downloadgtk+-ab34c7989620db3890efdfb6849c64d5c70c1b76.tar.gz
Fix gdk_cairo_region_create_from_surface on big endian
gdk_cairo_region_create_from_surface doesn't work correctly on PPC. This is most prominently seen with the GTK window resize grip, the shape of which is mirrored every eight pixels horizontally. At the same time, use an A1 surface for the resize grip shape to eliminates an A8->A1 surface conversion.
Diffstat (limited to 'gdk/gdkcairo.c')
-rw-r--r--gdk/gdkcairo.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index 2ae8b09459..ea58c428f9 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -427,7 +427,11 @@ gdk_cairo_region_create_from_surface (cairo_surface_t *surface)
gint x0 = x;
while (x < extents.width)
{
+#if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (((data[x / 8] >> (x%8)) & 1) == 0)
+#else
+ if (((data[x / 8] >> (7-(x%8))) & 1) == 0)
+#endif
/* This pixel is "transparent"*/
break;
x++;