top | item 28876277

(no title)

ishitatsuyuki | 4 years ago

Vector graphics are much more complicated than raster images. They have to be drawn sequentially (to not mess up draw and blending order), mostly on CPU with the current software stack. And no, at 30MB you are looking at about 100000 paths, each of which consists of bezier curves which needs to be converted into polylines before drawing (there are algorithms that handles curves directly, but they are just as expensive). It's a vast amount of workload.

Images are relatively well handled with GPUs, and with a precomputed mipmap they can be rescaled very quickly, unlike vector graphics which needs to be re-rendered each time zoom level is changed.

discuss

order

knuthsat|4 years ago

Yeah, handling 100k paths on CPU means the problem is in the PDF reader, not the PDF. Although I must admit that calculating 100000 paths and getting polylines still shouldn't take very long.

Why wouldn't you be able to send an array of stuff defining the curves, and an array of stuff defining the draw order to the gpu and just render it in a simple?