GNU bug report logs -
#37755
Logic in init_fringe_bitmap should be moved to backends (maybe rif->define_fringe_bitmap)
Previous Next
Reported by: Carlos Pita <carlosjosepita <at> gmail.com>
Date: Tue, 15 Oct 2019 02:31:02 UTC
Severity: normal
Tags: patch
Done: Carlos Pita <carlosjosepita <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Ok, I found the bug. The init part was in general iterating along bits
by advancing the pointer (i.e. bits++). When I juxtaposed this part to
the define part, that also used bits, then bits was pointing to one
past the end of the bitmap and not to the bitmap itself, as expected
by the define code. Once diagnosed, it was an easy fix. In detail:
1. For Cairo, I followed my own suggestion above of not modifying bits
at all. Both the previous init and define loops are now merged into a
single loop that directly writes to the surface data, instead of
modifying bits.
2. For X11, bits is the only state propagated between init/define and
draw and there was no specific define part before my changes, so the
new define is simply the old init. Here bits is obviously modified in
order to prepare it for the drawing routine.
3. For Win32, I replaced bits++ with bits[i]. Bits is also modified,
although here it's easy to avoid that if so desired because it's only
locally needed to initialize the platform-specific bitmap structure
then used by the drawing routine.
4. For MacOS/NS, there is nothing to be done since there was no
specific init part, as I observed a few posts above.
I've cursorily tested this patch both alone and merged with my "hidpi
fringe" patches and seems to be working fine for the Cairo backend.
The new change amounts to yet another code simplification and an
overall ~40 reduction in LOCs.
Best regards
--
Carlos
[0001-Fringe-refactor-move-platform-specific-code-into-rif.patch (text/x-patch, attachment)]
This bug report was last modified 5 years and 206 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.