[PATCH 1/2] glamor: Fix bad rendering of glyphs after an a1 glyph upload.

Keith Packard keithp at keithp.com
Thu Jul 2 16:18:48 PDT 2015


Eric Anholt <eric at anholt.net> writes:

> Fixes regressions since my "don't make an FBO for the glyph atlas"
> change.  The a1 upload was a fallback, as I expected.  However,
> fallback reads use glReadPixels() because there's no
> glGetTexSubImage2D() to match glTexSubImage2D().  We were just binding
> the 0 FBO value, so the glReadPixels() would throw a GL error instead
> of getting any data.  After the fallback was done we'd write back the
> undefined data to the atlas, blowing away the entire rest of the atlas
> because we didn't specify any bounds on our prepare.
>
> To fix the fallbacks to actually work, we'd need a prepare path that
> allocates some memory memory do a full glGetTexImage() into, then
> memcpy out of that.  Instead, just dodge the general fallback by
> implementing the specific upload we need to do here, which should also
> be *much* faster at uploading a1 glyphs since it's not
> readpixels/texsubimaging back and forth.
>
> Signed-off-by: Eric Anholt <eric at anholt.net>

Nice fix. However, it's doing a CopyPlane operation by hand, making it
LSB-specific. A shorter version just creates a temporary 8bpp CPU pixmap,
uses CopyPlane to get the glyph into that and uploads from there.

This works for me on ephyr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-glamor-Fix-bad-rendering-of-glyphs-after-an-a1-glyph.patch
Type: text/x-diff
Size: 4875 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150702/7d436ffb/attachment.patch>
-------------- next part --------------

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 810 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150702/7d436ffb/attachment.sig>


More information about the xorg-devel mailing list