summaryrefslogtreecommitdiff
path: root/src/dicache.c
AgeCommit message (Collapse)Author
2024-07-27Add SVG support for currentColorRodrigo Arias Mallo
The currentColor special value for the fill and stroke attributes allows an image to follow the same foreground color of the surounding text.
2024-07-26Merge SVG support from mobilized Dillo forkRodrigo Arias Mallo
Uses the nanosvg library to add SVG support. See: https://www.toomanyatoms.com/software/mobilized_dillo.html Authored-By: dogma
2024-03-09Use Doxygen comments for C filesRodrigo Arias Mallo
2016-05-11Silenced a few old debug messages.Jorge Arellano Cid
2014-06-24Reimplemented the Dicache using dlib ADTsJorge Arellano Cid
For a long time it had a custom ADT with a list of nodes and each node a linked list (with pointers). The last memory bug motivated me to try to normalize it to use dlib. Now, it got simpler, shorter, and possibly faster (although conversion wasn't a simple task). PD: It also uses less memory now.
2014-06-24Moved dicache entry removal to a_Dicache_cleanup()Jorge Arellano Cid
This allows keeping the decompressed image entry until a_Dicache_cleanup() removes it. With the added SurvCleanup variable that controls how many cleanup passes the entry is kept, it is now possible to tune the dicache. For instance: SurvCleanup=0 same as without patch (negligible difference). SurvCleanup=1 allows Back and Forward reuse entries for adjacent pages. SurvCleanup=2 all the above, plus one more pass of lifetime. The default is SurvCleanup=3 (experimental). Example: If you read a newspaper with lots of images, this caching allows to click an article, read it, and go back *quickly* using the same tab. It is experimental because there may be other simple approaches that serve well/better these kind of usage patterns.
2014-06-21Ensure png, jpeg and gif decoders don't use DilloImage after set_parms()Jorge Arellano Cid
This allows reuse of the dicache entry after repush changes DilloImage.
2014-06-19Fixed a potential problem in a_Dicache_unref()Jorge Arellano Cid
Currently I see no way to hit the condition, but better safe than sorry.
2014-06-19Avoid a memory leak at exit timeJorge Arellano Cid
Useful to avoid "false positives" with valgrind.
2014-06-07Fixed an "invalid read" in dicache (detected with valgrind)Jorge Arellano Cid
Invalid read of size 8 at 0x426066: a_Dicache_cleanup (dicache.c:557) by 0x42421C: Cache_process_queue (cache.c:1261) by 0x42424B: Cache_delayed_process_queue_callback (cache.c:1278) Address 0x83ea120 is 96 bytes inside a block of size 104 free'd at 0x4C2870C: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x44CC43: dFree (dlib.c:68) by 0x42552D: Dicache_remove (dicache.c:207) Simple way to reproduce it: Load an html page with a single image, isolate image in new tab, reload the raw image, close html tab, go for bookmarks, exit.
2014-05-14Avoid removing imgbuf and decoding the whole image again for reloads.Jorge Arellano Cid
Using the same testing files as the previous patch, the results are: .---------------------------------------------. |imgbufs | No patch | Patch #1 | Patch #2 | |---------------------------------------------- |1imgA.html | 2/1 | 1/1 | 1/0 | |2imgSA.html | 3/2 | 1/2 | 1/0 | |3imgSA.html | 4/3 | 1/3 | 1/0 | |---------------------------------------------- |2imgA.html | 4/2 | 2/2 | 2/0 | |3imgA.html | 6/3 | 3/3 | 3/0 | '---------------------------------------------' n1/n2 means: n1 imgbufs were created for first load (empty cache) n2 imgbufs were created for reload (cached image) Notes: * Rendering is much faster. Easy to notice with Back operation. * Between four to five times on www.welt.de. * Corner cases can be more than ten times. Usually, it *feels* faster.
2014-05-14Avoid creation of unnecessary image bufs (at alt-text to img switch)Jorge Arellano Cid
This is the first of a patch series for image code bugs that have severe impact on performance. With these testing files: 1imgA.html = <img src="maj00s.png" alt="img1"> 2imgSA.html = <img src="maj00s.png" alt="img1"> <img src="maj00s.png" alt="img12"> 3imgSA.html = <img src="maj00s.png" alt="img1"> <img src="maj00s.png" alt="img12"> <img src="maj00s.png" alt="img123"> 2imgA.html = <img src="maj00s.png" alt="img1"> <img src="maj21s.png" alt="img12"> 3imgA.html = <img src="maj00s.png" alt="img1"> <img src="maj21s.png" alt="img12"> <img src="c10s.png" alt="img123"> This are the results: .------------------------------------------------------------------. |imgbufs | No patch | Patched #1 | | | first time | upon reload | first time | upon reload | |------------------------------------------------------------------- |1imgA.html | 2 | 1 | 1 | 1 | |2imgSA.html | 3 | 2 | 1 | 2 | |3imgSA.html | 4 | 3 | 1 | 3 | |------------------------------------------------------------------- |2imgA.html | 4 | 2 | 2 | 2 | |3imgA.html | 6 | 3 | 3 | 3 | '------------------------------------------------------------------'
2013-11-19Toplevel images work now.Sebastian Geerken
2013-10-22Extended ImgRenderer; new option (in the code) for drawing background images ↵Sebastian Geerken
at once.
2013-09-10Some refactoring: the image decoding code now only accesses ↵Sebastian Geerken
dw::core::ImgRenderer, not dw::Image (which now implements the former) anymore.
2013-06-17Added gamma correction value to dw::core::ImgBuf.Sebastian Geerken
2013-01-12clean up struct typedefsp37sitdu, corvid
2010-03-18some remove_fast at freeall() timecorvid
2009-11-11functions needn't be publicly visiblecorvid
2009-07-23standardise on returning 1 for error exit()scorvid
2009-06-22remove system includescorvid
2009-05-10Fix a memory leak with DilloImage structuresHofmann Johannes
2009-05-08Fix a memory leak when stopping an image-decoding processJorge Arellano Cid
2009-05-07Cleanup in a_Image_new() signatureJeremy Henty
2009-04-28Regression fix: make scaled multiscan images work again.corvid
2009-04-23Remove unused parameter in a_Dicache_write()corvid
2009-03-06remove bg_color dillorc optionJohannes Hofmann
To set a custom background color add a line like: body {background-color: white} to your ~/.dillo/style.css file. This also works for plain text display and image viewing.
2009-02-09whitespace cleanup: 's/ +$//g'Jorge Arellano Cid
2009-02-05Removed the cache.h include fromm dicache.ccorvid
2009-01-31Removed an unused variable in DicEntry structureJorge Arellano Cid
2009-01-31Set dicache as MIME dispatcher for image/{gif,jpg,png}. +refactor and cleanupsJorge Arellano Cid
2009-01-14Make now-unused debug messages silent.Jorge Arellano Cid
2009-01-09mergeJohannes Hofmann
2009-01-09Backed out changeset abdae95b1c9eJohannes Hofmann
The optimization was causing crashes.
2009-01-05Fix a segfault with a debug MSG.Jorge Arellano Cid
2009-01-05 These optimizations are for repeated images in a page.Jorge Arellano Cid
1.- Every repeated cache-served-image is decoded. The patch adds an extra reference to the dicache entry, so only one of them is decoded, and the imgbuf deletion is left to a_Dicache_cleanup. 2.- Every repeated cache-served-image call copyRow for each row. The patch avoids that. This is common with small images (e.g. bullets), but the overhead may be not worth the patch...
2009-01-04Debugging aids.Jorge Arellano Cid
2009-01-03[mq]: dicache-cleanup7Jorge Arellano Cid
2009-01-02imported patch dicache-cleanup6Jorge Arellano Cid
2009-01-01imported patch dicache-cleanup5Jorge Arellano Cid
2009-01-01[mq]: dicache-cleanup4Jorge Arellano Cid
2008-12-29imported patch dicache-cleanup3Jorge Arellano Cid
2008-12-29imported patch dicache-cleanup2Jorge Arellano Cid
2008-12-27[mq]: dicache-cleanup1Jorge Arellano Cid
2008-12-25Started code cleanup of the image code mainly in dicache.c. part#1Jorge Arellano Cid
2008-09-30- s/todo:/TODO:/gjcid
2008-09-14- Made several cleanups according to compiler warnings with "-W -Wall".jcid
2008-06-18- Minor cleanups.jcid
2008-01-16 - Added support for progressive display of progressive jpegs.jcid
- Fixed progressive display of interlaced pngs.
2007-11-05Updated copyright linesjcid