• Keith Packard's avatar
    glamor: Fix bad rendering of glyphs after an a1 glyph upload. (v3) · c268d2fc
    Keith Packard authored
    Fixes regressions since Eric's "don't make an FBO for the glyph atlas"
    change.  The a1 upload was a fallback, as 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.
    
    v3: Use CopyPlane to a temp pixmap for the upload
    v4: Rewrite anholt's commit message to be from keithp's perspective
        (changes by anholt)
    Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
    Signed-off-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
    Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
    c268d2fc
glamor_composite_glyphs.c 20.2 KB