From 6c08eb4d6f8789e692ef018e007d1ae97a57c25f Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 22 Dec 2011 11:42:39 +0000 Subject: sna/gen2+: Prefer to use the CPU if we have a source alphamap and CPU pictures Signed-off-by: Chris Wilson --- src/sna/gen2_render.c | 8 +++++++- src/sna/gen3_render.c | 8 +++++++- src/sna/gen4_render.c | 8 +++++++- src/sna/gen5_render.c | 8 +++++++- src/sna/gen6_render.c | 8 +++++++- src/sna/gen7_render.c | 8 +++++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index d10f03e6..53accbd1 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1303,10 +1303,16 @@ is_gradient(PicturePtr picture) return picture->pSourcePict->type != SourcePictTypeSolidFill; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return is_gradient(p) || !gen2_check_filter(p) || !gen2_check_repeat(p); + return has_alphamap(p) || is_gradient(p) || !gen2_check_filter(p) || !gen2_check_repeat(p); } static bool diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 4ada863d..1dec2b3a 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2296,10 +2296,16 @@ is_solid(PicturePtr picture) picture->repeat; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return !gen3_check_filter(p->filter) || !gen3_check_repeat(p); + return has_alphamap(p) || !gen3_check_filter(p->filter) || !gen3_check_repeat(p); } static bool diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index aec5ca04..150b7c83 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -1910,10 +1910,16 @@ is_gradient(PicturePtr picture) return picture->pSourcePict->type != SourcePictTypeSolidFill; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return is_gradient(p) || !gen4_check_filter(p) || !gen4_check_repeat(p); + return has_alphamap(p) || is_gradient(p) || !gen4_check_filter(p) || !gen4_check_repeat(p); } static bool diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 6d89ca3a..e1117cc6 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1952,10 +1952,16 @@ is_gradient(PicturePtr picture) return picture->pSourcePict->type != SourcePictTypeSolidFill; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return is_gradient(p) || !gen5_check_filter(p) || !gen5_check_repeat(p); + return has_alphamap(p) || is_gradient(p) || !gen5_check_filter(p) || !gen5_check_repeat(p); } static bool diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index c276f7e8..7d481374 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2127,10 +2127,16 @@ is_gradient(PicturePtr picture) return picture->pSourcePict->type != SourcePictTypeSolidFill; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return is_gradient(p) || !gen6_check_filter(p) || !gen6_check_repeat(p); + return has_alphamap(p) || is_gradient(p) || !gen6_check_filter(p) || !gen6_check_repeat(p); } static bool diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index dc97d181..885a5dcd 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2240,10 +2240,16 @@ is_gradient(PicturePtr picture) return picture->pSourcePict->type != SourcePictTypeSolidFill; } +static bool +has_alphamap(PicturePtr p) +{ + return p->alphaMap != NULL; +} + static bool source_fallback(PicturePtr p) { - return is_gradient(p) || !gen7_check_filter(p) || !gen7_check_repeat(p); + return has_alphamap(p) || is_gradient(p) || !gen7_check_filter(p) || !gen7_check_repeat(p); } static bool -- cgit v1.2.3