Bug 556117 - Fix bustage from bug 497056 when building with system libpng. Patch by Mike Hommey <mh+mozilla@glandium.org>, r=glennrp, r=joe, a1.9.0.next=dveditz

git-svn-id: svn://10.0.0.236/trunk@261972 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
alqahira%ardisson.org 2011-02-25 19:51:53 +00:00
parent 6b6337696c
commit 93f3a66ef6

View File

@ -240,7 +240,7 @@ NS_IMETHODIMP nsPNGDecoder::Init(imgILoad *aLoad)
/* Always decode to 24 bit pixdepth */ /* Always decode to 24 bit pixdepth */
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
if (gfxPlatform::GetCMSMode() != eCMSMode_Off) { if (gfxPlatform::IsCMSEnabled()) {
mPNG = png_create_read_struct_2(PNG_LIBPNG_VER_STRING, mPNG = png_create_read_struct_2(PNG_LIBPNG_VER_STRING,
NULL, NULL,
error_callback, error_callback,
@ -277,7 +277,7 @@ NS_IMETHODIMP nsPNGDecoder::Init(imgILoad *aLoad)
# if PNG_LIBPNG_VER < 10401 # if PNG_LIBPNG_VER < 10401
# if defined(PNG_WRITE_SUPPORTED) # if defined(PNG_WRITE_SUPPORTED)
if (gfxPlatform::GetCMSMode() != eCMSMode_Off) { if (gfxPlatform::IsCMSEnabled()) {
/* Increase speed of decompressing large iCCP chunks (default buffer /* Increase speed of decompressing large iCCP chunks (default buffer
size is 8192) */ size is 8192) */
png_set_compression_buffer_size(mPNG, (png_size_t)32768L); png_set_compression_buffer_size(mPNG, (png_size_t)32768L);
@ -704,7 +704,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
#ifdef PNG_USER_MEM_SUPPORTED #ifdef PNG_USER_MEM_SUPPORTED
/* Revert to the default memory allocator */ /* Revert to the default memory allocator */
if (gfxPlatform::GetCMSMode() != eCMSMode_Off) if (gfxPlatform::IsCMSEnabled())
png_set_mem_fn(decoder->mPNG, NULL, NULL, NULL); png_set_mem_fn(decoder->mPNG, NULL, NULL, NULL);
#endif #endif
@ -712,7 +712,7 @@ info_callback(png_structp png_ptr, png_infop info_ptr)
# if PNG_LIBPNG_VER < 10401 # if PNG_LIBPNG_VER < 10401
# if defined(PNG_WRITE_SUPPORTED) # if defined(PNG_WRITE_SUPPORTED)
/* Revert to the default zlib buffer size */ /* Revert to the default zlib buffer size */
if (gfxPlatform::GetCMSMode() != eCMSMode_Off) { if (gfxPlatform::IsCMSEnabled()) {
png_set_compression_buffer_size(decoder->mPNG, (png_size_t)8192); png_set_compression_buffer_size(decoder->mPNG, (png_size_t)8192);
} }
# endif # endif