diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-10-18 20:07:12 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2007-11-26 21:24:49 -0800 |
commit | c1464e04c4ae41cb8b353c5a0d18bd5e23ceef39 (patch) | |
tree | a6342b5e9b427ff7fb7a85d4ac2da37209a20732 | |
parent | 2e76f8b617dfad13e16a8bad70db9ff2f8e43db4 (diff) | |
download | cairo-c1464e04c4ae41cb8b353c5a0d18bd5e23ceef39.tar.gz |
[cairo-xlib-surface] Match content to xrender_format using the channel masks.
_xrender_format_to_content() was using the channel offset to determine
whether the format supported a content type.
For example, the XRenderPictFormat for the A8 format looks like:
direct.alpha = 0; direct.alphaMask = 0xff;
direct.red = 0; direct.redMask = 0x00;
direct.green = 0; direct.greenMask = 0x00;
direct.blue = 0; direct.blueMask = 0x00;
which _xrender_format_to_content() matched as CAIRO_CONTENT_COLOR.
Switch to using the channel masks for deducing content type.
(cherry picked from commit 8ae778273799ee9f6d3c13e9c41730daeda2c743)
-rw-r--r-- | src/cairo-xlib-surface.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c index 3e771655a..4fe62ed56 100644 --- a/src/cairo-xlib-surface.c +++ b/src/cairo-xlib-surface.c @@ -195,10 +195,10 @@ _xrender_format_to_content (XRenderPictFormat *xrender_format) if (xrender_format == NULL) return CAIRO_CONTENT_COLOR; - xrender_format_has_alpha = (xrender_format->direct.alpha != 0); - xrender_format_has_color = (xrender_format->direct.red != 0 || - xrender_format->direct.green != 0 || - xrender_format->direct.blue != 0); + xrender_format_has_alpha = (xrender_format->direct.alphaMask != 0); + xrender_format_has_color = (xrender_format->direct.redMask != 0 || + xrender_format->direct.greenMask != 0 || + xrender_format->direct.blueMask != 0); if (xrender_format_has_alpha) if (xrender_format_has_color) |