OSDN Git Service

load_ora: load png layers faster, use less memory
authorMartin Renold <martinxyz@gmx.ch>
Sun, 20 Nov 2011 01:06:15 +0000 (02:06 +0100)
committerMartin Renold <martinxyz@gmx.ch>
Sun, 20 Nov 2011 14:56:59 +0000 (15:56 +0100)
commitd562b24346de89c0c6c10a9fafaf1d1778276a53
tree197ce859e5a7c8b8789031a7ba73237e90fdfd88
parent629b4f085403ff072402db54ca57c4cdbeca3f4c
load_ora: load png layers faster, use less memory

Use libpng directly (fastpng.hpp) as we already did for saving.
No longer load the full png into a gdk_pixbuf, but load and
convert one tile row at a time.

This should use less temporary memory, especially if lots of
tiles are empty, because we can free them again early.

This should fix https://gna.org/bugs/index.php?17568

Also remove code to recognize solid backgrounds (because it expects
the png to be in a gdk_pixbuf). Rely on the background_tile attribute
instead.

load_ora benchmark: 2.75 --> 2.08
lib/command.py
lib/document.py
lib/fastpng.hpp
lib/layer.py
lib/tiledsurface.py