[fpc-devel] Patch, font rendering on Arm-Linux devices.
Bernd Mueller
mueller.b at gmx.net
Tue Feb 26 16:37:54 CET 2008
Daniël Mantione wrote:
>
>
> Op Tue, 26 Feb 2008, schreef Bernd Mueller:
>
>> Daniël Mantione wrote:
>>>
>>>
>>> Op Tue, 26 Feb 2008, schreef Florian Klaempfl:
>>>
>>>> Daniël Mantione schrieb:
>>>>>
>>>>>
>>>>> Op Tue, 26 Feb 2008, schreef Vincent Snijders:
>>>>>
>>>>>> Bernd Mueller schreef:
>>>>>>> Hello,
>>>>>>>
>>>>>>> the attached patch avoids misaligned data access (bus errors),
>>>>>>> during
>>>>>>> font rendering (with the graph unit) on Arm-Linux devices.
>>>>>>>
>>>>>>
>>>>>> Instead of testing for arm cpu, you could use
>>>>>> FPC_REQUIRES_PROPER_ALIGNMENT too. So it is fixed for sparc as well.
>>>>>
>>>>> Well, packed records are usually used when speed is unimportant. If
>>>>> the
>>>>
>>>> Isn't this used to read a font file?
>>>
>>> You are right. Therefore, the "unaligned" pseudo function is the
>>> proper solution.
>>
>> the main affected routines are unpack and decode. Both routines were
>> called for every single character (only for a stroked font) via
>> OutTextXYDefault. So speed is not unimportant ;-)
>
> Loosing a few clock cycles per character is completely acceptable, and
> even the right engineering decision regarding size/memory trade-off. It
> would be different if it would be a few clock cycles per pixel. Anyway,
> the BGI font file format cannot be changed, so in such case the internal
> data structures would need to be different from the ones on disk. Not
> worth the effort.
The affected TStroke-Record has nothing to do with the BGI font file
format. I would not consider this a patch BTW, if you have to change the
CHR font file format to make it work.
I usually make my engineering decisions on facts and benchmarks. The
(very unexpected) result of this benchmark is, that a version with
leaving the TStroke-Record packed, is about 13 % faster than the
original patch. I am going to send a new patch soon.
Regards, Bernd.
More information about the fpc-devel
mailing list