aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
Commit message (Collapse)AuthorAge
...
* stop using drawSprite (at least w/ no filters) as it is going awayGravatar reed2015-11-02
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1411173010
* Supply separate flags for onBuildTileIndexGravatar msarett2015-10-15
| | | | | | | | | | | | | | | | | | | | | | This is a follow up to: https://codereview.chromium.org/1401283003/ Supply separate flags for onBuildTileIndex Since png and jpeg's implementations of onBuildTileIndex rely on modifications to their underlying libraries, rather than whether we are running on Android, use separate flags that can be disabled independently. This will allow us to easily turn off the feature. It also is a step towards building and running on other platforms for testing (e.g. valgrind/ASAN to find memory leaks etc). BUG=skia: Committed: https://skia.googlesource.com/skia/+/fc06e9c0e621744654e231ae6fa4460d88c0e27e Review URL: https://codereview.chromium.org/1402783008
* Revert of Supply separate flags for onBuildTileIndex (patchset #1 id:1 of ↵Gravatar msarett2015-10-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1402783008/ ) Reason for revert: Missing an important line. Original issue's description: > Supply separate flags for onBuildTileIndex > > This is a follow up to: > https://codereview.chromium.org/1401283003/ > > Supply separate flags for onBuildTileIndex > > Since png and jpeg's implementations of onBuildTileIndex rely on > modifications to their underlying libraries, rather than whether we are > running on Android, use separate flags that can be disabled > independently. > > This will allow us to easily turn off the feature. It also is a step > towards building and running on other platforms for testing (e.g. > valgrind/ASAN to find memory leaks etc). > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/fc06e9c0e621744654e231ae6fa4460d88c0e27e TBR=scroggo@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1394433005
* Supply separate flags for onBuildTileIndexGravatar msarett2015-10-14
| | | | | | | | | | | | | | | | | | | | This is a follow up to: https://codereview.chromium.org/1401283003/ Supply separate flags for onBuildTileIndex Since png and jpeg's implementations of onBuildTileIndex rely on modifications to their underlying libraries, rather than whether we are running on Android, use separate flags that can be disabled independently. This will allow us to easily turn off the feature. It also is a step towards building and running on other platforms for testing (e.g. valgrind/ASAN to find memory leaks etc). BUG=skia: Review URL: https://codereview.chromium.org/1402783008
* Supply separate flags for onBuildTileIndexGravatar scroggo2015-10-14
| | | | | | | | | | | | | Since png and jpeg's implementations of onBuildTileIndex rely on modifications to their underlying libraries, rather than whether we are running on Android, use separate flags that can be disabled independently. This will allow us to easily turn off the feature. It also is a step towards building and running on other platforms for testing (e.g. valgrind/ASAN to find memory leaks etc). Review URL: https://codereview.chromium.org/1401283003
* Revert of change pixel-serializer to support reencoding existing data ↵Gravatar reed2015-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #5 id:80001 of https://codereview.chromium.org/1373683003/ ) Reason for revert: Need to somehow get access to encoders in chrome -- link error on the roll since SkImageEncoder is not built as part of chrome. Original issue's description: > change pixel-serializer to support reencoding existing data > > Trying to evolve this interface so it can > - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT > - allow for encoding images as well as bitmaps (e.g. for picture serialization) > - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/13f48dc85aa68a60da66aaf39c93d527d11d1278 TBR=scroggo@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1371983003
* change pixel-serializer to support reencoding existing dataGravatar reed2015-09-28
| | | | | | | | | | | Trying to evolve this interface so it can - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT - allow for encoding images as well as bitmaps (e.g. for picture serialization) - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) BUG=skia: Review URL: https://codereview.chromium.org/1373683003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Use static_assert instead of SK_COMPILE_ASSERT.Gravatar bungeman2015-08-20
| | | | | | | Now that static_assert is allowed, there is no need to use a non- standard compile time assertion Review URL: https://codereview.chromium.org/1306443004
* 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