We only support alpha maps for BITS images, so it's always to ignore
the alpha map for non-BITS image. This makes it possible get rid of
the check for SOLID images since it will now be subsumed by the check
for FAST_PATH_NO_ALPHA_MAP.

Opaque masks are reduced to NULL images in pixman.c, and those can
also safely be treated as not having an alpha map, so set the
FAST_PATH_NO_ALPHA_MAP bit for those as well.
---
 pixman/pixman-image.c | 6 ++++--
 pixman/pixman-noop.c  | 3 +--
 pixman/pixman.c       | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/pixman/pixman-image.c b/pixman/pixman-image.c
index ebf55cd..78c8610 100644
--- a/pixman/pixman-image.c
+++ b/pixman/pixman-image.c
@@ -502,8 +502,10 @@ compute_image_info (pixman_image_t *image)
        break;
     }
 
-    /* Alpha map */
-    if (!image->common.alpha_map)
+    /* Alpha maps are only supported for BITS images, so it's always
+     * safe to ignore their presense for non-BITS images
+     */
+    if (!image->common.alpha_map || image->type != BITS)
     {
        flags |= FAST_PATH_NO_ALPHA_MAP;
     }
diff --git a/pixman/pixman-noop.c b/pixman/pixman-noop.c
index 955e9c8..6afd4b9 100644
--- a/pixman/pixman-noop.c
+++ b/pixman/pixman-noop.c
@@ -78,8 +78,7 @@ noop_src_iter_init (pixman_implementation_t *imp, 
pixman_iter_t *iter)
        iter->get_scanline = _pixman_iter_get_scanline_noop;
     }
     else if (image->common.extended_format_code == PIXMAN_solid                
&&
-            (iter->image->type == SOLID ||
-             (iter->image_flags & FAST_PATH_NO_ALPHA_MAP)))
+            (iter->image_flags & FAST_PATH_NO_ALPHA_MAP))
     {
        if (iter->iter_flags & ITER_NARROW)
        {
diff --git a/pixman/pixman.c b/pixman/pixman.c
index 184f0c4..9555cea 100644
--- a/pixman/pixman.c
+++ b/pixman/pixman.c
@@ -605,7 +605,7 @@ pixman_image_composite32 (pixman_op_t      op,
     else
     {
        mask_format = PIXMAN_null;
-       info.mask_flags = FAST_PATH_IS_OPAQUE;
+       info.mask_flags = FAST_PATH_IS_OPAQUE | FAST_PATH_NO_ALPHA_MAP;
     }
 
     dest_format = dest->common.extended_format_code;
-- 
1.7.11.7

_______________________________________________
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to