summaryrefslogtreecommitdiff
path: root/uxa/uxa-glyphs.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-30 17:49:19 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-30 17:49:19 +0000
commit5c45622b889ba66b6476241601e1458d219c45ba (patch)
tree22d50b63e4dbe79abd73fcc3a94b52db2e24e6cb /uxa/uxa-glyphs.c
parente6eb803cb44b01e300fb4b08304227a430912beb (diff)
uxa/glyphs: Fallback rather than fail to render with a non-solid Source
Reported-by: Uli Schlachter <psychon@znc.in> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31819 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'uxa/uxa-glyphs.c')
-rw-r--r--uxa/uxa-glyphs.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 7b2edea4..6c9ea0d6 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -1033,6 +1033,19 @@ next_glyph:
return 0;
}
+static Bool
+is_solid(PicturePtr picture)
+{
+ if (picture->pSourcePict) {
+ SourcePict *source = picture->pSourcePict;
+ return source->type == SourcePictTypeSolidFill;
+ } else {
+ return (picture->repeat &&
+ picture->pDrawable->width == 1 &&
+ picture->pDrawable->height == 1);
+ }
+}
+
void
uxa_glyphs(CARD8 op,
PicturePtr pSrc,
@@ -1053,7 +1066,9 @@ uxa_glyphs(CARD8 op,
uxa_screen->swappedOut ||
uxa_screen->force_fallback ||
!uxa_drawable_is_offscreen(pDst->pDrawable) ||
- pDst->alphaMap || pSrc->alphaMap) {
+ pDst->alphaMap || pSrc->alphaMap ||
+ /* XXX we fail to handle (rare) non-solid sources correctly. */
+ !is_solid(pSrc)) {
fallback:
uxa_check_glyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
return;