aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
Commit message (Collapse)AuthorAge
* Fix GIF transparency.Gravatar jei.mayol2015-02-04
| | | | | | | | | | | | | | | | | | | The GIF decoder, in the onDecode() function, tries to obtain the transparency info from the temporary SavedImage object, temp_save, but the decoder had been changed to save extension block data to the GifFileType object instead. As a result, find_transpIndex() can't find the correct transaprency index and returns -1. This had been reported in Android 4.4. AOSP pulled skia changes related to giflib 5.x changes after Android 4.3, which is why the problem is not reproducible in versions before KitKat. AOSP Issue 62016: https://code.google.com/p/android/issues/detail?id=62016 BUG=skia: Review URL: https://codereview.chromium.org/429053004
* SkStream::read() only returns 0 at end.Gravatar scroggo2015-01-29
| | | | | | | | All implementations behave this way, so respect it. BUG=skia:2936 Review URL: https://codereview.chromium.org/888703002
* Put close_gif() in an anonymous namespace.Gravatar mtklein2015-01-22
| | | | | | | | | Not a big deal, but matches the intention of it being a file-scoped function better. This mirrors a recent google3 change for clients who don't use C++11. BUG=skia: Review URL: https://codereview.chromium.org/865243002
* Muck with the right cinfo.Gravatar scroggo2015-01-22
| | | | | | | | | | | In SkImageDecoder_libjpeg, modify cinfo *after* destroying it and creating a new one in its place. Should fix build breakage. Committed: https://skia.googlesource.com/skia/+/3629865bac20ae8092177f519594f79f89d09fb0 Review URL: https://codereview.chromium.org/858333002
* Revert of Muck with the right cinfo. (patchset #2 id:20001 of ↵Gravatar bungeman2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/858333002/) Reason for revert: Appears to cause Android dm to segfault. Original issue's description: > Muck with the right cinfo. > > In SkImageDecoder_libjpeg, modify cinfo *after* destroying it and > creating a new one in its place. > > Should fix build breakage. > > Committed: https://skia.googlesource.com/skia/+/3629865bac20ae8092177f519594f79f89d09fb0 TBR=scroggo@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/858323003
* Muck with the right cinfo.Gravatar scroggo2015-01-21
| | | | | | | | | In SkImageDecoder_libjpeg, modify cinfo *after* destroying it and creating a new one in its place. Should fix build breakage. Review URL: https://codereview.chromium.org/858333002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* Upstream support for giflib >= 5.1.Gravatar mtklein2015-01-20
| | | | | | | | | | | | | | DGifCloseFile now takes two arugments. The second argument appears to be an optional out-param with more information on failures. ( c.f. http://giflib.sourceforge.net/gif_lib.html ) PS 1 is the original patch we received from google3. I've updated it a bit to be pedantically legal C++98. BUG=skia: Review URL: https://codereview.chromium.org/860853003
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* remove dead SK_SUPPORT_LEGACY_IMAGEDECODER_CHOOSER codeGravatar reed2014-12-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/816273002
* add const to encodePixels pixel parameterGravatar reed2014-12-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/788143007
* Fix a case of kPartialSuccess.Gravatar scroggo2014-12-17
| | | | | | | | | | | | Missed in https://codereview.chromium.org/647023006/ When JPEG decoder does not have the remainder of the image, it should return kPartialSuccess. BUG:b/17419670 BUG:b/18769124 Review URL: https://codereview.chromium.org/807983002
* Cleanup: Mark some overridden methods with 'SK_OVERRIDE'.Gravatar tfarina2014-12-14
| | | | | | | | | | | | | | This fixes errors like this: ../../include/gpu/effects/GrPorterDuffXferProcessor.h:27:25: error: 'name' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] BUG=skia:3075 TEST=ninja -C out/Debug skia_lib TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/804813002
* Even more win64 warning fixesGravatar bsalomon2014-12-12
| | | | Review URL: https://codereview.chromium.org/800993002
* SkColorTable locking serves no purpose anymore.Gravatar mtklein2014-12-02
| | | | | | | | | The only thing the unlock methods were doing was assert their balance. This removes the unlock methods and renames the lock methods "read". BUG=skia: Review URL: https://codereview.chromium.org/719213008
* Add tests (and fix!) for known bad ICO files.Gravatar scroggo2014-11-10
| | | | | | | | | | | | We previously saw crashes decoding bad ICO files. Add tests for known bad files. While testing, I learned that one of them still crashes. Check for large offset and size separately to fix the crash. BUG=skia:2878 Review URL: https://codereview.chromium.org/712123002
* Allow index sources to be unpremul.Gravatar scroggo2014-10-27
| | | | | | | | | | | | | | | | This only affects the PNG image decoder, where we have already created the color table without premultiplication. Since the RowProcChooser is just providing a proc that chooses indices into the color table, it can just return the same RowProc. Update test_row_proc_choice. It was testing to ensure that we hadn't changed the behavior from the original version of setPrefConfigTable. In this case, we deliberately changed the behavior, so we need to change the test. BUG=b/12024301 Review URL: https://codereview.chromium.org/657863005
* Don't read random data in ICO check.Gravatar scroggo2014-10-24
| | | | | | Check to ensure SkStream::read succeeds before checking the result. Review URL: https://codereview.chromium.org/656673005
* This return_false is now only used on Android. Squelch a warning.Gravatar mtklein2014-10-23
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/659393004
* Qualify the return value of SkImageDecoder::decodeGravatar scroggo2014-10-22
| | | | | | | | | | | | | | | | | | | | | | | 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:b/17419670 Review URL: https://codereview.chromium.org/647023006
* Clean up some warnings about unused code.Gravatar mtklein2014-10-21
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/663093004
* Make SkImageDecoder_libpng be compilable with Chromium libpngGravatar kkinnunen2014-10-19
| | | | | | | | | | | | | Chromium has libpng with pngusr.h that disables certain functionality with defines. Use those defines when compiling SkImageDecoder_libpng.cpp. This makes it possible to use Skia PNG decoder and encoder when compiling dm with Chromium. Skia PNG decoder and encoder of course is not compiled to the skia library, but to dm with Chromium. BUG=skia:2992 Review URL: https://codereview.chromium.org/645883004
* JPEG YUV DecodingGravatar sugoi2014-10-16
| | | | | | | | | | Enabling JPEG YUV Decoding in Skia BUG=skia:3005, skia:1674, skia:3029 Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f Review URL: https://codereview.chromium.org/399683007
* Revert of JPEG YUV Decoding (patchset #5 id:180001 of ↵Gravatar rmistry2014-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/399683007/) Reason for revert: Caused many test bots to go red: http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/22/steps/dm/logs/stdio http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Link-HD4000-x86_64-Debug/builds/168/steps/dm/logs/stdio http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/38/steps/dm/logs/stdio Original issue's description: > JPEG YUV Decoding > > Enabling JPEG YUV Decoding in Skia > > BUG=skia:3005, skia:1674 > > Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f TBR=reed@google.com,scroggo@google.com,sugoi@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia:3005, skia:1674 Review URL: https://codereview.chromium.org/656163002
* JPEG YUV DecodingGravatar sugoi2014-10-15
| | | | | | | | Enabling JPEG YUV Decoding in Skia BUG=skia:3005, skia:1674 Review URL: https://codereview.chromium.org/399683007
* remove alphatype from colortableGravatar reed2014-09-29
| | | | | | | | | | | the owning bitmap is (already) responsible for knowing the alphatype BUG=skia: R=djsollen@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/611093002
* use SkData::NewUninitializedGravatar reed2014-09-12
| | | | | | | | | BUG=skia: R=bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/565803005
* SkData can allocate room for its contents in the same blockGravatar reed2014-09-11
| | | | | | | | | BUG=skia: R=bungeman@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/560653004
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Hide fields in SkImageInfoGravatar reed2014-09-03
| | | | | | | | | R=rmistry@google.com TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/536003002
* make allocPixels throw on failureGravatar reed2014-09-02
| | | | | | | | | BUG=skia: R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/510423005
* Ensure that we don't reference decoders that we don't buildGravatar djsollen2014-08-28
| | | | | | | | R=scroggo@google.com, robertphillips@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/517663002
* Prevent malformed ICO files from recursively decodingGravatar djsollen2014-08-26
| | | | | | | | R=reed@google.com, scroggo@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/511453002
* Fix overflow when comparing two ints by promoting the sum to 64-bits.Gravatar djsollen2014-08-26
| | | | | | | | R=reed@google.com, scroggo@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/505153003
* eliminate code related to SkBitmap::ConfigGravatar reed2014-08-18
| | | | | | | | | BUG=skia: R=reed@google.com, mike@reedtribe.org Author: reed@chromium.org Review URL: https://codereview.chromium.org/483593002
* Add astcbitmap to gm slides.Gravatar krajcevski2014-08-07
| | | | | | | | | | | Add additional ASTC formats. Add astc image decoder files. R=reed@google.com, robertphillips@google.com, halcanary@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/444093002
* Revert of - Add astcbitmap to gm slides ↵Gravatar krajcevski2014-08-07
| | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/444093002/) Reason for revert: Breaking DM Original issue's description: > - Add astcbitmap to gm slides > - Add additional ASTC formats > - Add astc image decoder files > > Committed: https://skia.googlesource.com/skia/+/2fc05823fed4b9649338f3029cd1ba05ef49a02f R=reed@google.com, robertphillips@google.com, halcanary@google.com TBR=halcanary@google.com, reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: krajcevski@google.com Review URL: https://codereview.chromium.org/447343002
* - Add astcbitmap to gm slidesGravatar krajcevski2014-08-07
| | | | | | | | | | | - Add additional ASTC formats - Add astc image decoder files R=reed@google.com, robertphillips@google.com, halcanary@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/444093002
* Add support for compressed alpha ktx filesGravatar krajcevski2014-08-07
| | | | | | | | R=robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/447283002
* Add support for all compressed formats in KTX file formatGravatar krajcevski2014-08-05
| | | | | | | | R=robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/440783004
* Add ETC1 format to SkTextureCompressorGravatar krajcevski2014-08-05
| | | | | | | | R=robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/432143002
* Revert of Add ETC1 format to SkTextureCompressor ↵Gravatar krajcevski2014-08-04
| | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/432143002/) Reason for revert: Breaking Chrome. Original issue's description: > Add ETC1 format to SkTextureCompressor > > Committed: https://skia.googlesource.com/skia/+/5d8b1b44ea7636fc8e98247cb311568f277ce3a5 R=robertphillips@google.com TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: krajcevski@google.com Review URL: https://codereview.chromium.org/438443004
* Add ETC1 format to SkTextureCompressorGravatar krajcevski2014-08-04
| | | | | | | | R=robertphillips@google.com Author: krajcevski@google.com Review URL: https://codereview.chromium.org/432143002
* Fix image decoder memory overwrite bug.Gravatar scroggo2014-07-25
| | | | | | | | | | | | | | | | 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. Bug=b/13921093 R=djsollen@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/423473003
* ios fixesGravatar caryclark2014-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | skia_ios.mm Get the app's Documents directory and pass use it to set the resource path. This is a quick hack which will be replaced by a new application that is a tiny shim around a command line tool. SkImageEncoder.h SkForceLinking.cpp SkImageDecoder_CG.cpp Add support for FORCE_LINKING so iOS sees the PNG encoder and others. SkFloatBits.cpp SkPoint.cpp Handle denormalized numbers that are floored by the iOS ARM processor. SkImageDecoder_iOS.mm Remove empty encoder factory. SkTouchGesture.cpp Return early on empty state on touch rather than aborting (crashing) JpegTest.cpp Hal via stackoverflow.com says partial jpegs can be gray as well. skia_test.cpp Remove crash handler call for now to avoid link failure. OverwriteLine.h Remove fancy line overwrite for iOS. Resources.cpp Add interface to set resource directory based on runtime query. BUG=skia:2736 skia:2737 skia:2738 R=reed@google.com, halcanary@google.com, mtklein@google.com, tfarina@chromium.org Author: caryclark@google.com Review URL: https://codereview.chromium.org/373383003
* Handle bad ICO data better.Gravatar scroggo2014-07-09
| | | | | | | | | | | | | | Interpret size and offset as size_t, as they should be. When read as int, they could be negative values. If they are negative (rather than positive and very large), they will not allow us to fail the length test, resulting in trying to read uninitialized memory. BUG=b/16010240 R=halcanary@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/374413005
* add setPreserveSrcDepth to replace PrefTable API for androidGravatar reed2014-07-08
| | | | | | | | | BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/371273007
* fix WBMP image will get null color table when draw in RGB565 CanvasGravatar Derek Sollenberger2014-07-08
| | | | | | | | | | | | | Symptom: draw Index8 to RGB565 will using SkColorTable::lock16BitCache and return a null array. Root Cause:lock16BitCache return null pointer because default type is kPremul_SkAlphaType Solution: WBMP color table should be kOpaque_SkAlphaType Reproduce steps: draw a WBMP with a matrix that apply rotate and transform This patch was proposed by arthur_hung at htc.com to the AOSP project. R=reed@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/377443007
* Check pixelRef before attempting to ktx encode.Gravatar scroggo2014-07-02
| | | | | | | | | | | | | | If there is no pixelRef, do not attempt to dereference it. This was caught running on Android, where we don't have the resources folder (tracked in b/14406768). We fail to decode anything, and then attempt to encode an SkBitmap without a pixelRef. R=krajcevski@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/362413005
* Adjust the alpha type for pixelRefs.Gravatar scroggo2014-07-01
| | | | | | | | | | | | | | Move SkBitmap's validate_alphaType to SkImageInfo, with the new name SkColorTypeValidateAlphaType. Use it in SkPixelRef's constructors, as well as in SkDecodingImageGenerator. This fixes a bug where an SkPixelRef's SkAlphaType could get out of sync with its SkBitmap, when both were assigned the same SkAlphaType. R=reed@google.com, halcanary@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/346593003