History log of /external/skia/src/images/SkImageDecoder_libgif.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_libgif.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_libgif.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_libgif.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_libgif.cpp
3a8ebd9e71dab5c6640c40b8576dbe0d901c261b 19-Dec-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitize bitmaps produced by libgif

Motivation: fix the bug linked to below.

Some rare GIFs in the wild have a color table of size smaller than 256
and have one or more pixels with values that index out side of the
colortable. Since it would be expensive to check the index every time
we do a color lookup, we sanitize it at the source, in
SkImageDecoder_libgif.cpp. The new function sanitize_indexed_bitmap
checks each pixel to see if the index is outside of its allowed mask,
and if so, sets that pixel to point at color 0.

The bit mask optimization in this function relies on the fact that GIF
requires the color table size to be a power of 2.

To test:

$ skia_images_gif_suppressDecoderWarnings=0 \
..../render_pictures \
--bbh grid 256 256 --clone 1 --config 8888 --mode tile 256 256 \
-r ..../http___www_cafe24_com_.skp -w /tmp

This should show verbose errors.

BUG=skia:1946
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12786 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.cpp
29d4e638641d6d089a0361619ff2a583fd1a827f 11-Oct-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GIF decode: optional error messages and fault tolerance.

Add new runtime configuration variable,
images.gif.suppressDecoderWarnings, which suppresses warning and
errors from the GIF library. It defaults to "true", which is current
behavior.

(This setting can be changed by setting the environment variable
skia_images_gif_suppressDecoderWarnings="false".)

Some conditions which were errors before are now warnings:

- If the image width or height is greater than the GIF screen width or
height (respectively) we expand the screen to hold the image.

- If the offset of the image inside the screen would place the
image outside of the screen, we shift the image to fix this.

- If the image lacks a color table, we create a default color table.

- If the image is truncated, then the rest of the image is filled with
the fill color.

In all four cases, if images.gif.suppressDecoderWarnings is set to
false, then a warning message is printed via SkDebugf.

In the event of another kind of error, SkGIFImageDecoder::onDecode()
will still return false. But with this change, if
images.gif.suppressDecoderWarnings is set to false, a description of
the error is printed via SkDebugf.

Also, added a new unit test GifTest, which tests the deconing of both
good GIf files and corrupted files that should now work with this
change. This unit test is disabled on Win32, iOS, and Mac.

BUG=skia:1689
R=scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11734 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.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_libgif.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_libgif.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_libgif.cpp
dac4a1d518a4788c3e2475d68cbe8683b4a448ff 08-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow sampling GIF images during decode.

SkScaledBitmapSampler:
Add a mode for sampling rows out of order, used by GIF decoder for
interlaced images.
Add a getter for the X sampling rate.

SkImageDecoder_libgif:
Respect the sampleSize set on SkImageDecoder.

skimage_main:
Provide an option to set a sample size.

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

Author: scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11659 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.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_libgif.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_libgif.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_libgif.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_libgif.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_libgif.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_libgif.cpp
bb89613380332065a2abf71b8b229eabcf2c0be8 01-Feb-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> landing https://codereview.appspot.com/7225077/ -- tweak for GIF 5.x api



git-svn-id: http://skia.googlecode.com/svn/trunk@7523 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.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_libgif.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_libgif.cpp
8570b5c8695052378491b0c61e745d736fe85c8d 20-Mar-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Adding CMYK jpeg changes w/o .gyp alterations

http://codereview.appspot.com/5785054/



git-svn-id: http://skia.googlecode.com/svn/trunk@3442 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.cpp
0a89c90d18ab5082f2fde5076ce422aac493bb00 20-Mar-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> reverting to 3437

git-svn-id: http://skia.googlecode.com/svn/trunk@3439 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.cpp
d5c9e996dff7169cd6bfbf5c6d1543fca512c1a5 20-Mar-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for CMYK jpeg decoding issue (69 - unable to read some jpeg files on android)

http://codereview.appspot.com/5785054/



git-svn-id: http://skia.googlecode.com/svn/trunk@3438 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.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_libgif.cpp
57f4969724a1dd88c8d9ae35a863e6cf621181d5 23-Feb-2011 djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> merge from android tree:
- optional parameters added to descriptorProc and allocPixels
- clip options to image decoders
- check for xfermode in blitter_a8
- UNROLL loops in blitrow

reviewed by reed@google.com



git-svn-id: http://skia.googlecode.com/svn/trunk@841 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.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_libgif.cpp
bc7d2fb5be746f6e0d9bd60c9e181eec20fe31ea 05-Feb-2010 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> check for null cmap in libgif
support bounds-only in libjpeg even if we can't complete start_decompress



git-svn-id: http://skia.googlecode.com/svn/trunk@486 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/images/SkImageDecoder_libgif.cpp
9781ca586618cc8ea055f54021e706824313d4f5 14-Apr-2009 reed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add SkSfntUtils to parse some known truetype tables
add comments and cleanup to count_tables in SkFontHost_tables.cpp
fix transparency bug in gifs
use (alpha+1) for blending in srcover mode, to ensure opaque results



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