• Leon Scroggins III's avatar
    Add an option on SkImageDecoder to skip writing 0s. · 34835907
    Leon Scroggins III authored
    Only implemented for PNG.
    
    Add a getter and setter, and sets the default to false in the
    constructor. Also copies the setting in copyFieldsToOther.
    
    Fix an indpendent bug where fDitherImage was not being copied in
    copyFieldsToOther.
    
    In SkScaledBitmapSampler::begin, consolidate the settings passed in
    by passing a const reference to the decoder. The decoder can be
    referenced for its settings of dither, unpremultiplied, and now
    skipping writing zeroes. Update callers to use the new API. In png
    decoder, rather than passing around a pointer to an initial
    read of getDitherImage, and potentially changing it, look at the
    field on the decoder itself, and modify it directly. This is a
    change in behavior - now if that same decoder is used to decode
    a different image, the dither setting has changed. I think this is
    okay because A) the typical use case is to use a new decoder for
    each decode, B) we do not make any promises that a decode does not
    change the decoder a...
    34835907
bench.gypi 2.62 KB