summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-09-13 16:36:12 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-09-13 16:36:12 +0100
commit19881012cb31ec2aebf556e2c25b53e8387dc689 (patch)
tree1f9ccd1d328f2b1e46f2978d881f713ecc751952
parentf8a8f297f298d81899803a1b2bbca007418408b5 (diff)
[image] Add pixel masks for BGRA formats
pixman introduced the BGRA pixel type not too long ago, and so we need to update our pixman_format_code_t to cairo_format_masks_t translator.
-rw-r--r--src/cairo-image-surface.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index b35905f5..3b232006 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -271,10 +271,18 @@ _pixman_format_to_masks (pixman_format_code_t format,
return;
case PIXMAN_TYPE_ABGR:
masks->alpha_mask = MASK (a) << (b + g + r);
- masks->blue_mask = MASK (b) << (g +r);
+ masks->blue_mask = MASK (b) << (g + r);
masks->green_mask = MASK (g) << (r);
masks->red_mask = MASK (r);
return;
+#ifdef PIXMAN_TYPE_BGRA
+ case PIXMAN_TYPE_BGRA:
+ masks->blue_mask = MASK (b) << (g + r + a);
+ masks->green_mask = MASK (g) << (r + a);
+ masks->red_mask = MASK (r) << (a);
+ masks->alpha_mask = MASK (a);
+ return;
+#endif
case PIXMAN_TYPE_A:
masks->alpha_mask = MASK (a);
masks->red_mask = 0;