diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-28 10:59:23 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-28 11:25:47 +0100 |
commit | e979d32bb71fef7341ceb9c2b2e80c6dfa50a7b3 (patch) | |
tree | 3d0e6bff54462f663b78fd6327f036151bd63c33 /src/sna/gen3_render.c | |
parent | 541f816815e392db9e798d2f940029d82a6b2e0b (diff) |
sna/gen2+: Consider precision in render operation placement
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66297
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen3_render.c')
-rw-r--r-- | src/sna/gen3_render.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 13a46d3c..8d65e6e8 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3307,11 +3307,30 @@ source_is_busy(PixmapPtr pixmap) } static bool -source_fallback(PicturePtr p, PixmapPtr pixmap) +is_unhandled_gradient(PicturePtr picture, bool precise) +{ + if (picture->pDrawable) + return false; + + switch (picture->pSourcePict->type) { + case SourcePictTypeSolidFill: + case SourcePictTypeLinear: + case SourcePictTypeRadial: + return false; + default: + return precise; + } +} + +static bool +source_fallback(PicturePtr p, PixmapPtr pixmap, bool precise) { if (sna_picture_is_solid(p, NULL)) return false; + if (is_unhandled_gradient(p, precise)) + return true; + if (!gen3_check_xformat(p) || !gen3_check_repeat(p)) return true; @@ -3342,11 +3361,13 @@ gen3_composite_fallback(struct sna *sna, dst_pixmap = get_drawable_pixmap(dst->pDrawable); src_pixmap = src->pDrawable ? get_drawable_pixmap(src->pDrawable) : NULL; - src_fallback = source_fallback(src, src_pixmap); + src_fallback = source_fallback(src, src_pixmap, + dst->polyMode == PolyModePrecise); if (mask) { mask_pixmap = mask->pDrawable ? get_drawable_pixmap(mask->pDrawable) : NULL; - mask_fallback = source_fallback(mask, mask_pixmap); + mask_fallback = source_fallback(mask, mask_pixmap, + dst->polyMode == PolyModePrecise); } else { mask_pixmap = NULL; mask_fallback = false; |