• msarett's avatar
    Fix performance regression in png encoding caused by libpng update · b43ad19e
    msarett authored
    libpng calculates "filter heuristics" to choose which png
    filter to apply.  Chrome need not calculate these "filter
    heuristics" because we always choose to use the SUB filter,
    for speed.
    
    libpng 1.6 refactors the SUB filter to share code, also
    forcing us to calculate the filter heuristics, even though
    we don't need to.  This caused a performance regression.
    
    This CL cherry picks a fix from upstream that:
    (1) Passes PNG_SIZE_MAX to the filter code.  This allows
    the compiler to optimize out the heuristic calculation
    code, fixing the performance regression.
    (2) Fixes overflow handling in the calculation of filter
    heuristics.  This won't affect Chrome.
    
    BUG=619850
    BUG=599917
    
    Review-Url: https://codereview.chromium.org/2062423002
    Cr-Commit-Position: refs/heads/master@{#401298}
    b43ad19e
libpng.gyp 2.94 KB