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

Eric Anholt eric at anholt.net
Fri Jul 3 10:32:47 PDT 2015


Keith Packard <keithp at keithp.com> writes:

> 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

Reviewed-by: Eric Anholt <eric at anholt.net>

How do you want to handle merging?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150703/2a2ff196/attachment-0001.sig>


More information about the xorg-devel mailing list