aboutsummaryrefslogtreecommitdiffstats
path: root/src/images
Commit message (Collapse)AuthorAgeFilesLines
* am 1dccc9f3: am 372648a7: Merge "Fix access to freed memory"Jean-Baptiste Queru2012-08-271-1/+1
|\ | | | | | | | | * commit '1dccc9f3e889a5b702ec201129db689ab64a5eb8': Fix access to freed memory
| * Fix access to freed memoryNikolay Pisanov2012-08-271-1/+1
| | | | | | | | | | | | | | Source should be freed after all jpeg operations completed since it is used by these operations. Change-Id: Ieb0741e1d219dc0513133a94d47df86b5f95cf29
* | DO NOT MERGE Support WebP Alpha (Lossless) imagesVikas Arora2012-08-211-12/+18
| | | | | | | | | | | | | | | | | | | | Android/Skia supports pre-multiplied Alpha. WebP image format supports Alpha via color modes MODE_RGBA & MODE_RGBA_4444 (corresponding ones for premultiplied alpha are MODE_rgbA & MODE_rgbA_4444). The pre-requisite change for this one is the libwebp patch: https://googleplex-android-review.googlesource.com/#/c/219333/ Change-Id: I30b0d8d4b0325eb3c925371ac8f3a9b7d4801639
* | Prepare Skia-Webp decoder for Alpha and lossless.Vikas Arora2012-06-071-55/+45
|/ | | | | | | | | | | Change the webp_parse_header to read appropriate header bytes (required for Alpha & lossless bit-stream); Replaced call WebPGetInfo with WebPGetFeatures to get hasAlpha information; Replaced hard-coded setIsOpaque(true) with setIsOpaque(!hasAlpha); Refactored code for setting decoder config; Change-Id: I8208233d1aaa0a213a35dd996a72e43f78901c89
* Add support for reusing bitmap in webp format.Owen Lin2012-05-174-75/+140
| | | | | | | | | Also relax the constraint of the requested region. Now, we can get a region that is partially outsides the image. bug:5884845 Change-Id: Ibf455d176653ef1cf36924d685df1920d23cb542
* Nvidia's patch for reusing bitmap in image region decoding.Owen Lin2012-05-173-25/+82
| | | | | bug: 5884845 Change-Id: Id4c13ceece618da510ed35b8fa4a69c8e1b028dd
* Cleanup pixel ref mutexes in SkiaDerek Sollenberger2012-05-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Mutexes in pixelrefs were done very sloppily initially. The code (a) assumes all pixelref subclasses want a mutex to guard their lock/unlock virtuals, and (b) most subclasses use the same mutex for *all* of their instances, even when there is no explicit need to guard modifying one instances with another. When we try drawing bitmaps from multiple threads, we are seeing a lot of slow- down from these mutexes. This CL has two changes to try to speed things up. 1. Add setPreLocked(), for pixelrefs who never need the onLockPixels virtual to be called. This speeds up those subclasses in multithreaded environs as it avoids the mutex lock all together (e.g. SkMallocPixelRef). 2. Add setMutex() to allow a subclass to change the mutex choice. ashmem wants this, since its unflattening constructor cannot pass down the null, it needs to cleanup afterwards. see https://codereview.appspot.com/6199075/ bug: 6469917 Change-Id: I81a7cfa0b2ead5a42059697eafa58de1e7a87da2
* Handle Bitmap reuse failure more gracefullyChet Haase2012-04-305-15/+55
| | | | | | | | | | | | | | | | | A feature in Android 3.0 allows Bitmaps to be reused when loading a bitmap of the same dimensions. A documented limitation is that the only formats supported are jpeg and png, the most common formats for Android. But if you actually try to do it anyway, you'll end up causing memory trashing and an eventual strange native crash. It's not pretty. This fix puts code in other possible image format decoders (gif, ico, and bmp) to return false from the onDecode() operation, which will result in an exception being thrown back to the user code. Issue #6146246 Sparodic crash in GraphicsJNI::allocateJavaPixelRef (memory corruption?) Change-Id: Ifd3e0f87c9ea6d41a37f58616e1ced0b19132056
* Skia Merge (revision 3312)Derek Sollenberger2012-03-063-16/+40
| | | | | | | This CL also includes changes made to Android's copy of Skia in their J release branch. Change-Id: Ib2baecf48004951a3ad4a1574cdc38790c814cbc
* Skia merge (revision 3022)Derek Sollenberger2012-02-0628-677/+204
| | | | | | | | This CL has companion changes to account for API updates in... (1) frameworks/base (2) external/webkit Change-Id: Ibb989e76e8bd24313849f9631dbef42cdef9eb7d
* Ignore the alpha bit for 32-bit ico images.Derek Sollenberger2011-09-061-0/+3
| | | | | | | | | | The 32-bit images have a full alpha channel so a dedicated alpha bit is unecessary. This CL mirrors an identical change in Skia... http://code.google.com/p/skia/source/detail?spec=svn2187&r=2051 bug: 5003756 Change-Id: Id3eab2e12aa49c0193d87df255a78758ba080d60
* Change #if SK_DEBUG to #ifdefRussell Brenner2011-09-011-1/+1
| | | | | | | Fixes previous CL 131603. Using bug# from original CL. Bug: 4387353 Change-Id: Ie7e78402ab7c0ab448e8cb6ad21a709ecca9daef
* Turn off uneeded debug messages in the jpeg decoder.Derek Sollenberger2011-08-301-1/+1
| | | | | bug: 4387353 Change-Id: I5c8ae97d6c3407dbdb87bd4be1078c29eb925bd6
* Add image cropping support in Skia-WebP decoder.Vikas Arora2011-07-211-39/+135
| | | | | | | | | | | Implement virtual methods 'onBuildTileIndex' & 'onDecodeRegion' for supporting image cropping for Skia-WebP image Decoder. Utilize the native rescaling+Cropping capability of WebP-Decoder to implement image cropping. - Incorporated code comments from Pascal. - Found one bug w.r.t setting SampleSize. Rectifying that in this patch. Change-Id: Ib7b04129a65ed17f845d0600f3553b9b24846838
* Implement on-the-fly image resizing (down-scaling).Vikas Arora2011-07-181-8/+17
| | | | | | | | | | | | | | | | Implement on-the-fly image resizing (down-scaling) for WebP images. The image decoder is aware of the device memory constriant via SampleSize set by the application like Webkit/WebCore. sampleSize=1 implies no down-scaling. Likewise, SampleSize=2 implies resizing image width & height by a factor of '1/2', resulting in '1/4'th size for the decoded image. SampleSize is merely a hint from the application to the decoder. Decoder may choose to ignore this hint and decode the image at full scale. Native WebP image decoder (new APIs) supports on-the-fly resizing. Making the Skia-WebP decoder 'SampleSize' aware and implementing the on-the-fly resizing in this change. Change-Id: Ibbd62baf4a6ad2d3904aafb22807f4513641e64c
* Use the WebP native color-modes for Skia-WebP-Decoder.Vikas Arora2011-07-151-308/+25
| | | | | | | | Remove the custom code for decoding WebP image. Use the native color-modes RGBA, RGBA_4444 & RGB_565 for Skia-WebP-Decoder class. - Removed other dead code as well. Change-Id: I414778b71aaea754d92ed6b07ebd7b6336e1f102
* Add support for WebP incremental decoding.Vikas Arora2011-07-071-186/+106
| | | | | | | | | | | | | | Updated the Android-Skia-WebP decoder with following changes: - Added support for incremental WebP decoding. So instead of allocating input buffer corresponding to the whole image (could be few MBs), the input is read iteratively in a buffer size of 64KB. - Refactored onDecode method (O(200) lines) to a smaller (O(30) lines) method with 2-3 helper functions. - Removed low (byte-level) parsing from this code and calling WebP public APIs for the same (like WebPGetInfo). - Incorporated Pascal's feedback. - Few more feedback from Pascal. Change-Id: I104822ec3922eca1efc19422908f07770c4c140b
* Add WebP Encoder support to SkImageEncoder.Vikas Arora2011-06-221-1/+138
| | | | | | | | Extending Skia-WebP interface to handle the WebP encoding as well. The WebP encoding is required for sharing WebP images and transcoding images from other formats like PNG/JPEG to WEBP. Change-Id: I23d52323abf5e7eec0c6d3e0159a1ca7baee468b
* Updated Skia-Webp wrapper to work with latest version (0.1.2)Vikas Arora2011-06-071-3/+3
| | | | | issue: 3291572 Change-Id: I86258b82a9105e5db459c436d8bcfa1841609ed7
* Merge "Skia Merge (revision 922)"Derek Sollenberger2011-03-152-1846/+0
|\
| * Skia Merge (revision 922)Derek Sollenberger2011-03-142-1846/+0
| | | | | | | | Change-Id: I7ed57d10905d8bad6486a4d7410165eec1cc2b4f
* | Enables logging error messages when a JPEG image cannot get decoded.Wei-Ta Chen2011-03-111-1/+1
|/ | | | | Bug: 3499587 Change-Id: I5936adadeb6c610e4e305b4c3bf1e8d4df2c2e2f
* Skia Merge (revision 808)Derek Sollenberger2011-02-234-12/+14
| | | | | | | | | | This merge has companion changes in the following projects in order to be compatible with changes to skia interfaces and practices: 1. /frameworks/base 2. /external/webkit Change-Id: I54092971305579e81a8fdb27bbe04ec340792e3b
* Add support for WebP format in SkiaEric Hassold2011-01-053-1/+656
| | | | | | | | | | This enable Skia to decode WebP images. Since BitmapFactory relies on Skia to decode images, this aims at adding support for WebP format in any application relying on BitmapFactory. Decoder relies on libwepb library, imported as external library in external/webp in Android source tree. Change-Id: I13ef4c1404b989af6a856e9150c62e297200331b
* Allow bitmap reuse with PNG decodingChet Haase2010-12-102-11/+39
| | | | Change-Id: I8ba53eb6d4b99ce6352358b666d30b7668aa834f
* Fix pixel ref counting bug in image decode.Bryan Mawhinney2010-12-101-10/+8
| | | | | | | | Previously we called bitmap->swap while in the scope of SkAutoLockPixels, which results in the swapped ref count being decremented by ~SkAutoLockPixels Change-Id: I165ab161f2db6529db2e79665981cada5ff7d54a
* Add ability to reuse bitmaps for new contentChet Haase2010-12-092-18/+49
| | | | Change-Id: Ie4919c18c0b71bc1d4b3976afd7657a8fb0fc0ef
* Add fPreferQualityOverSpeed to SkImageDecoder.Wei-Ta Chen2010-12-061-3/+12
| | | | | | | | Currently the field only affects JPEG decode, in that when it is set to true, we choose a more accurate, but slightly slower, IDCT method. Bug: 3238925 Change-Id: I7da20de7281243dc3e246b328517df10039cd290
* Fix 3117581, where BitmapRegionDecoder fails in building tile index forWei-Ta Chen2010-10-201-24/+4
| | | | | | | | | PNG files. The virtual method of building tile index in SkImageDecoder was changed to onBuildTileIndex(). SkPNGImageDecoder needs to override the method. Change-Id: I7c78844a4d4f7aadff5fa8fa1aa99173317139b2
* Fix 3071104, where decodeRegion returned false for some large image.Wei-Ta Chen2010-10-183-20/+39
| | | | | | | | | | | | decodeRegion() returns false when it cannot find a suitable color config for SkScaledBitmapSampler. Currently SkScaledBitmapSampler does not support RGB_565. If cinfo->out_color_space is set to RGB_565 and we require SkScaledBitmapSampler to do the extra sampling, we will fail in finding a suitable color config for SkScaledBitmapSampler. To fix it, we add support of RGB_565 into SkSclaedBitmapSampler. Change-Id: I506f4f8c55518ff356345e616e16c4b4cd0712de
* am 2626a123: am c408f5a2: Merge "Rename SkLargeBitmap to ↵Wei-Ta Chen2010-09-222-7/+7
|\ | | | | | | | | | | | | | | | | SkBitmapRegionDecoder (the previous renaming was reverted)." into gingerbread Merge commit '2626a12394e8b284ff7d88e0ec0e99beaa31b795' * commit '2626a12394e8b284ff7d88e0ec0e99beaa31b795': Rename SkLargeBitmap to SkBitmapRegionDecoder (the previous renaming was reverted).
| * am c408f5a2: Merge "Rename SkLargeBitmap to SkBitmapRegionDecoder (the ↵Wei-Ta Chen2010-09-222-7/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | previous renaming was reverted)." into gingerbread Merge commit 'c408f5a2507a959ee52b8d5ba25894d52f0a3b9e' into gingerbread-plus-aosp * commit 'c408f5a2507a959ee52b8d5ba25894d52f0a3b9e': Rename SkLargeBitmap to SkBitmapRegionDecoder (the previous renaming was reverted).
| | * Merge "Rename SkLargeBitmap to SkBitmapRegionDecoder (the previous renaming ↵Wei-Ta Chen2010-09-222-7/+7
| | |\ | | | | | | | | | | | | was reverted)." into gingerbread
| | | * Rename SkLargeBitmap to SkBitmapRegionDecoder (the previous renaming was ↵Wei-Ta Chen2010-09-202-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reverted). The change is identical to https://android-git.corp.google.com/g/#change,64714 . Change-Id: If0136fcc96bcdab323607b701e2ef69ddf42f63d
* | | | am 9348eeb7: am 6a7506af: Fix the sim build in master by casting void* to ↵Wei-Ta Chen2010-09-191-1/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | char* before doing arithmetic. Merge commit '9348eeb77ad70462091c8c854b52b651e392be0b' * commit '9348eeb77ad70462091c8c854b52b651e392be0b': Fix the sim build in master by casting void* to char* before doing arithmetic.
| * | | am 6a7506af: Fix the sim build in master by casting void* to char* before ↵Wei-Ta Chen2010-09-191-1/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | doing arithmetic. Merge commit '6a7506afb1bde2933f4c2d00244b4ad0d15e135c' into gingerbread-plus-aosp * commit '6a7506afb1bde2933f4c2d00244b4ad0d15e135c': Fix the sim build in master by casting void* to char* before doing arithmetic.
| | * | Fix the sim build in master by casting void* to char* before doing arithmetic.Wei-Ta Chen2010-09-201-1/+1
| | | | | | | | | | | | | | | | Change-Id: I8bd5a45ac788cbfb42048ca7527a1c941078d66b
* | | | am 2ff9c8dd: am 58971879: Add the tile-based decoding capability to the PNG ↵Joseph Wen2010-09-193-152/+435
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | decoder. Merge commit '2ff9c8dd5defefc240f1b871a6927cb4352c0077' * commit '2ff9c8dd5defefc240f1b871a6927cb4352c0077': Add the tile-based decoding capability to the PNG decoder.
| * | | am 58971879: Add the tile-based decoding capability to the PNG decoder.Joseph Wen2010-09-193-152/+435
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | Merge commit '58971879258a502a7568fbad0e6852e78c3eca3c' into gingerbread-plus-aosp * commit '58971879258a502a7568fbad0e6852e78c3eca3c': Add the tile-based decoding capability to the PNG decoder.
| | * | Add the tile-based decoding capability to the PNG decoder.Joseph Wen2010-09-203-152/+435
| | |/ | | | | | | | | | Change-Id: Ie506dbf914cca9ad8a55747657abbe2a245ef217
* | | am 89913494: am f610b335: Support various types of animation gif.Makoto Kamiya2010-09-101-75/+295
|\ \ \ | |/ / | | | | | | | | | | | | | | | Merge commit '899134948db82c4e2f529460f0d8b4f4e9077994' * commit '899134948db82c4e2f529460f0d8b4f4e9077994': Support various types of animation gif.
| * | am f610b335: Support various types of animation gif.Makoto Kamiya2010-09-101-75/+295
| |\ \ | | |/ | |/| | | | | | | | | | | | | Merge commit 'f610b3352155a903c7510e9e3a0cb0238419f7d5' into gingerbread-plus-aosp * commit 'f610b3352155a903c7510e9e3a0cb0238419f7d5': Support various types of animation gif.
| | * Support various types of animation gif.Makoto Kamiya2010-09-031-75/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | Original code only supports an animation gif whose frames are all same size and all same color format. This modification supports various type of animation gif specified in GIF89a. <http://www.w3.org/Graphics/GIF/spec-gif89a.txt> Change-Id: I517182d2d227c9330aaff1c4cebc6c02b31ff8a6
* | | am 3a1cc970: Fix bug in SkImageDecoderJoseph Wen2010-09-103-38/+23
|\ \ \ | |/ / | | | | | | | | | | | | | | | Merge commit '3a1cc9700bf928ed3b1e05c7edc543124440c54c' * commit '3a1cc9700bf928ed3b1e05c7edc543124440c54c': Fix bug in SkImageDecoder
| * | Fix bug in SkImageDecoderJoseph Wen2010-09-103-38/+23
| | | | | | | | | | | | Change-Id: I6d214e4d8cce49f7e12eeb924493161dadd5aa26
* | | am 6c2274b8: Fix SkJpegUtility bug.Joseph Wen2010-09-091-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | Merge commit '6c2274b8d00b700512b0fc53ed4f1f4e68d33272' * commit '6c2274b8d00b700512b0fc53ed4f1f4e68d33272': Fix SkJpegUtility bug.
| * | Fix SkJpegUtility bug.Joseph Wen2010-09-091-2/+2
| | | | | | | | | | | | Change-Id: Iac0ac65dd87629e274b5985f2c21e21d7e673d17
* | | am ea22e420: Fix bug in SkImageDecoder.buildTileIndex()Joseph Wen2010-09-081-3/+13
|\ \ \ | |/ / | | | | | | | | | | | | | | | Merge commit 'ea22e42026418b6b9919a94ff04930c978c4c777' * commit 'ea22e42026418b6b9919a94ff04930c978c4c777': Fix bug in SkImageDecoder.buildTileIndex()
| * | Fix bug in SkImageDecoder.buildTileIndex()Joseph Wen2010-09-091-3/+13
| | | | | | | | | | | | | | | | | | We can not determined the input SkStream length by getLength() Change-Id: I2c0420f4312736ec742da4af9b4315af3418e2c7
| * | Revert "Rename SkLargeBitmap to SkBitmapRegionDecoder."Wei-Ta Chen2010-09-082-7/+7
| | | | | | | | | | | | This reverts commit 2d8e78250676546c549082dc988e7262ab1bb154.