aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
Commit message (Collapse)AuthorAge
* Remove SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONSGravatar scroggo2015-07-30
| | | | | | Now that Chrome no longer depends on it, remove dead code. Review URL: https://codereview.chromium.org/1263013002
* Remove SkImageGenerator pieces only for SkCodec.Gravatar scroggo2015-07-09
| | | | | | | | | | | Follow up to the split between SkImageGenerator and SkCodec. Now that SkCodec does not inherit from SkImageGenerator, SkImageGenerator no longer needs Options or Result, which were added for SkCodec. Remove them, but keep them behind a flag, since Chromium has its own subclasses of SkImageGenerator which assume the old signature for onGetPixels. Review URL: https://codereview.chromium.org/1226023003
* Revert "Remove ambiguity of SkJpegUtility name."Gravatar scroggo2015-06-15
| | | | | | | | | | | | | TBR=mtklein This reverts commit 93858b49a9f3bd3037d61822c095ef59199870af. This revert should fix the Android framework build. NOTREECHECKS=True NOTRY=True Review URL: https://codereview.chromium.org/1187463005
* SkGIFMovie: Fix corrupted background colorGravatar Takahiro.Aizawa2015-06-15
| | | | | | | | | | | | | | | | | | The 'paintingColor' in onGetBitmap() was used to save the entire gif's background color while filling the 1st frame of a gif image, since it is 'static' qualified, so when re-entering this function for subsequent frames, this saved value will be used directly without re-obtaining it. But if asynchronous playing multi gif files in single process without being controlled, this 'static' will make the 'paintingColor' corrupted, because the different SkGIFMovie instances hold the same reference of 'paintingColor'. Signed-off-by: Lu Tong <lu.x.tong@sonymobile.com>; BUG=skia: Review URL: https://codereview.chromium.org/1184083002
* Remove ambiguity of SkJpegUtility name.Gravatar mtklein2015-06-12
| | | | | | | | | We have two, one in images/, the other in codec/. As codec's the new hotness, I left it's name vanilla and suffixed the old one. BUG=skia: Review URL: https://codereview.chromium.org/1185733002
* Eliminate the check for ANDROID_LARGE_MEMORY in jpeg decodersGravatar msarett2015-06-11
| | | | | | BUG=skia:1282 Review URL: https://codereview.chromium.org/1103313002
* remove dead code behind BOOL_ONGETINFOGravatar reed2015-05-05
| | | | | | | | | need this to land in chrome first https://codereview.chromium.org/1125573002 BUG=skia: TBR= Review URL: https://codereview.chromium.org/1123473004
* Update more directories under src/ to follow C++11 style rule for ↵Gravatar tfarina2015-04-27
| | | | | | | | | | | | | | | | | | | | | {virtual,override}. The Google style guide states that only one of {virtual,override,final} should be used for each declaration, since override implies virtual and final implies both virtual and override. The entries were found using the following command line: $ find src/ -iname "*.h" -o -iname "*.cpp" | xargs pcregrep -M "[^\n/]+virtual\ [^;{]+\ [a-zA-Z0-9_]+\([^;{]+\ override[ \n]*[;{]" The regex was a courtesy of nick@chromium.org BUG=None R=mtklein@google.com NOPRESUBMIT=true Review URL: https://codereview.chromium.org/1086143003
* Cleanup: Remove unnecessary double-semicolons.Gravatar tfarina2015-04-27
| | | | | | | | | | | | | | | The entries were found by the following command line: $ find . -regex ".*\.[cChH]\(pp\)?" | xargs git grep -e ';;' --and --not -e 'for *(.*;;' Which is a combination of http://stackoverflow.com/a/3858879 and http://gitster.livejournal.com/27674.html BUG=None R=mtklein@google.com Review URL: https://codereview.chromium.org/1088763005
* SkScaledBitmapSampler: fix memory overwrittenGravatar zoran.jovanovic2015-04-16
| | | | | | | | | | | | | | | | | | | Memory will be overwritten while downsampling some interlaced gif images, most commonly with odd sizes, when index of destination row stores in the current line computed from GifInterlaceIter meets: X is an integer in [0..height-1] and (X < height) && ((X - sampleSize/2) % sampleSize == 0) && ((X - sampleSize/2)/sampleSize >= height/sampleSize) Signed-off-by: Lu Tong <lu.x.tong@sonymobile.com> BUG=skia: Review URL: https://codereview.chromium.org/1085253002
* Return cropBitmapGravatar zoran.jovanovic2015-04-15
| | | | | | | | | | | cropBitmap returns 'true' on success and 'false' on failure. Propagate its return value so that cascading failures can be avoided. Signed-off-by: Mykola Kondratenko <mykola.kondratenko@sonymobile.com> BUG=skia: Review URL: https://codereview.chromium.org/1088093003
* Enable both static and dynamically linked libpngGravatar djsollen2015-04-03
| | | | | | | | | | | All platforms except android are configured to use the statically linked copy of libpng. Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere. This CL also enables NEON optimizations for libpng. Review URL: https://codereview.chromium.org/1058823002
* Remove all code related to NaClGravatar borenet2015-04-02
| | | | | | | BUG=skia:3600 DOCS_PREVIEW= https://skia.org/?cl=1036283002 Review URL: https://codereview.chromium.org/1036283002
* Revert of Enable both static and dynamically linked libpng (patchset #4 ↵Gravatar djsollen2015-04-01
| | | | | | | | | | | | | | | | | | | | | | | id:60001 of https://codereview.chromium.org/1032253003/) Reason for revert: breaking the nexus_9 and ios builds. Original issue's description: > Enable both static and dynamically linked libpng > > All platforms except android are configured to use the statically linked copy of libpng. Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere. > > This CL also enables NEON optimizations for libpng. > > Committed: https://skia.googlesource.com/skia/+/2469c999518e7b0063d35e9e2eb074a0477c21ac TBR=scroggo@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1050183002
* Enable both static and dynamically linked libpngGravatar djsollen2015-04-01
| | | | | | | | All platforms except android are configured to use the statically linked copy of libpng. Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere. This CL also enables NEON optimizations for libpng. Review URL: https://codereview.chromium.org/1032253003
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Lazy SKP image decoding in DM.Gravatar mtklein2015-03-25
| | | | | | | | | | | | | | | | | | | @sugoi: Early out to avoid some segfaults in SkImageDecoder_libjpeg.cpp. I am just flailing here... things seem to work, but I have no idea why. This prints out a lot: libjpeg error 85 <End Of Image> from output_raw_data [0 0] @halcanary: I'm skipping on ImageSrc for now. Leon's refactoring that quite a lot. This causes minor diffs for the GPU backend, given that we're now going through the YUV path. It also reduced peak RAM usage on my desktop from 1.26GB to 1.08GB. BUG=skia: Review URL: https://codereview.chromium.org/1010983004
* guarded change to SkImageGenerator to make getInfo() constGravatar reed2015-03-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1017293002
* Indexed PNG decoding: Ensure color table is large enough that the bit depth ↵Gravatar dml2015-03-18
| | | | | | | | | | | of the image will not allow reads beyond its end. BUG=skia:3440 R=rmistry@google.com, scroggo@google.com Committed: https://skia.googlesource.com/skia/+/493c1ce1cd406ef28683203146274154783452ce Review URL: https://codereview.chromium.org/948163002
* Revert "Indexed PNG decoding: Ensure color table is large enough that the ↵Gravatar scroggo2015-03-17
| | | | | | | | | | | | | bit depth of the image will not allow reads beyond its end." This reverts commit 493c1ce1cd406ef28683203146274154783452ce. NOTRY=true NOTREECHECKS=true TBR=egdaniel@google.com,dml@google.com BUG=skia: Review URL: https://codereview.chromium.org/1014553003
* Indexed PNG decoding: Ensure color table is large enough that the bit depth ↵Gravatar Leon Scroggins III2015-03-17
| | | | | | | | | of the image will not allow reads beyond its end. BUG=skia:3440 R=rmistry@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/948163002
* Option for SkCodec to treat dst as all zeroes.Gravatar scroggo2015-03-17
| | | | | | | This recreates SkImageDecoder's feature to skip writing zeroes for SkCodec. Review URL: https://codereview.chromium.org/980903002
* check for null-pixelrefGravatar reed2015-03-16
| | | | | | BUG=skia:3497 Review URL: https://codereview.chromium.org/1004313002
* Ico security issues fixGravatar msarett2015-03-13
| | | | | | | | BUG=skia:3401 BUG=skia:3426 BUG=skia:3441 Review URL: https://codereview.chromium.org/996173005
* Fix a memory leak when decoding corrupted indexed PNGs.Gravatar dml2015-03-11
| | | | | | | | | | Commit to branch refs/heads/png-leak BUG=skia:3457 Committed: https://skia.googlesource.com/skia/+/561a1ca9559a1ea7589ab93350124284fcef3315 Review URL: https://codereview.chromium.org/951663002
* Revert of Fix a memory leak when decoding corrupted indexed PNGs. (patchset ↵Gravatar reed2015-03-07
| | | | | | | | | | | | | | | | | | | | | | | #2 id:20001 of https://codereview.chromium.org/951663002/) Reason for revert: speculative revert due to many failures in tree Original issue's description: > Fix a memory leak when decoding corrupted indexed PNGs. > Commit to branch refs/heads/png-leak > > BUG=skia:3457 > > Committed: https://skia.googlesource.com/skia/+/561a1ca9559a1ea7589ab93350124284fcef3315 TBR=scroggo@google.com,dml@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3457 Review URL: https://codereview.chromium.org/980203005
* Fix a memory leak when decoding corrupted indexed PNGs.Gravatar dml2015-03-06
| | | | | | | | Commit to branch refs/heads/png-leak BUG=skia:3457 Review URL: https://codereview.chromium.org/951663002
* Rename onGetPixelsEnum back to onGetPixels.Gravatar scroggo2015-02-19
| | | | | | | | | | | | | | | | Replace the old signature of onGetPixels (return bool) to return an enum (Result). Remove onGetPixelsEnum. Add a define for onGetPixelsEnum to onGetPixels. This is for staging in Chromium, where some implementations override onGetPixelsEnum. Add the define in skia_for_chromium_defines. Remove SK_SUPPORT_LEGACY_IMAGE_GENERATOR_RETURN, which is no longer needed by Chromium. BUG=skia:3257 Review URL: https://codereview.chromium.org/939113002
* Fixing possible out of bound memory accessGravatar sugoi2015-02-19
| | | | | | | | This was a bug found by ASAN. When width is very small, we can have something like width == 1 and rowBytes == 8. Using "2 * yWidth" (2) would be smaller than rowBytesY (8), so we could read memory out of bounds. This issue has a separate fix in blink (crbug.com/458861). BUG=skia: Review URL: https://codereview.chromium.org/936133003
* Make SkImageGenerator::getPixels() return an enum.Gravatar scroggo2015-02-13
| | | | | | | | | | | | | | | | | | | | | | The new enum describes the nature of the failure. This is in preparation for writing a replacement for SkImageDecoder, which will use this interface. Update the comments for getPixels() to specify what it means to pass an SkImageInfo with a different size. Make SkImageGenerator Noncopyable. Leave onGetYUV8Planes alone, since we have separate discussions regarding modifying that API. Make callers of SkImageDecoder consistently handle kPartialSuccess. Previously, some callers considered it a failure, and others considered it a success. BUG=skia:3257 Review URL: https://codereview.chromium.org/919693002
* 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