Skip to content

Commit

Permalink
Revert "Revert "libpng: update to 1.2.44""
Browse files Browse the repository at this point in the history
This reverts commit r64079. The perf regression turned out not to be the fault
of the libpng change.

BUG=60942

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64243 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
agl@chromium.org committed Oct 28, 2010
1 parent f5aaec3 commit 587b806
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 110 deletions.
6 changes: 3 additions & 3 deletions third_party/libpng/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "png.h"

/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_43 Your_png_h_is_not_version_1_2_43;
typedef version_1_2_44 Your_png_h_is_not_version_1_2_44;

/* Version information for C files. This had better match the version
* string defined in png.h.
Expand Down Expand Up @@ -724,13 +724,13 @@ png_get_copyright(png_structp png_ptr)
#else
#ifdef __STDC__
return ((png_charp) PNG_STRING_NEWLINE \
"libpng version 1.2.43 - February 25, 2010" PNG_STRING_NEWLINE \
"libpng version 1.2.44 - June 26, 2010" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE);
#else
return ((png_charp) "libpng version 1.2.43 - February 25, 2010\
return ((png_charp) "libpng version 1.2.44 - June 26, 2010\
Copyright (c) 1998-2010 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.");
Expand Down
20 changes: 10 additions & 10 deletions third_party/libpng/png.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.43 - February 25, 2010
* libpng version 1.2.44 - June 26, 2010
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
Expand All @@ -10,7 +10,7 @@
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.2.43 - February 25, 2010: Glenn
* libpng versions 0.97, January 1998, through 1.2.44 - June 26, 2010: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
Expand Down Expand Up @@ -293,7 +293,7 @@
*
* This code is released under the libpng license.
*
* libpng versions 1.2.6, August 15, 2004, through 1.2.43, February 25, 2010, are
* libpng versions 1.2.6, August 15, 2004, through 1.2.44, June 26, 2010, are
* Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
Expand Down Expand Up @@ -405,13 +405,13 @@
* Y2K compliance in libpng:
* =========================
*
* February 25, 2010
* June 26, 2010
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.2.43 are Y2K compliant. It is my belief that earlier
* upward through 1.2.44 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
Expand Down Expand Up @@ -467,17 +467,17 @@
*/

/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.43"
#define PNG_LIBPNG_VER_STRING "1.2.44"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.43 - February 25, 2010\n"
" libpng version 1.2.44 - June 26, 2010\n"

#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13

/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 2
#define PNG_LIBPNG_VER_RELEASE 43
#define PNG_LIBPNG_VER_RELEASE 44
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/
Expand Down Expand Up @@ -507,7 +507,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/
#define PNG_LIBPNG_VER 10243 /* 1.2.43 */
#define PNG_LIBPNG_VER 10244 /* 1.2.44 */

#ifndef PNG_VERSION_INFO_ONLY
/* Include the compression library's header */
Expand Down Expand Up @@ -1547,7 +1547,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_2_43;
typedef png_structp version_1_2_44;

typedef png_struct FAR * FAR * png_structpp;

Expand Down
2 changes: 1 addition & 1 deletion third_party/libpng/pngconf.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.2.43 - February 25, 2010
* libpng version 1.2.44 - June 26, 2010
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
Expand Down
73 changes: 37 additions & 36 deletions third_party/libpng/pngpread.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ png_push_read_IDAT(png_structp png_ptr)
save_size = png_ptr->current_buffer_size;

png_calculate_crc(png_ptr, png_ptr->current_buffer_ptr, save_size);

png_process_IDAT_data(png_ptr, png_ptr->current_buffer_ptr, save_size);

png_ptr->idat_size -= save_size;
Expand Down Expand Up @@ -849,6 +850,7 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
!(png_ptr->flags & PNG_FLAG_ZLIB_FINISHED))
{
int ret;

/* We have data for zlib, but we must check that zlib
* has somewhere to put the results. It doesn't matter
* if we don't expect any results -- it may be the input
Expand All @@ -874,50 +876,49 @@ png_process_IDAT_data(png_structp png_ptr, png_bytep buffer,
/* Check for any failure before proceeding. */
if (ret != Z_OK && ret != Z_STREAM_END)
{
/* Terminate the decompression. */
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
/* Terminate the decompression. */
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;

/* This may be a truncated stream (missing or
* damaged end code). Treat that as a warning.
*/
* damaged end code). Treat that as a warning.
*/
if (png_ptr->row_number >= png_ptr->num_rows ||
png_ptr->pass > 6)
png_warning(png_ptr, "Truncated compressed data in IDAT");
else
png_error(png_ptr, "Decompression error in IDAT");
png_ptr->pass > 6)
png_warning(png_ptr, "Truncated compressed data in IDAT");
else
png_error(png_ptr, "Decompression error in IDAT");

/* Skip the check on unprocessed input */
/* Skip the check on unprocessed input */
return;
}

/* Did inflate output any data? */
if (png_ptr->zstream.next_out != png_ptr->row_buf)
{
/* Is this unexpected data after the last row?
* If it is, artificially terminate the LZ output
* here.
*/
/* Is this unexpected data after the last row?
* If it is, artificially terminate the LZ output
* here.
*/
if (png_ptr->row_number >= png_ptr->num_rows ||
png_ptr->pass > 6)
png_ptr->pass > 6)
{
/* Extra data. */
png_warning(png_ptr, "Extra compressed data in IDAT");
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
/* Do no more processing; skip the unprocessed
* input check below.
*/
/* Extra data. */
png_warning(png_ptr, "Extra compressed data in IDAT");
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
/* Do no more processing; skip the unprocessed
* input check below.
*/
return;
}
}

/* Do we have a complete row? */
if (png_ptr->zstream.avail_out == 0)
png_push_process_row(png_ptr);
/* Do we have a complete row? */
if (png_ptr->zstream.avail_out == 0)
png_push_process_row(png_ptr);
}

else
break;
/* And check for the end of the stream. */
if (ret == Z_STREAM_END)
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
png_ptr->flags |= PNG_FLAG_ZLIB_FINISHED;
}

/* All the data should have been processed, if anything
Expand All @@ -941,8 +942,8 @@ png_push_process_row(png_structp png_ptr)
png_ptr->row_info.width);

png_read_filter_row(png_ptr, &(png_ptr->row_info),
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
(int)(png_ptr->row_buf[0]));
png_ptr->row_buf + 1, png_ptr->prev_row + 1,
(int)(png_ptr->row_buf[0]));

png_memcpy_check(png_ptr, png_ptr->prev_row, png_ptr->row_buf,
png_ptr->rowbytes + 1);
Expand All @@ -957,7 +958,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass < 6)
/* old interface (pre-1.0.9):
png_do_read_interlace(&(png_ptr->row_info),
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
png_ptr->row_buf + 1, png_ptr->pass, png_ptr->transformations);
*/
png_do_read_interlace(png_ptr);

Expand Down Expand Up @@ -992,7 +993,7 @@ png_push_process_row(png_structp png_ptr)

if (png_ptr->pass == 6 && png_ptr->height <= 4)
{
png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}

Expand Down Expand Up @@ -1032,7 +1033,7 @@ png_push_process_row(png_structp png_ptr)

for (i = 0; i < 4 && png_ptr->pass == 2; i++)
{
png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}

Expand Down Expand Up @@ -1082,13 +1083,13 @@ png_push_process_row(png_structp png_ptr)

for (i = 0; i < 2 && png_ptr->pass == 4; i++)
{
png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}

if (png_ptr->pass == 6) /* Pass 5 might be empty */
{
png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}

Expand All @@ -1107,7 +1108,7 @@ png_push_process_row(png_structp png_ptr)

if (png_ptr->pass == 6) /* Skip top generated row */
{
png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}

Expand All @@ -1121,7 +1122,7 @@ png_push_process_row(png_structp png_ptr)
if (png_ptr->pass != 6)
break;

png_push_have_row(png_ptr, png_bytep_NULL);
png_push_have_row(png_ptr, png_bytep_NULL);
png_read_push_finish_row(png_ptr);
}
}
Expand Down
Loading

0 comments on commit 587b806

Please sign in to comment.