aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images/SkImageDecoder_libwebp.cpp
Commit message (Collapse)AuthorAge
* stop using SkBitmap::ConfigGravatar reed2014-06-14
| | | | | | | | R=scroggo@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/338493005
* hide SkImageDecoder::ChooserGravatar reed2014-06-11
| | | | | | | | | BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/331433003
* hide SkBitmap::setConfigGravatar reed2014-06-09
| | | | | | | | | | patch from issue 325733002 TBR=scroggo Author: reed@chromium.org Review URL: https://codereview.chromium.org/322963002
* Revert "Revert of setConfig -> setInfo ↵Gravatar commit-bot@chromium.org2014-05-30
| | | | | | | | | | | | | | (https://codereview.chromium.org/308683005/)" This reverts commit eecaea4148805834f223681f70b6488ceba12d09. R=robertphillips@google.com, scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/301283003 git-svn-id: http://skia.googlecode.com/svn/trunk@14989 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)Gravatar commit-bot@chromium.org2014-05-29
| | | | | | | | | | | | | | | | | | | | | | | | Reason for revert: broke all Windows bots Original issue's description: > setConfig -> setInfo > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=14978 R=robertphillips@google.com, reed@google.com TBR=reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: epoger@google.com Review URL: https://codereview.chromium.org/302053002 git-svn-id: http://skia.googlecode.com/svn/trunk@14979 2bbb7eff-a529-9590-31e7-b0007b416f81
* setConfig -> setInfoGravatar commit-bot@chromium.org2014-05-29
| | | | | | | | | | | BUG=skia: R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/308683005 git-svn-id: http://skia.googlecode.com/svn/trunk@14978 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fast path for blurred round rects -- blur a small 9patch rect on the CPUGravatar commit-bot@chromium.org2014-04-28
| | | | | | | | | | | | | | | | | | And nonlinearly stretch the resulting texture across proxy geometry. BUG= Committed: http://code.google.com/p/skia/source/detail?r=14392 Committed: http://code.google.com/p/skia/source/detail?r=14404 R=bsalomon@google.com, reed@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/248613004 git-svn-id: http://skia.googlecode.com/svn/trunk@14420 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert humper changesGravatar commit-bot@chromium.org2014-04-28
| | | | | | | | | | | | | | | | | https://skia.googlesource.com/skia.git/+/24e91ba3029a3a1fb60cab3ae4e68c3c44776f25 https://skia.googlesource.com/skia.git/+/a36c78240e14aeb130a97c43f3992ea19696b929 NOTREECHECKS=true BUG=skia: R=caryclark@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/256803011 git-svn-id: http://skia.googlecode.com/svn/trunk@14414 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fast path for blurred round rects -- blur a small 9patch rect on the CPUGravatar commit-bot@chromium.org2014-04-28
| | | | | | | | | | | | | | | | And nonlinearly stretch the resulting texture across proxy geometry. BUG= Committed: http://code.google.com/p/skia/source/detail?r=14392 R=bsalomon@google.com, reed@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/248613004 git-svn-id: http://skia.googlecode.com/svn/trunk@14404 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of Fast path for blurred round rects -- blur a small 9patch rect on ↵Gravatar commit-bot@chromium.org2014-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | the CPU (https://codereview.chromium.org/248613004/) Reason for revert: Looks like this causes unit tests to fail with a zero constructor like this one: http://108.170.220.120:10117/builders/Test-Win7-ShuttleA-HD2000-x86-Release/builds/2326/steps/RunTests/logs/stdio Original issue's description: > Fast path for blurred round rects -- blur a small 9patch rect on the CPU > And nonlinearly stretch the resulting texture across proxy geometry. > > BUG= > > Committed: http://code.google.com/p/skia/source/detail?r=14392 R=bsalomon@google.com, reed@google.com, humper@google.com TBR=bsalomon@google.com, humper@google.com, reed@google.com NOTREECHECKS=true NOTRY=true BUG= Author: caryclark@google.com Review URL: https://codereview.chromium.org/258893010 git-svn-id: http://skia.googlecode.com/svn/trunk@14400 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fast path for blurred round rects -- blur a small 9patch rect on the CPUGravatar commit-bot@chromium.org2014-04-28
| | | | | | | | | | | | | And nonlinearly stretch the resulting texture across proxy geometry. BUG= R=bsalomon@google.com, reed@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/248613004 git-svn-id: http://skia.googlecode.com/svn/trunk@14392 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reland "Properly set alpha type in webp decode."Gravatar commit-bot@chromium.org2014-04-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use the newer setConfig function. Add a test to confirm that we set the alpha type properly. Add some images with alpha for testing. (These images are also beneficial for the compare_unpremul test, which was previously not meaningful on 100% opaque images.) All of the added images are in the public domain. They were taken from https://developers.google.com/speed/webp/gallery2: yellow_rose: "Free Stock Photo in High Resolution - Yellow Rose 3 - Flowers" Image Author: Jon Sullivan This file is in the public domain. http://www.public-domain-photos.com/free-stock-photos-4/flowers/yellow-rose-3.jpg baby_tux: "baby tux for my user page" Image Author: Fizyplankton This file is in the public domain. http://www.minecraftwiki.net/images/8/85/Fizyplankton.png NOTRY=true TBR=halcanary@google.com BUG=skia:2388 Author: scroggo@google.com Review URL: https://codereview.chromium.org/252423008 git-svn-id: http://skia.googlecode.com/svn/trunk@14360 2bbb7eff-a529-9590-31e7-b0007b416f81
* add one-channel output support to webp encoderGravatar commit-bot@chromium.org2014-04-23
| | | | | | | | | | | BUG= R=halcanary@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/249853003 git-svn-id: http://skia.googlecode.com/svn/trunk@14340 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of Properly set alpha type in webp decode. ↵Gravatar commit-bot@chromium.org2014-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/223893002/) Reason for revert: Breaks ImageDecoding tests on several platforms. Original issue's description: > Properly set alpha type in webp decode. > > Also use the newer setConfig function. > > Add a test to confirm that we set the alpha type properly. > > Add some images with alpha for testing. (These images are also beneficial for the compare_unpremul test, which was previously not meaningful on 100% opaque images.) > > All of the added images are in the public domain. They were taken from https://developers.google.com/speed/webp/gallery2: > > yellow_rose: > "Free Stock Photo in High Resolution - Yellow Rose 3 - Flowers" > Image Author: Jon Sullivan > This file is in the public domain. > http://www.public-domain-photos.com/free-stock-photos-4/flowers/yellow-rose-3.jpg > > baby_tux: > "baby tux for my user page" > Image Author: Fizyplankton > This file is in the public domain. > http://www.minecraftwiki.net/images/8/85/Fizyplankton.png > > NOTRY=true > > Committed: http://code.google.com/p/skia/source/detail?r=14054 R=halcanary@google.com TBR=halcanary@google.com NOTREECHECKS=true NOTRY=true Author: scroggo@google.com Review URL: https://codereview.chromium.org/223903008 git-svn-id: http://skia.googlecode.com/svn/trunk@14055 2bbb7eff-a529-9590-31e7-b0007b416f81
* Properly set alpha type in webp decode.Gravatar commit-bot@chromium.org2014-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also use the newer setConfig function. Add a test to confirm that we set the alpha type properly. Add some images with alpha for testing. (These images are also beneficial for the compare_unpremul test, which was previously not meaningful on 100% opaque images.) All of the added images are in the public domain. They were taken from https://developers.google.com/speed/webp/gallery2: yellow_rose: "Free Stock Photo in High Resolution - Yellow Rose 3 - Flowers" Image Author: Jon Sullivan This file is in the public domain. http://www.public-domain-photos.com/free-stock-photos-4/flowers/yellow-rose-3.jpg baby_tux: "baby tux for my user page" Image Author: Fizyplankton This file is in the public domain. http://www.minecraftwiki.net/images/8/85/Fizyplankton.png NOTRY=true R=halcanary@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/223893002 git-svn-id: http://skia.googlecode.com/svn/trunk@14054 2bbb7eff-a529-9590-31e7-b0007b416f81
* Upstream changes from AndroidGravatar commit-bot@chromium.org2014-02-26
| | | | | | | | | | R=scroggo@google.com, reed@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/176963003 git-svn-id: http://skia.googlecode.com/svn/trunk@13600 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert of https://codereview.chromium.org/113823003/"Gravatar reed@google.com2013-12-30
| | | | | | | | | | 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
* Revert of https://codereview.chromium.org/113823003/Gravatar commit-bot@chromium.org2013-12-30
| | | | | | | | | | | | | | | | Reason for revert: need to update callsites in linux codecs R=robertphillips@google.com TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG= Author: reed@google.com Review URL: https://codereview.chromium.org/122283002 git-svn-id: http://skia.googlecode.com/svn/trunk@12841 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove Sk64 from public API, and start to remove usage internallyGravatar reed@google.com2013-12-30
| | | | | | | | | BUG= R=robertphillips@google.com Review URL: https://codereview.chromium.org/113823003 git-svn-id: http://skia.googlecode.com/svn/trunk@12840 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix Red/Blue decoding problem in WebP.Gravatar halcanary@google.com2013-12-20
| | | | | | | | | | | | | | Added unit test with lossless webp data. BUG=skia:1402 Will need to rebaseline webp expectations for some systems. R=scroggo@google.com Review URL: https://codereview.chromium.org/105443005 git-svn-id: http://skia.googlecode.com/svn/trunk@12803 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | | 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
* Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it ↵Gravatar reed@google.com2013-10-31
| | | | | | | | triggers a warning" This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | 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
* store SkAlphaType inside SkBitmap, on road to support unpremulGravatar reed@google.com2013-10-21
| | | | | | | | | 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
* Second wave of Win64 warning cleanupGravatar robertphillips@google.com2013-10-15
| | | | | | | | https://codereview.chromium.org/27343002/ git-svn-id: http://skia.googlecode.com/svn/trunk@11778 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkImageDecoders to take an SkStreamRewindable.Gravatar scroggo@google.com2013-09-25
| | | | | | | | | | | | | | | | | | | | 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
* Remove dead code from libwebp image decoderGravatar commit-bot@chromium.org2013-09-06
| | | | | | | | | | R=scroggo@google.com, markkilgard@gmail.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23480043 git-svn-id: http://skia.googlecode.com/svn/trunk@11141 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rewrite SkTRegistry to take any trivially-copyable type.Gravatar mtklein@google.com2013-09-04
| | | | | | | | | | | | | | 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
* Handle SkStream::rewind properly.Gravatar scroggo@google.com2013-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove dependency on getLength from webp decoder.Gravatar scroggo@google.com2013-08-21
| | | | | | | | | | | | | | | | | In webp_parse_header, continue reading until end of stream is reached, or we have read WEBP_VP8_HEADER_SIZE bytes. Do not check to see if the stream was too short, since it may not have a way to report its length, and WEBP_VP8_HEADER_SIZE is padded slightly. Instead, depend on WebPGetFeatures to report that the stream did not have enough data. In webp_idecode, only check length if it is available. BUG=https://b.corp.google.com/issue?id=8432093 R=djsollen@google.com, vikasa@google.com Review URL: https://codereview.chromium.org/22841005 git-svn-id: http://skia.googlecode.com/svn/trunk@10848 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reland "Make WebP decoding independent of stream length."Gravatar scroggo@google.com2013-08-09
| | | | | | | | | | | | | This reverts commit 1de924955b103c4f5dc9c46a06527d6a37e6cb70. When reading the stream, only read as much as will fit in the allocated buffer. BUG=skia:1495 Review URL: https://codereview.chromium.org/22629010 git-svn-id: http://skia.googlecode.com/svn/trunk@10665 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r10651: Make WebP decoding independent of stream length.Gravatar jvanverth@google.com2013-08-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10656 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make WebP decoding independent of stream length.Gravatar djsollen@google.com2013-08-09
| | | | | | | | | | | | | There's a case in Android, when the SkStream passed to WebP decoder may have incorrect length (stream->getLength()). This is observed, if the App decodes an image (size > 80KB) using: 'ParcelFileDescriptor --> BitmapFactory.decodeStream()'. This CL updates the WebP incremental decoding loop to not rely on stream->getLength(). R=scroggo@google.com, vikasa@google.com Review URL: https://codereview.chromium.org/22672003 git-svn-id: http://skia.googlecode.com/svn/trunk@10651 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove bitmap reuse from SkImageDecoder.Gravatar scroggo@google.com2013-07-09
| | | | | | | | | | | | | | | 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
* Add an option to create unpremultiplied bitmaps.Gravatar scroggo@google.com2013-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* remove unneeded reference to SkTScopedPtrGravatar commit-bot@chromium.org2013-05-09
| | | | | | | | | | R=djsollen@google.com, scroggo@google.com Author: reed@google.com Review URL: https://chromiumcodereview.appspot.com/14057013 git-svn-id: http://skia.googlecode.com/svn/trunk@9075 2bbb7eff-a529-9590-31e7-b0007b416f81
* Test region decoding in skimage, plus fixes.Gravatar scroggo@google.com2013-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Updates to skimage tool to use it for testing.Gravatar scroggo@google.com2013-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* fix (bool) warning with SkToBoolGravatar reed@google.com2013-03-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8160 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix window's build errorsGravatar commit-bot@chromium.org2013-03-14
| | | | | | | | | | Author: djsollen@google.com Reviewed By: bsalomon@google.com,borenet@google.com,reed@google.com Review URL: https://chromiumcodereview.appspot.com/12668007 git-svn-id: http://skia.googlecode.com/svn/trunk@8158 2bbb7eff-a529-9590-31e7-b0007b416f81
* Upstream Android modifications to the image encoders/decoders.Gravatar commit-bot@chromium.org2013-03-14
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