History log of /external/skia/src/images/SkImageDecoder_libpng.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
af1d4f84b8730781cc6dca61748cae66c237ca57 16-Oct-2014 Leon Scroggins III <scroggo@google.com> Qualify the return value of SkImageDecoder::decode

Cherry-pick of https://codereview.chromium.org/658343003/ in Skia.

Add a new enum to differentiate between a complete decode and a
partial decode (with the third value being failure). Return this
value from SkImageDecoder::onDecode (in all subclasses, plus
SkImageDecoder_empty) and ::decode.

For convenience, if the enum is treated as a boolean, success and
partial success are both considered true.

Note that the static helper functions (DecodeFile etc) still return
true and false (for one thing, this allows us to continue to use
SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in
SkPicture::CreateFromStream).

Also correctly report failure in SkASTCImageDecoder::onDecode when
SkTextureCompressor::DecompressBufferFromFormat fails.

BUG=skia:3037
BUG:17419670

Conflicts:
src/images/SkImageDecoder_astc.cpp
src/images/SkImageDecoder_ktx.cpp
src/images/SkImageDecoder_libjpeg.cpp
src/images/SkImageDecoder_pkm.cpp

Change-Id: I33e6940e247b74b20361ae041f8d36eb600df49f
/external/skia/src/images/SkImageDecoder_libpng.cpp
f0400173c334b6934ebf81875ad5ed8517078a9d 25-Jul-2014 Leon Scroggins III <scroggo@google.com> Fix image decoder memory overwrite bug.

In SkPNGImageDecoder::onDecodeSubset, use png_read_rows to write to
the scratch memory provided. This is what we should have been doing
anyway. Further, writing directly to the bitmap can cause writing
to the wrong memory since the bitmap may not be as big as the
scratch memory in the case of sampling with a short bitmap.

Cherry-pick of https://codereview.chromium.org/423473003/

BUG:13921093
Change-Id: Id113453f192257fc674b94c4b76e109fb2599d77
/external/skia/src/images/SkImageDecoder_libpng.cpp
0689d7b12e7c427a077b003d3d8ae759d86f798f 14-Jun-2014 reed <reed@chromium.org> stop using SkBitmap::Config

R=scroggo@google.com

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/338493005
/external/skia/src/images/SkImageDecoder_libpng.cpp
5926b86b90c68bffefbdc8639e41b5bc9102cec6 11-Jun-2014 reed <reed@google.com> hide SkImageDecoder::Chooser

BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/331433003
/external/skia/src/images/SkImageDecoder_libpng.cpp
6c22573edb234ad14df947278cfed010669a39a7 10-Jun-2014 reed <reed@chromium.org> hide SkBitmap::setConfig

patch from issue 325733002

TBR=scroggo

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/322963002
/external/skia/src/images/SkImageDecoder_libpng.cpp
446cf71426745b5e367e951c467058764882429d 19-Feb-2014 djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix issue in image decoders where the bitmap config was not properly set.

R=scroggo@google.com

Review URL: https://codereview.chromium.org/167763003

git-svn-id: http://skia.googlecode.com/svn/trunk@13503 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
57212f9469c8056bab3c85243dbb904e386eab95 30-Dec-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Revert of https://codereview.chromium.org/113823003/"

This reverts commit 68b4b32066ea0ba9dbb5d326a836f8a54297b7aa.

BUG=

Review URL: https://codereview.chromium.org/122293002

git-svn-id: http://skia.googlecode.com/svn/trunk@12842 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
5401cd019b5a355bdc20f0846e50a641f45e03c2 12-Nov-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Clean up after longjmp in SkImageDecoder_libpng.

In onDecodeInit, if longjmp sends us back to setjmp, destroy the
png_struct and info_ptr before returning false. Since the
PNGAutoClean has not been created yet, we were previously
leaking resources.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/68453006

git-svn-id: http://skia.googlecode.com/svn/trunk@12244 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
feeca3c7c21423f9189e9100aad4ca7397e9728d 12-Nov-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Create nonPOD before setjmp.

With PNGAutoClean created after setjmp, when longjmp is called its destructor
is never called. Create it before setjmp, ensuring that its destructor is
called.

R=mtklein@google.com

Review URL: https://codereview.chromium.org/65283002

git-svn-id: http://skia.googlecode.com/svn/trunk@12238 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
4469938e92d779dff05e745559e67907bbf21e78 31-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning""

This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d.

BUG=

Review URL: https://codereview.chromium.org/54603004

git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
5ee18dd20192d020884a95c7991c63ce33af3137 21-Oct-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Image decoder fixes (mostly) around A8.

Opaquness:
When decoding Gray to A8 in libpng, set reallyHasAlpha to true
and add a comment why we do not check for the real answer.

Add comments in jpeg decoder explaining why A8 is not opaque.

Fix a bug where an A8 subset is considered to be opaque.

Other fixes:
In SkJPEGImageDecoder, only allocate as much memory as
needed for each source row, based on the input config.
Also pull out common code into a static function.

When performing the check for requiring unpremultiplied colors,
allow A8 to succeed, since that setting should have no effect on
A8.

Add the check for requiring unpremultiplied colors to subset
decoding.

Fix a bug where attempting to sample gray to A8 does not sample.

R=reed@google.com

Review URL: https://codereview.chromium.org/26210007

git-svn-id: http://skia.googlecode.com/svn/trunk@11897 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
383a697692cf46951fd451f6f4c3d03634a6a1cb 21-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> store SkAlphaType inside SkBitmap, on road to support unpremul

BUG=
R=bsalomon@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/25275004

git-svn-id: http://skia.googlecode.com/svn/trunk@11877 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
2a10318814fa9f2dd70122bf58d994b19bb9a8cf 14-Oct-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Simplify code for configuring suppression of ImageDecoder warnings

For images.png.suppressDecoderWarnings and
images.jpeg.suppressDecoderWarnings, the default behavior is now:

Debug - DON'T suppress
Developer Release - suppress
Release - suppress

This behavior can be changed in Debug and in Developer through
the SkRTConf mechanism.

BUG=skia:1680
R=caryclark@google.com

Review URL: https://codereview.chromium.org/26863003

git-svn-id: http://skia.googlecode.com/svn/trunk@11749 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
0a6151d66cc32d91eca037c91e557158cf8a2be2 10-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Revert "change SkColorTable to be immutable""

This reverts commit b8162cb840f4cb6002ef68d5ac775c6a122c52a9.

Fixed was call-sites in benches that used the (now gone) setIsOpaque api.

R=scroggo@google.com

Review URL: https://codereview.chromium.org/26572006

git-svn-id: http://skia.googlecode.com/svn/trunk@11695 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
48d9ff5b3475ad4b345fae35e1ce36b34069691b 09-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "change SkColorTable to be immutable"

This reverts commit 1c0ff422868b3badf5ffe0790a5d051d1896e2f7.

BUG=

Review URL: https://codereview.chromium.org/26709002

git-svn-id: http://skia.googlecode.com/svn/trunk@11677 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
9864c24e40448ef64b1fe367eee1d63a872e51b8 09-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> change SkColorTable to be immutable

BUG=
R=scroggo@google.com

Review URL: https://codereview.chromium.org/25353002

git-svn-id: http://skia.googlecode.com/svn/trunk@11676 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
fed3037217e51ecd2fcd794a4d35fc7f689dd23d 04-Oct-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make image decoding more fault resistant, less verbose.

This change address what happens when a jpeg is partially downloaded
before failing. Many browsers will render it anyway: we want Skia to
do the same. The JpegTest takes a perfectly cromulent jpeg file and
only passes into the ImageDecoder the first half of the image. We
then verify that the image decoder returns a valid bitmap of the
correct dimensions.

We also fixed some png library errors, including issue 1691.

Also, suppressed the majority of warnings from using libpng and
libjpeg. By default, most warnings are *not* suppressed in debug mode.
If you have a debug binary and wish to suppress warnings, set the
following environment variables to true
skia_images_png_suppressDecoderWarnings
skia_images_jpeg_suppressDecoderWarnings
or from within a program that links to Skia:
#if defined(SK_DEBUG)
#include "SkRTConf.h"
SK_CONF_SET("images.jpeg.suppressDecoderWarnings", true);
SK_CONF_SET("images.png.suppressDecoderWarnings", true);
#endif

I tested this, before (control) and after these changes (test), on
364,295 skps from the cluster telemetry.
- number of errors+warnings in control = 2804
- number of errors+warnings fixed = 2283
- number of PNG verbosity fixed = 2152
- number of PNG error fixed = 4
- number of PNG segfault fixed = 3
- number of PNG errors changed to warnings = 62
- number of JPG verbosity fixed = 26
- number of JPG error fixed = 91
Not all errors and warning have been fixed.

These numbers were generated using the find_bad_images_in_skps.py
program. This program may be useful going forward for testing
image-decoding libraries on skp files from the cluster telemetry.
find_bad_images_in_skps.py depends on the test_image_decoder program,
which simply executes the SkImageDecoder::DecodeFile function and uses
its exit status to report success or failure.

BUG=skia:1649
BUG=skia:1691
BUG=skia:1680
R=scroggo@google.com

Review URL: https://codereview.chromium.org/24449003

git-svn-id: http://skia.googlecode.com/svn/trunk@11597 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
546f70c82318d2fcdd9718966907d1edccd26cb6 03-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixes for decoding to A8.

src/images/SkImageDecoder_libpng.cpp:
A8 images are not opaque, so do not set the opaque flag.
This fixes a bug where copyTo does not work as expected (when
copying an A8 decoded image to ARGB_8888), leading to
a bitmap hash that does not represent the image correctly
(in skimage).

tools/skimage_main.cpp:
In write_bitmap, which is creating the image for visual comparison,
copy A8 to 8888, since A8 cannot be encoded.

In the section that tests reencoding, do not test reencoding A8,
which is known to not work.

R=mtklein@google.com, djsollen@google.com

Author: scroggo@google.com

Review URL: https://codereview.chromium.org/25726004

git-svn-id: http://skia.googlecode.com/svn/trunk@11589 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
354fd97ee00d2b604bf72132b7449b32a88dc2db 02-Oct-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Do not convert non gray PNG to A8.

If the user requested A8, but the source is not gray, switch to
ARGB8888.

BUG=https://b.corp.google.com/issue?id=9189955
R=reed@google.com

Review URL: https://codereview.chromium.org/24882002

git-svn-id: http://skia.googlecode.com/svn/trunk@11573 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
8d2392487cd97e68c0a71da9fd5d2b42ecac5ec8 01-Oct-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> 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=skia:1661
R=reed@google.com

Review URL: https://codereview.chromium.org/24269006

git-svn-id: http://skia.googlecode.com/svn/trunk@11558 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
b5571b3324cf18629a255ec85e189447069c9b14 25-Sep-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Change SkImageDecoders to take an SkStreamRewindable.

Only affects factories, static functions that will use the factories,
and subset decoding, which all require rewinding. The decoders
themselves continue to take an SkStream. This is merely documentation
stating which functions will possibly rewind the passed in SkStream.

This is part of the general change to coordinate SkStreams with
Android's streams, which don't necessarily support rewinding in all
cases.

Update callers to use SkStreamRewindable.

BUG=skia:1572
R=bungeman@google.com, reed@google.com

Review URL: https://codereview.chromium.org/23477009

git-svn-id: http://skia.googlecode.com/svn/trunk@11460 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
bd6343b1d60d2a85e930f33f4b06b4502b3e8caa 04-Sep-2013 mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Rewrite SkTRegistry to take any trivially-copyable type.

Obviously these are all currently function pointers of type T(*)(P) for various
T and P. In bench refactoring, I'm trying to register a function pointer of
type T(*)(), which can't be done as is (passing P=void doesn't work). This
also lets us register things like primitives, which is conceivable useful.

BUG=
R=reed@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/23453031

git-svn-id: http://skia.googlecode.com/svn/trunk@11082 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
4d213ab944d96ad60a243ac1ad21c793c1acc80a 28-Aug-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Handle SkStream::rewind properly.

include/core/SkStream.h:
Update documentation to state that rewinding a stream at the beginning
should return true. This is important because our decoders fail if
rewind returns false, assuming that the stream is not at the beginning.

src/images/SkImageDecoder_libpng.cpp:
If rewind fails, call png_error.

src/images/SkImageDecoder_libwebp.cpp:
If rewind fails, report an error and return false.

src/images/SkImageRef.cpp:
If rewind fails report an error and return false.
FIXME: Need to handle flattening properly. Should I perhaps move
writeStream into SkOrderedWriteBuffer?

src/images/SkJpegUtility.cpp:
Report a jpeg error on failure to rewind.

BUG=https://b.corp.google.com/issue?id=8432093
R=bungeman@google.com, djsollen@google.com, reed@google.com

Review URL: https://codereview.chromium.org/22861028

git-svn-id: http://skia.googlecode.com/svn/trunk@10977 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
8e2ef01cdd2069ce43c9d00ac9670aaa329af91a 18-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove assert which is failing.

Unreviewed.

git-svn-id: http://skia.googlecode.com/svn/trunk@10165 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
c70a3aa39bd3bf8e34906feecce5ae87f668e7d8 18-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Support decoding Gray to A8 in PNG.

Move the code which sets the filler and forces gray to rgb after
we get the config, so we can skip them if the caller wants A8.

Call set_gray_to_rgb consistently for both normal decode and subset
decode.

In PNG, prevent subset decodes from alternating configs, which
would otherwise fail.

Use SK_RESTRICT for pointers in getBitmapConfig.

Ref the SkStream input to buildTileIndex, so it will not be destroyed
before calling decodeSubset.

Convert some fields to match Skia style.

Builds on https://codereview.chromium.org/18083026/, which has not yet been checked in.

R=reed@google.com

Review URL: https://codereview.chromium.org/19185006

git-svn-id: http://skia.googlecode.com/svn/trunk@10162 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
bc69ce982f8374742ca910587485f0d741350c2d 09-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove bitmap reuse from SkImageDecoder.

Now that Android is using an SkBitmap::Allocator to reuse bitmap
memory, remove the unnecessary code to handle bitmap reuse inside
the decoders themselves.

Leaves in the code for bitmap reuse in decodeSubset, which still
may reuse bitmaps, and cropBitmap, which is called by decodeSubset.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/17620004

git-svn-id: http://skia.googlecode.com/svn/trunk@9931 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
2bbc2c945bb0ecf18fd6473af74ad1a2f5e727a7 14-Jun-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add an option to create unpremultiplied bitmaps.
Currently they cannot be used directly by Skia, but
the pixels can be used elsewhere.

SkImageDecoder:
Add functions to require unpremultiplied output
and query the presence of the requirement

SkImageDecoder_libpng:
SkImageDecoder_libwebp:
SkImageDecoder_WIC:
Respect the requirement for unpremultiplied output.
TODO: Fix SkImageDecoder_CG.

SkScaledBitmapSampler:
Add procs to skip premultiplication and a boolean
parameter to use those procs.

ImageDecodingTest:
Test unpremultiplied bitmap decoding.

SampleUnpremul:
Add a sample which allows visually comparing between the
unpremultiplied version (copied into a premultiplied bitmap,
since drawing unpremultiplied is not currently supported)
and a premultiplied version of image files.

gm.h:
Add a getter for the resource path, so Samples can use it.

As of patch set 13, https://codereview.chromium.org/16816016/
and https://codereview.chromium.org/16983004/, which were
approved separately.

R=reed@google.com

Review URL: https://codereview.chromium.org/16410009

git-svn-id: http://skia.googlecode.com/svn/trunk@9612 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
7e6fceeffd250d99eff9f1dbb459a916ae4a754e 03-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Test region decoding in skimage, plus fixes.

Add tests in skimage to perform region decoding. Write out a
PNG of the region as well as a bitmap obtained with extractSubset
for comparison.

Rename decodeRegion to decodeSubset, so it will not be confused
with SkRegion. (Leave a function called decodeRegion which calls
decodeSubset.)

Clean up some comments.

Use png_set_interlaced_pass instead of modifying pass directly.

Make some changes to region decoding to fix problems I discovered
during testing:

Only call getAddr within a valid range.
Check for a NULL fInputStream.
Return a boolean for whether cropBitmap succeeded.
In cropBitmap, do not attempt to draw to a bitmap to an Index8
bitmap, which crashes. Use extractSubset instead.
Remove an assert.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/14567011

git-svn-id: http://skia.googlecode.com/svn/trunk@8996 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
c1c5695f8f0cda7cbabb490d274d742ca0e26eed 02-May-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Support for libpng > 1.2.

* Add conditional defines for deprecated NULL type casts.
* Use wrapper functions for accessing png_structp & png_infop fields
(direct access is deprecated).

Tested on Fedora 17 (libpng 1.5) and Ubuntu 12.04 (libpng 1.2).

Note: there is one png_structp direct field acces left in
SkPNGImageDecoder::onDecodeRegion() for which libpng does not provide a
wrapper method (png_ptr->pass = 0). That should be OK for now as the code
is only enabled when SK_BUILD_FOR_ANDROID is set, and the Android libpng
version is striclty controlled. But it may become an issue in the future
when/if Android decides to update libpng, so we should investigate a
solution.


R=scroggo@google.com, reed@google.com, djsollen@google.com

Author: fmalita@google.com

Review URL: https://chromiumcodereview.appspot.com/14645018

git-svn-id: http://skia.googlecode.com/svn/trunk@8956 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
39edf4cd94e6fbeb8c1187a588b314e9795c81e4 25-Apr-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Updates to skimage tool to use it for testing.

skimage_main.cpp:
More changes in the interest of testing our decoders.

force_all_opaque before writing PNG files.

Test reencoding the image to its original type (if possible), and
then test redecoding it (to make sure the encoding was successful).
Add an option to turn off this behavior.

Merge decodeFileAndWrite with decodeFile.

SkImageDecoder:
Add kUnknown_Type to SkImageEncoder::Types.

Add a static function to get the Format of an SkStream.

In getFormatName(), remove an incorrect assert.

When calling the flavor of DecodeStream that returns the Format,
check the stream if the decoder returns kUnknown_Format.

BUG=https://code.google.com/p/skia/issues/detail?id=1241

Review URL: https://codereview.chromium.org/14363003

git-svn-id: http://skia.googlecode.com/svn/trunk@8862 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
6e32c4627bbc690a3e5cae5cd86569e4d6d7a08b 20-Mar-2013 djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SK_ENABLE_LIBPNG define as it is no longer needed by Android.

Review URL: https://codereview.chromium.org/12958002

git-svn-id: http://skia.googlecode.com/svn/trunk@8262 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
a936e37cc76614868f5b489395bceeb340cc04cd 14-Mar-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Upstream Android modifications to the image encoders/decoders.

This CL does not update the libjpeg as that change is large enough
to warrant its own CL.


Author: djsollen@google.com

Reviewed By: reed@google.com,robertphillips@google.com,scroggo@google.com

Review URL: https://chromiumcodereview.appspot.com/12604006

git-svn-id: http://skia.googlecode.com/svn/trunk@8155 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
4ce738b98ee0be1771712e3036a7711c21f3b7f4 16-Nov-2012 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Extract transform_scanline_XXXX functions into transform_scanline.h for code-sharing
Review URL: https://codereview.appspot.com/6849065

git-svn-id: http://skia.googlecode.com/svn/trunk@6468 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
d6176b0dcacb124539e0cfd051e6d93a9782f020 23-Aug-2012 rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)

This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054

git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
ec51cb863409e238b40c5beef458669d9a824481 23-Mar-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Improved codec link-forcing system by adding Encoder/Decoder creation entry points

http://codereview.appspot.com/5881055/




git-svn-id: http://skia.googlecode.com/svn/trunk@3481 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
5c210c7a2ff860631c179253d8d6f6d813185570 28-Jul-2011 tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Break onEncode() into two functions to avoid clobbering variables with
setjmp/longjmp; gets rid of warnings on Linux.

Over-the-shoulder review by reed@.



git-svn-id: http://skia.googlecode.com/svn/trunk@1989 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976e 28-Jul-2011 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Automatic update of all copyright notices to reflect new license terms.

I have manually examined all of these diffs and restored a few files that
seem to require manual adjustment.

The following files still need to be modified manually, in a separate CL:

android_sample/SampleApp/AndroidManifest.xml
android_sample/SampleApp/res/layout/layout.xml
android_sample/SampleApp/res/menu/sample.xml
android_sample/SampleApp/res/values/strings.xml
android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java
android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java
experimental/CiCarbonSampleMain.c
experimental/CocoaDebugger/main.m
experimental/FileReaderApp/main.m
experimental/SimpleCocoaApp/main.m
experimental/iOSSampleApp/Shared/SkAlertPrompt.h
experimental/iOSSampleApp/Shared/SkAlertPrompt.m
experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig
gpu/src/android/GrGLDefaultInterface_android.cpp
gyp/common.gypi
gyp_skia
include/ports/SkHarfBuzzFont.h
include/views/SkOSWindow_wxwidgets.h
make.bat
make.py
src/opts/memset.arm.S
src/opts/memset16_neon.S
src/opts/memset32_neon.S
src/opts/opts_check_arm.cpp
src/ports/SkDebug_brew.cpp
src/ports/SkMemory_brew.cpp
src/ports/SkOSFile_brew.cpp
src/ports/SkXMLParser_empty.cpp
src/utils/ios/SkImageDecoder_iOS.mm
src/utils/ios/SkOSFile_iOS.mm
src/utils/ios/SkStream_NSData.mm
tests/FillPathTest.cpp
Review URL: http://codereview.appspot.com/4816058

git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
29f6636a5faad017f07980727eb29a13febfaf3d 25-Feb-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Stop using deprecated APIs. Fix by twiz.

http://codereview.appspot.com/4249041/
BUG=http://code.google.com/p/skia/issues/detail?id=151



git-svn-id: http://skia.googlecode.com/svn/trunk@857 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
7b34ea61cea33e8790d4b2bd48a4e9c0bba066cd 24-Feb-2011 djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Upstreaming code from android repository.

* fix for png decoder
* clean up for SkFontHost

reviewed by reed@google.com


git-svn-id: http://skia.googlecode.com/svn/trunk@847 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
4868e6b221a4a98e40f977851af5fcf09631ea15 18-Feb-2011 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [Committed on behalf of junov@chromium.org]

Fixed rendering of shadows under bitmaps.
Added an option to SkBlurMask to produce higher quality blurs.
The HQ blur option is propagated through SkBlurDrawLooper so that it can be invoked by WebKit for drawing shadows.
Added a shadow rendering test to gm.

Bugs fixed: 146, 150
Related Chromium bugs: 11153, 42654
Code review: http://codereview.appspot.com/4174049



git-svn-id: http://skia.googlecode.com/svn/trunk@818 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
7af0046fbdb5b23a2fcec708b57ec07d351099d4 31-Dec-2010 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> replace various png_[type]_NULL defines with just NULL
libpng 1.4 removed some of these from their headers :(



git-svn-id: http://skia.googlecode.com/svn/trunk@664 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
dfee579a8de6462399f1b1867f924856c11bc4a1 15-Apr-2010 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add SK_ENABLE_LIBPNG to force reference to PNG codec



git-svn-id: http://skia.googlecode.com/svn/trunk@550 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
3f1f06a26bdb2022a5c72f93ae623a57b6659464 03-Mar-2010 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add optional pref-config table to codecs



git-svn-id: http://skia.googlecode.com/svn/trunk@519 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
b6137c3139b1b1da99ad9f6c28ac0d9e8f910ff6 29-Jul-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> remove auto-upscaling from base class (breaks model for allocators) but improve
the upscaling inside the png codec.



git-svn-id: http://skia.googlecode.com/svn/trunk@294 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
1134426f6b1c4130e8dbe4c38a4aa976fbb18b4b 08-Jul-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> respect preferred config when png is index-based



git-svn-id: http://skia.googlecode.com/svn/trunk@261 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
6189877c50166f58f09c6583a9aa37c735310779 07-Jul-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add support for encoding Index8 bitmaps into png



git-svn-id: http://skia.googlecode.com/svn/trunk@254 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
a8a8b8b80e2b6be2dd83ef2c1333851fd03a87d7 04-May-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> check for 0 upem in freetype
add 32bit-overflow check



git-svn-id: http://skia.googlecode.com/svn/trunk@165 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
862e91be0225be1e5cfc8157301cfc13d8da4287 28-Apr-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> handle interlacing



git-svn-id: http://skia.googlecode.com/svn/trunk@161 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
00bf85a98675c9d0c3150bbeb0a3d7198ad8f21f 22-Jan-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> pull from android: use registry to build up list of image codecs



git-svn-id: http://skia.googlecode.com/svn/trunk@76 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
b50a60c463ae4e2475de8a421b0056b03335b28e 14-Jan-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix formatting issues



git-svn-id: http://skia.googlecode.com/svn/trunk@67 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
6f25297d93ed7fb29264cd072ad15ec25d1e27e7 14-Jan-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix multiple warnings (e.g. hidden virtuals, unused static functions)
update freetype version-check for const



git-svn-id: http://skia.googlecode.com/svn/trunk@66 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
b08eb2b3bce45411494fe00258e4c91248ccd15e 06-Jan-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> separate image encode and decode
remove obsolete build-flag for encode



git-svn-id: http://skia.googlecode.com/svn/trunk@56 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp
8a1c16ff38322f0210116fa7293eb8817c7e477e 17-Dec-2008 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> grab from latest android



git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libpng.cpp