The 64bit Delphi compiler struggles with optimizing the PNG color+alpha loop. By moving it to an extra function, the CPU register usage is much better. The new functions also processes 4 pixels in each loop iteration, improving the speed further.
Furthermore, this patch changes the TImageElement and TFeImageElement Draw method to convert the base64 stream to a PNG once and then use the fImage field to paint it instead of doing the conversion every time the image element has to be painted.
The 64bit Delphi compiler struggles with optimizing the PNG color+alpha loop. By moving it to an extra function, the CPU register usage is much better. The new functions also processes 4 pixels in each loop iteration, improving the speed further.
Furthermore, this patch changes the TImageElement and TFeImageElement Draw method to convert the base64 stream to a PNG once and then use the fImage field to paint it instead of doing the conversion every time the image element has to be painted.