Re[2]: Drawing a lot of SVG images is slow

Vadim Zeitlin <[email protected]> Wed, 2 Apr 2025 18:24:40 +0200
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
On Wed, 2 Apr 2025 06:36:27 +0200 Quentin Cosendey wrote:

QC> How can I check if I'm always returned the same cached bitmap or not ? / 
QC> if caching works as expected ?

 There is no simple way to do it, unfortunately. I'd probably just use the
debugger to check that the bitmaps are not re-rendered, but it might be a
better idea to add some logging to this code.

QC> I'll check that, but I don't think wxBitmapBundle allows that easily. If 
QC> it effectively doesn't, probably that I should try to find another way 
QC> to draw my SVG images.

 You can do caching outside of wxBitmapBundle too.

QC> QC> Isn't there a more direct way to draw SVG images ?
QC> VZ>  Not currently, no.
QC> 
QC> OK, sad! Is rasterization an obligation ?

 Yes, of course, you need to turn vector graphics into pixels.

QC> Would it be technically possible and interesting to translate directly 
QC> from SVG commands to wxGraphicsContext or DC calls on the window, 
QC> without drawing first to an intermediate bitmap ? Sorry for the newbie 
QC> question.

 It would, but it still would be much slower than just rasterizing to a
bitmap once and then simply blitting it to the screen, so it's not really
interesting.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
              https://www.tt-solutions.com/
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCZ+1kyAAKCRAG6kHeT2we
hhgbAJ9XwCs/N1jbYd9aoBYX/qkq4OTI/wCeLykO1XVJhBpjQt4Oghutel+WDQE=
=+cgv
-----END PGP SIGNATURE-----