History log of /external/skia/src/images/SkImageDecoder_libjpeg.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
34835907d8ed21079a9ee09e0e16082a98637d42 19-Sep-2013 Leon Scroggins III <scroggo@google.com> Add an option on SkImageDecoder to skip writing 0s.

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 and C) it makes the code in SkScaledBitmapSampler
much cleaner.

In SkScaledBitmapScampler, add new row procs for skipping zeroes. Now
that choosing the row proc has five dimensions (src config, dst config,
dither, skip writing zeroes, unpremultiplied), use a new method: each
src/dst combination has a function for choosing the right proc depending
on the decoder.

SkScaledBitmapScampler::RowProc is now public for convenience.

Remove Sample_Gray_D8888_Unpremul, which is effectively no different
from Sample_Gray_D8888.

In cases where unpremultiplied was trivial, such as 565 and when
sampling from gray, decoding may now succeed.

Add a benchmark (currently disabled) for comparing the speed of skipping
writing zeroes versus not skipping. For this particular image, which is
mostly transparent pixels, normal decoding took about 3.6 milliseconds,
while skipping zeroes in the decode took only about 2.5 milliseconds
(this is on a Nexus 4). Presumably it would be slower on an image
with a small amount of transparency, but there will be no slowdown
for an image which reports that it has no transparency.

In SkImageRef_ashmem, always skip writing zeroes, since ashmem
memory is guaranteed to be initialized to 0.

Add a flag to skip writing zeroes in skimage.

Add a regression test for choosing the rowproc to ensure I did not
change any behavior accidentally.

BUG:10016979
Change-Id: I5986ae750b85a9c9d8e3cafeebe904910247de3b
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
4495d5ff20e5a4923d708fa335371f0c8e9b2752 22-Aug-2013 Leon Scroggins III <scroggo@google.com> Only destroy huffman if build succeeded.

The earlier code assumed that if jpeg_create_huffman_index
succeeded but jpeg_build_huffman_index failed that the
index would still need to be destroyed. This is not the
case. Only call jpeg_destroy_huffman_index if both
succeeded.

BUG=http://b.corp.google.com/issue?id=10263847

Change-Id: I3fbc7ac507ce11134565ebe50bd6be95e276b8e4
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
e27eefc4844477cee5d32f51ab45ff62020cdb36 13-Aug-2013 Derek Sollenberger <djsollen@google.com> Snapshot from http://skia.googlecode.com/svn/trunk@10680

Change-Id: I846e489575859eff43302c698606953c58420671
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
58190644c30e1c4aa8e527f3503c58f841e0fcf3 26-Jul-2013 Derek Sollenberger <djsollen@google.com> Snapshot from http://skia.googlecode.com/svn/trunk@10377

Change-Id: Id35b998cb70e867d14e58c2e794b9a742b1ef6d5
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
7839ce1af63bf12fe7b3caa866970bbbb3afb13d 23-May-2013 Derek Sollenberger <djsollen@google.com> Snapshot from http://skia.googlecode.com/svn/trunk@9231

Change-Id: I384e5f43ceb90b1a2e58a1e33753b3e79c85b949
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
e2022cc36e47b9f0d219eb5cd24be61772c28d3b 03-Apr-2013 Derek Sollenberger <djsollen@google.com> Snapshot from http://skia.googlecode.com/svn/trunk@8352

Change-Id: I09dbe7f21185e6c22f04edbaf46de2f5c620e475
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
d686ac77c2c485c4a3302eda9c1de597a6f8c568 04-Feb-2013 Derek Sollenberger <djsollen@google.com> Snapshot from http://skia.googlecode.com/svn/trunk@7527

Change-Id: I83c7c2152f5d2c303b4655a5a604f513a54f350a
/external/skia/src/images/SkImageDecoder_libjpeg.cpp
80bacfeb4bda06541e8695bd502229727bccfeab 05-Dec-2012 Jean-Baptiste Queru <jbq@google.com> initial snapshot, trunk@5966

Change-Id: I5c9aa88bd82f150da9f5b1152bc2d5aa4baaabb2
/external/skia/src/images/SkImageDecoder_libjpeg.cpp