History log of /external/skia/src/images/SkImageDecoder.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.cpp
c3b3266b7db2f1a41d41ecac010c766b7ad8eebc 17-Jun-2014 reed <reed@google.com> hide SkBitmap::Config entirely (behind a flag)

patch from issue 339463002

TBR=

I think the NoGPU failure is unrelated, so ignoring
NOTRY=True

Author: reed@google.com

Review URL: https://codereview.chromium.org/340533002
/external/skia/src/images/SkImageDecoder.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.cpp
bfefc7c95fc0e8ebd5000c68f6d16e1a3ea0e71e 13-Jun-2014 reed <reed@chromium.org> hide Config in SkImageDecoder -- use SkColorType instead

patch from issue 334613003

TBR=scroggo

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/334793002
/external/skia/src/images/SkImageDecoder.cpp
2f785a24eba5b59da30f5ffa0c53cc731e4c3078 12-Jun-2014 reed <reed@google.com> remove GetDeviceConfig/SetDeviceConfig

BUG=skia:
R=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/332453002
/external/skia/src/images/SkImageDecoder.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.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.cpp
99ffe24200d8940ceba20f6fbf8c460f994d3cd1 03-Jun-2014 krajcevski <krajcevski@google.com> Initial KTX file decoder

R=bsalomon@google.com, robertphillips@google.com, halcanary@google.com, reed@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/302333002
/external/skia/src/images/SkImageDecoder.cpp
8cf81e0f4fa2a8054ac4cea1e7490028809cb893 22-May-2014 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Simple PKM image decoder.

https://codereview.chromium.org/292663011/



git-svn-id: http://skia.googlecode.com/svn/trunk@14852 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
29d96935ae34dfcd6e403f9beefa7436e226836e 09-Dec-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> SkDecodingImageGenerator now uses SkStreamRewindable

This makes sense since Android will be giving us a stream and the
decoders expect a stream. This also removes some glue code,
DecodeMemoryToTarget, that works better using a SkImageGenerator.

Motivation: This is a necessary step to move from SkImageRef to
SkDiscardablePixelRef.

SkImageDecoder::DecodeMemoryToTarget function removed.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12560 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
2c7c7ee47d75e7815ea8db05e924ab55958cb402 05-Dec-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache

Removed SkBitmapFactory since no clients were using it. New cache
selection mechanism can simply pass a SkDiscardableMemory::Factory
into the SkDiscardablePixelRef if non-default SkDiscardableMemory
should be used. Removed BitmapFactoryTest.

SkDiscardableMemory::Factory interface. Android will need this
functionality in the future inside their BitmapFactory.

Removed SkLazyPixelRef, since it's functionality is now subsumed into
SkDiscardablePixelRef. Removed LazyPixelRef test.

Modified SkDiscardablePixelRef to optionally allow it to use a
SkDiscardableMemory::Factory. This tiny change makes it a replacement
for SkLazyPixelRef. This functioanlity is also necessary for moving
Android over to SkDiscardablePixelRef from SkImageRef in a later CL.
Added a test for this.

SkDecodingImageGenerator::Install can optionally pass a factory in to
SkDiscardablePixelRef.

Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache.
This functionality can be handled much more cleanly by
SkDiscardableMemory.

New SkDiscardableMemoryPool class to replace SkLruImageCache. In a
later CL, we will replace SkImageRef_GlobalPool (used by android) as
well. This is a concrete implementation of
SkDiscardableMemory::Factory. Added a test for this.

modified gm/factory.cpp to remove dependnce on SkBitmapFactory +
SkLruImageCache. Now uses SkDecodingImageGenerator +
SkDiscardablePixelRef + SkDiscardableMemoryPool.

SkImageDecoder::Target replaces SkBitmapFactory::Target. The
DecodeMemoryToTarget function may disappear in the future.

Moved SkLazyCachingPixelRef::DecodeProc replaces
SkBitmapFactory::DecodeProc. This is a short term change, since
another CL changes SkLazyCachingPixelRef to use SkImageGenerator
instead of DecodeProc.

Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of
SkLazyPixelRef.

tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator +
SkDiscardablePixelRef instead of a SkBitmapFactory.

bench_pictures uses the Global SkDiscardableMemoryPool instead of a
global gLruImageCache.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12515 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
ab1c13864df34aecfd4840ea7d1e4f8730b44f4e 05-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix compilation with SK_ENABLE_INST_COUNT=1

Add INHERITED declarations to class declarations that prevent
compilation with the flag.

Remove SK_DEFINE_INST_COUNT from all class implementations. Instead,
use function-local static variables in the reference count helper
classes to create the global instances to store the needed info. The
accessor functions are defined inline in the helper classes, so
definitions are not needed. The initialization point of the variables
should be as well defined as previously.

Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT
instead. This avoids possible future compilation errors further.

For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member
function to all classes that use SK_DECLARE_INST_COUNT and
SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes
contain public INHERITED typedef. This member function seems to be
compiled away. This shouĺd ensure that part of the compilation errors
are caught earlier.

Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses.

R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
a0b266d8170211d9f2a6f90ba9c889f0c1b6d1b6 04-Dec-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove deprecated setPrefConfigTable.

Safe once its only caller (in Android) has been updated.

BUG=skia:1874
R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12491 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
2bd8b8100529c96c81c30f749f672f4caf775b04 01-Nov-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> move SkImage::ColorType into SkColorType

objective -- move clients over to SkImage

tasks
- use SkImageInfo instead of SkBitmap::Config
- add support for colortables to SkImage
- add drawImage to SkCanvas
- return SkImage from readPixels

This CL works towards the first task

R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12077 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.cpp
6fcbfcead5dc1b61fa5b4c139a1a3714e8c58091 31-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"

This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497.

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

BUG=
R=robertphillips@google.com, senorblanco@chromium.org, vandebo@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12055 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
114038a2e29a6d20b780a05281a16242892c94e8 21-Oct-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Revert "cache SkImage::Info calculation in lazypixelref""

This reverts commit 81eba32ab10f9210c742938819cf1218be5611c9.

ImageDecoder is changed to allow info to be NULL, since it is an output-only parameter.

R=scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11896 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.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.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.cpp
330313a8a8343876ee596da39da06a5d69badd9c 22-Aug-2013 mtklein@google.com <mtklein@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> My clang now doesn't complain about !"foo".

BUG=
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10874 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
12d064236abb6d8b56db96632e11de0333081561 18-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Initialize config.

Unreviewed.

git-svn-id: http://skia.googlecode.com/svn/trunk@10159 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
f698c8262df397a7015662e91b1a727e1134c418 18-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow decoding JPEG into A8.

If the original image is grayscale, allow decoding into A8.

Change the size of PrefConfigTable to allow for 8bit gray, a new source config.

Add a new sampler to SkScaledBitmapSampler to 'convert' to A8.

FIXME: Should there be a dithered option for gray scale?

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10157 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
468142b2f50de055f00d5684515d962777da5131 09-Jul-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow ico decoder to decode PNG sub-images.

Since Windows Vista, PNG can be embedded in an ICO file. Update
our decoder to support this.

BUG=https://code.google.com/p/skia/issues/detail?id=1398
R=djsollen@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9932 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.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.cpp
7def5e1630d47cdbfa4b58a9c86bc060693c4d79 31-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Separate core and images project.

SkImage calls functions on SkImageDecoder and SkImageEncoder. This
is desired behavior, and it is also desired to include SkImage as
a part of core. In order to keep core from depending on images,
update SkImageDecoder_empty.cpp to implement all of SkImageDecoder
and SkImageEncoder. This file will be built by chrome (in
https://codereview.chromium.org/15960015).

Move force_linking from SkImageDecoder.cpp to its own file. It must
be called to force linking with the image decoders if desired. Call
the function in tools that need it:
sk_image
render_pictures
render_pdfs
sk_hello
filter
bench_pictures
debugger

SkImageDecoder:
Derive from SkNoncopyable, instead of duplicating its
hiding of constructors.

skhello:
Return rather than trying to write a null SkData to the stream.

Revert "Hamfistedly removed core dependence on images"
(commit 0f05f682a90bc125323677abf3476e1027d174f5) and
"Move SkImage::encode to SkImage_Codec.cpp."
(commit 83e47a954d0bf65439f3d9c0c93213063dd70da3.)
These two commits were temporary fixes that this change
cleans up.

SkSnapshot.cpp:
Check for a NULL encoder returned by SkImageEncoder::Create.

BUG=https://code.google.com/p/skia/issues/detail?id=1275
R=djsollen@google.com, robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9364 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
67882ddc0efbe33070b5da16931f80ed7f21b1f1 20-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make DecodeMemoryToTarget handle more configs.

In SkImageDecoder::DecodeMemoryToTarget, if SkBitmapToImageInfo fails due to an unsupported config, copy to 8888.

Needed for https://codereview.chromium.org/15145004/ and
https://codereview.chromium.org/12851012/ for all bitmaps to be
decoded properly in render_pictures and bench_pictures.

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9196 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
f98118e65cbcee064bb8034f94a4faf4ea8d5536 15-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Provide a function to print the name of a Format.

Also use SkToU32 instead of a flat cast.

R=djsollen@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9139 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.cpp
8244998dd394e836226d8db5460407f3502e2209 01-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Build fix attempt number 2.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8943 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
1be4ec9f4f581b61569ec90ec7dcc325746eac8a 01-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix the build.

Remove an unused function warning.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8942 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
c4ebdb03def1e9d03ccff05f32db0eec106cc361 01-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Force linking with image decoders for images project.

Previously, each tool that wanted to use image decoders
but did not specifically reference them had to create a
dummy function that references them in order to ensure
they are not stripped by the linker.

Instead of making each tool reference each image decoder,
do it once in SkImageDecoder.cpp. Now each tool will have
image decoders linked in, assuming it includes the images
project.

This fixes a bug where SKPs with encoded data could not
be read by bench_ or render_pictures.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8941 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.cpp
f381162e5616daacdbcc06d693aca5111aeeebe8 19-Mar-2013 mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81> use SkStream::NewFromFile()



git-svn-id: http://skia.googlecode.com/svn/trunk@8210 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
c49cabfe5cddc1691a00f713ae1b077d9409389f 15-Mar-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@8168 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.cpp
f8d7d2731318cdf510ab68e6b3f5ec68ab22c8e2 22-Feb-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Create SkLazyPixelRef which performs lazy decoding.

The new pixel ref behaves similarly to SkImageRef, with some key differences:
It does not depend on the images project.
It requires an SkImageCache, which handles allocation and caching of the pixel
memory.
It takes a function signature for decoding which decodes into already allocated
pixel memory rather than into an SkBitmap.

Add two implementations of SkImageCache: SkLruImageCache and SkAshmemImageCache.

Replace SkSerializationHelpers::DecodeBitmap with SkPicture::InstallPixelRefProc,
and update sites that referenced it.

SkBitmapFactory now sets the pixel ref to a new object of the new
class SkLazyPixelRef, provided it has an SkImageCache for caching.

Provide an option to do lazy decodes in render_pictures and bench_pictures.

SkPicture:
Eliminate the default parameters in the constructor.
If a proc for decoding bitmaps is installed, use it to decode any encoded
data in subpictures.
When parsing deserializing subpictures, check for success.
When serializing subpictures, pass the picture's bitmap encoder to the
subpicture's call to serialize.

Update BitmapFactoryTest to test its new behavior.

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

Review URL: https://codereview.appspot.com/7060052

git-svn-id: http://skia.googlecode.com/svn/trunk@7835 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
e16efc1882ab34a0bb3ae361a2d37f840044cf87 26-Jan-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
15e9d3e66e161ce23df30bc13f8a0c87d196b463 21-Jun-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Expanded distribution of instance counting

http://codereview.appspot.com/6300114/



git-svn-id: http://skia.googlecode.com/svn/trunk@4291 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
1a366217cd7a9833756fe1b53c59053d6621f4bc 03-Jan-2012 tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix return value from SkImageDecoder::DecodeFile(): false even in case of
*partial* failure.



git-svn-id: http://skia.googlecode.com/svn/trunk@2941 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.cpp
82065d667f64e232bcde2ad849756a6096fcbe6f 07-Feb-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> remove SkRefCnt safeRef() and safeUnref(), and replace the call-sites with
SkSafeRef() and SkSafeUnref().

This is basically a bug waiting to happen. An optimizing compiler can remove
checks for null on "this" if it chooses. However, SkRefCnt::safeRef() relies on
precisely this check...

void SkRefCnt::safeRef() {
if (this) {
this->ref();
}
}

Since a compiler might skip the if-clause, it breaks the intention of this
method, hence its removal.

static inline void SkSafeRef(SkRefCnt* obj) {
if (obj) {
obj->ref();
}
}

This form is not ignored by an optimizing compile, so we use it instead.




git-svn-id: http://skia.googlecode.com/svn/trunk@762 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.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.cpp
b3ade9d1b0a63f8f0dc3bee5785e930c8e84311d 15-Jun-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add optional Format* parameter to decoder helper functions.



git-svn-id: http://skia.googlecode.com/svn/trunk@215 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
25e9834c03a050afbf339f457b8c401aecb26c0b 11-May-2009 weita@google.com <weita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Honor pref config in image decoding whenever possible.


git-svn-id: http://skia.googlecode.com/svn/trunk@173 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.cpp
62900b4c64401bc80ae85f6f5c87309a273cae10 11-Feb-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> handle failure when creating a scalercontext



git-svn-id: http://skia.googlecode.com/svn/trunk@90 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder.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.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.cpp