Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ TheIDE and Library: Releases and ChangeLogs » Putting plugin/png on a diet
Putting plugin/png on a diet [message #9961] Mon, 11 June 2007 16:14 Go to next message
guido is currently offline  guido
Messages: 169
Registered: April 2006
Experienced Member
Hi,

libpng is huge and upp doesn't use half of its features.
So currently a lot of "dead" code is linked in.
Fortunately libpng offers fine grained build control, so
we should take advantage of it:

options
	-DPNG_NO_READ_EXPAND,
	-DPNG_NO_READ_SHIFT,
	-DPNG_NO_READ_PACK,
	-DPNG_NO_READ_SWAP,
	-DPNG_NO_READ_PACKSWAP,
	-DPNG_NO_READ_INVERT,
	-DPNG_NO_READ_DITHER,
	-DPNG_NO_READ_BACKGROUND,
	-DPNG_NO_READ_FILLER,
	-DPNG_NO_READ_GAMMA,
	-DPNG_NO_READ_GRAY_TO_RGB,
	-DPNG_NO_READ_SWAP_ALPHA,
	-DPNG_NO_READ_INVERT_ALPHA,
	-DPNG_NO_READ_STRIP_ALPHA,
	-DPNG_NO_READ_USER_TRANSFORM,
	-DPNG_NO_READ_RGB_TO_GRAY,
	-DPNG_NO_PROGRESSIVE_READ,
	-DPNG_NO_READ_COMPOSITE_NODIV,
	-DPNG_NO_MNG_FEATURES,
	-DPNG_NO_READ_EMPTY_PLTE,
	-DPNG_NO_WRITE_SHIFT,
	-DPNG_NO_WRITE_PACK,
	-DPNG_NO_WRITE_SWAP,
	-DPNG_NO_WRITE_PACKSWAP,
	-DPNG_NO_WRITE_INVERT,
	-DPNG_NO_WRITE_FILLER,
	-DPNG_NO_WRITE_SWAP_ALPHA,
	-DPNG_NO_WRITE_INVERT_ALPHA,
	-DPNG_NO_WRITE_USER_TRANSFORM,
	-DPNG_NO_USER_TRANSFORM_PTR,
	-DPNG_NO_WRITE_EMPTY_PLTE,
	-DPNG_NO_EASY_ACCESS,
	-DPNG_NO_READ_bKGD,
	-DPNG_NO_READ_cHRM,
	-DPNG_NO_READ_gAMA,
	-DPNG_NO_READ_iCCP,
	-DPNG_NO_READ_oFFs,
	-DPNG_NO_READ_pCAL,
	-DPNG_NO_READ_sCAL,
	-DPNG_NO_READ_sBIT,
	-DPNG_NO_READ_sPLT,
	-DPNG_NO_READ_sRGB,
	-DPNG_NO_READ_tIME,
	-DPNG_NO_READ_zTXt,
	-DPNG_NO_READ_OPT_PLTE,
	-DPNG_NO_INFO_IMAGE;


Adding above to png.upp reduces executable size by 40k and plugin build time is cut in half (gcc-4.1/optimal).
Plugin overhead thus marginal, I suggest static linking on all platforms. Though libpng can be assumed on X11, ABI stability is a concern.

PS:
The included libpng is quite ancient. Should be replaced with a recent copy. There have been a number of buffer-overruns fixed at least. Also recent versions should be faster due to assembly/mmx routines.


Guido
  • Attachment: png.upp
    (Size: 1.29KB, Downloaded 153 times)
Re: Putting plugin/png on a diet [message #9971 is a reply to message #9961] Mon, 11 June 2007 20:01 Go to previous message
mirek is currently offline  mirek
Messages: 12105
Registered: November 2005
Ultimate Member
Thanks!
Previous Topic: Topic++ integrated into main Ide window...
Next Topic: GridCtrl - fixed text wrapping, added HeaderAlign* methods
Goto Forum:
  


Current Time: Wed Nov 20 08:33:10 CET 2019

Total time taken to generate the page: 0.01215 seconds