summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-01-13 13:05:32 +0100
committerMichel Dänzer <daenzer@vmware.com>2009-01-13 13:05:32 +0100
commit639f289dcdbe00a516820f573c01a8339e120ed4 (patch)
tree8c41776c97a4a08709ce2f4da1dd6882046c8bbf
parentf4e00b783d3f824058a5f140e6462142688f5116 (diff)
EXA: Declare glyph cache picture as component-alpha when necessary.
Without this, rendering component-alpha glyphs may break without a mask. Fixes http://bugs.freedesktop.org/show_bug.cgi?id=19233 .
-rw-r--r--exa/exa_glyphs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 169763f76..688081dde 100644
--- a/exa/exa_glyphs.c
+++ b/exa/exa_glyphs.c
@@ -140,6 +140,8 @@ exaUnrealizeGlyphCaches(ScreenPtr pScreen,
140 } 140 }
141} 141}
142 142
143#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
144
143/* All caches for a single format share a single pixmap for glyph storage, 145/* All caches for a single format share a single pixmap for glyph storage,
144 * allowing mixing glyphs of different sizes without paying a penalty 146 * allowing mixing glyphs of different sizes without paying a penalty
145 * for switching between source pixmaps. (Note that for a size of font 147 * for switching between source pixmaps. (Note that for a size of font
@@ -159,6 +161,7 @@ exaRealizeGlyphCaches(ScreenPtr pScreen,
159 PictFormatPtr pPictFormat; 161 PictFormatPtr pPictFormat;
160 PixmapPtr pPixmap; 162 PixmapPtr pPixmap;
161 PicturePtr pPicture; 163 PicturePtr pPicture;
164 CARD32 component_alpha;
162 int height; 165 int height;
163 int i; 166 int i;
164 int error; 167 int error;
@@ -191,8 +194,10 @@ exaRealizeGlyphCaches(ScreenPtr pScreen,
191 if (!pPixmap) 194 if (!pPixmap)
192 return FALSE; 195 return FALSE;
193 196
197 component_alpha = NeedsComponent(pPictFormat->format);
194 pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat, 198 pPicture = CreatePicture(0, &pPixmap->drawable, pPictFormat,
195 0, 0, serverClient, &error); 199 CPComponentAlpha, &component_alpha, serverClient,
200 &error);
196 201
197 (*pScreen->DestroyPixmap) (pPixmap); /* picture holds a refcount */ 202 (*pScreen->DestroyPixmap) (pPixmap); /* picture holds a refcount */
198 203
@@ -741,8 +746,6 @@ exaGlyphsIntersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs)
741 return FALSE; 746 return FALSE;
742} 747}
743 748
744#define NeedsComponent(f) (PICT_FORMAT_A(f) != 0 && PICT_FORMAT_RGB(f) != 0)
745
746void 749void
747exaGlyphs (CARD8 op, 750exaGlyphs (CARD8 op,
748 PicturePtr pSrc, 751 PicturePtr pSrc,