aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
Commit message (Collapse)AuthorAge
* Only use JDCT_FAST if it is supported in jpeg.Gravatar scroggo@google.com2013-04-12
| | | | | | | | Fixes a bug where jpeg decoder did not work on linux. Review URL: https://codereview.chromium.org/14188002 git-svn-id: http://skia.googlecode.com/svn/trunk@8661 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warning (again) for SkMovieGravatar reed@google.com2013-03-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8336 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warning for SkMovieGravatar reed@google.com2013-03-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8332 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update code to use helper function for better readability/searching.Gravatar djsollen@google.com2013-03-21
| | | | | | Review URL: https://codereview.chromium.org/12834012 git-svn-id: http://skia.googlecode.com/svn/trunk@8287 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fail to return a codec if the provided stream does not support rewind.Gravatar djsollen@google.com2013-03-20
| | | | | | Review URL: https://codereview.chromium.org/12545052 git-svn-id: http://skia.googlecode.com/svn/trunk@8277 2bbb7eff-a529-9590-31e7-b0007b416f81
* Upstream changes from Android for decoding jpeg images.Gravatar djsollen@google.com2013-03-20
| | | | | | Review URL: https://codereview.chromium.org/12438025 git-svn-id: http://skia.googlecode.com/svn/trunk@8267 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SK_ENABLE_LIBPNG define as it is no longer needed by Android.Gravatar djsollen@google.com2013-03-20
| | | | | | Review URL: https://codereview.chromium.org/12958002 git-svn-id: http://skia.googlecode.com/svn/trunk@8262 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkStream::NewFromFile()Gravatar mike@reedtribe.org2013-03-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8210 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8168 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
* Make SkTDArray accessors const-friendly.Gravatar commit-bot@chromium.org2013-02-28
| | | | | | | | This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed. Review URL: https://chromiumcodereview.appspot.com/12315131 git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix a bunch of warnings, mainly around rowBytes.Gravatar scroggo@google.com2013-02-25
| | | | | | | | | | | My recent change changed the way SkBitmap::fRowBytes is stored, and parameter/return values referring to rowBytes were changed to type size_t. Change the storage back, and eliminate warnings resulting from returning a size_t. Review URL: https://codereview.appspot.com/7396059 git-svn-id: http://skia.googlecode.com/svn/trunk@7855 2bbb7eff-a529-9590-31e7-b0007b416f81
* move SkFDStream out of images into coreGravatar reed@google.com2013-02-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7846 2bbb7eff-a529-9590-31e7-b0007b416f81
* Create SkLazyPixelRef which performs lazy decoding.Gravatar scroggo@google.com2013-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new pixel ref behaves similarly to SkImageRef, with some key differences: It does not depend on the images project. It requires an SkImageCache, which handles allocation and caching of the pixel memory. It takes a function signature for decoding which decodes into already allocated pixel memory rather than into an SkBitmap. Add two implementations of SkImageCache: SkLruImageCache and SkAshmemImageCache. Replace SkSerializationHelpers::DecodeBitmap with SkPicture::InstallPixelRefProc, and update sites that referenced it. SkBitmapFactory now sets the pixel ref to a new object of the new class SkLazyPixelRef, provided it has an SkImageCache for caching. Provide an option to do lazy decodes in render_pictures and bench_pictures. SkPicture: Eliminate the default parameters in the constructor. If a proc for decoding bitmaps is installed, use it to decode any encoded data in subpictures. When parsing deserializing subpictures, check for success. When serializing subpictures, pass the picture's bitmap encoder to the subpicture's call to serialize. Update BitmapFactoryTest to test its new behavior. BUG=https://code.google.com/p/skia/issues/detail?id=1008 BUG=https://code.google.com/p/skia/issues/detail?id=1009 Review URL: https://codereview.appspot.com/7060052 git-svn-id: http://skia.googlecode.com/svn/trunk@7835 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix errors when compiling with -Wall -Werror on Android.Gravatar djsollen@google.com2013-02-07
| | | | | | | | This CL also turns those features on by default on Android Review URL: https://codereview.appspot.com/7313049 git-svn-id: http://skia.googlecode.com/svn/trunk@7645 2bbb7eff-a529-9590-31e7-b0007b416f81
* landing https://codereview.appspot.com/7225077/ -- tweak for GIF 5.x apiGravatar reed@google.com2013-02-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7523 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix android errors when unflattening an SkImageRef_ashmem object.Gravatar djsollen@google.com2013-02-01
| | | | | | Review URL: https://codereview.appspot.com/7228071 git-svn-id: http://skia.googlecode.com/svn/trunk@7514 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* kill unused SkFlipPixelRefGravatar reed@google.com2012-12-13
| | | | | | Review URL: https://codereview.appspot.com/6949043 git-svn-id: http://skia.googlecode.com/svn/trunk@6781 2bbb7eff-a529-9590-31e7-b0007b416f81
* Create a factory to decode an SkBitmap from an SkData.Gravatar scroggo@google.com2012-11-29
| | | | | | | | | | | | | | | | Add a test and a GM for the factory, and a PNG file for it to decode. The PNG file is copyright-free, obtained from http://openclipart.org/detail/29213/paper-plane-by-ddoo In cmykjpeg, do not attempt to decode in the constructor, since it currently crashes on Mac (if you provide the correct resource path). Even when we fix this crash there is no need to do it in the constructor, since we create all of the gms in order to get their names (to determine whether to run them). Review URL: https://codereview.appspot.com/6847122 git-svn-id: http://skia.googlecode.com/svn/trunk@6618 2bbb7eff-a529-9590-31e7-b0007b416f81
* Extract transform_scanline_XXXX functions into transform_scanline.h for ↵Gravatar epoger@google.com2012-11-16
| | | | | | | | code-sharing Review URL: https://codereview.appspot.com/6849065 git-svn-id: http://skia.googlecode.com/svn/trunk@6468 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add the ability to provide function pointers to SkPicture serializationGravatar scroggo@google.com2012-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and deserialization for encoding and decoding bitmaps. Remove kForceFlattenBitmapPixels_Flag, which is no longer used. When an SkOrderedReadBuffer needs to read a bitmap, if it does not have an image decoder, use a dummy bitmap. In GM, add a tolerance option for color differences, used when testing picture serialization, so it can assume two images are the same even though PNG encoding/decoding may have resulted in small differences. Create dummy implementations for SkImageDecoder and SkImageEncoder functions in SkImageDecoder_empty so that a project that does not want to include the images project it can still build. Allow ports to build without images project. In Mac's image encoder, copy 4444 to 8888 before encoding. Add SkWriter32::reservePad, to provide a pointer to write non 4 byte aligned data, padded with zeroes. In bench_ and render_ pictures, pass decode function to SkPicture creation from a stream. BUG=https://code.google.com/p/skia/issues/detail?id=842 Review URL: https://codereview.appspot.com/6551071 git-svn-id: http://skia.googlecode.com/svn/trunk@5818 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make flattenables no longer depend on global static initializers.Gravatar scroggo@google.com2012-09-21
| | | | | | | | | | | | | | | | | Instead, force all builds to call InitializeFlattenables. Remove the make_debugger script, which was created to force rebuilding without global static initializers so that all flattenables would be linked. It is no longer necessary since all flattenables will be linked thanks to InitializeFlattenables, which now can (and must) be called when global static initializers are turned on. BUG=https://code.google.com/p/skia/issues/detail?id=903 BUG=https://code.google.com/p/skia/issues/detail?id=902 Review URL: https://codereview.appspot.com/6548044 git-svn-id: http://skia.googlecode.com/svn/trunk@5642 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part II of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6474054 git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update SkFlattenable buffers to be more modular.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6448095 git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove duplicate definition of SkAlign8()Gravatar reed@google.com2012-06-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4363 2bbb7eff-a529-9590-31e7-b0007b416f81
* Expanded distribution of instance countingGravatar robertphillips@google.com2012-06-21
| | | | | | | | http://codereview.appspot.com/6300114/ git-svn-id: http://skia.googlecode.com/svn/trunk@4291 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warnings on Mac in src/imagesGravatar caryclark@google.com2012-06-06
| | | | | | | | | | | | | | | | | | Fix these class of warnings: - unused functions - unused locals - sign mismatch - missing function prototypes - missing newline at end of file - 64 to 32 bit truncation The changes prefer to link in dead code in the debug build with 'if (false)' than to comment it out, but trivial cases are commented out or sometimes deleted if it appears to be a copy/paste error. Review URL: https://codereview.appspot.com/6299048 git-svn-id: http://skia.googlecode.com/svn/trunk@4179 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mutexes in pixelrefs were done very sloppily initially. The code (a) assumes allGravatar reed@google.com2012-05-17
| | | | | | | | | | | | | | | | | | | | 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. Review URL: https://codereview.appspot.com/6199075 git-svn-id: http://skia.googlecode.com/svn/trunk@3985 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove unused android code in JPEG decoder.Gravatar djsollen@google.com2012-04-05
| | | | | | Review URL: https://codereview.appspot.com/5986047 git-svn-id: http://skia.googlecode.com/svn/trunk@3614 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleanup code related to SkFlattenable::flatten()Gravatar djsollen@google.com2012-03-29
| | | | | | | | | | | | | | | | | The following changes were made by this CL: 1. Make flatten() a protected method as callers should use SkFlattenableWriteBuffer to flatten an object 2. Make flatten a const method (including subclasses) 3. Mark subclass implementation of flatten with SK_OVERRIDE 4. Ensure overridden flatten impls call their parent 5. Remove no-op implementations of flatten from subclasses Additionally, if necessary the unflattening constructor was also moved to the protected section of the subclasses header if it was not already there. git-svn-id: http://skia.googlecode.com/svn/trunk@3540 2bbb7eff-a529-9590-31e7-b0007b416f81
* Consolidate PixelRef flattables with the standard implGravatar djsollen@google.com2012-03-28
| | | | | | | | | | The flatten method on these functions can no longer be const as SkFlattenables declaration is not const and would result in the const methods only being called when the reference to the object was const. Review URL: https://codereview.appspot.com/5941043 git-svn-id: http://skia.googlecode.com/svn/trunk@3533 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix a bunch of Coverity defects - class members not initialized in the ↵Gravatar vandebo@chromium.org2012-03-28
| | | | | | | | | | constructor. CID=14533,14036,9275,9271,4156,4153,4151,1666,1665,1618,1617,1616,1615 Review URL: https://codereview.appspot.com/5940049 git-svn-id: http://skia.googlecode.com/svn/trunk@3532 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove unused classes from the build.Gravatar djsollen@google.com2012-03-28
| | | | | | Review URL: https://codereview.appspot.com/5938053 git-svn-id: http://skia.googlecode.com/svn/trunk@3529 2bbb7eff-a529-9590-31e7-b0007b416f81
* Improved codec link-forcing system by adding Encoder/Decoder creation entry ↵Gravatar robertphillips@google.com2012-03-23
| | | | | | | | | | | points http://codereview.appspot.com/5881055/ git-svn-id: http://skia.googlecode.com/svn/trunk@3481 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding CMYK jpeg changes w/o .gyp alterationsGravatar robertphillips@google.com2012-03-20
| | | | | | | | http://codereview.appspot.com/5785054/ git-svn-id: http://skia.googlecode.com/svn/trunk@3442 2bbb7eff-a529-9590-31e7-b0007b416f81
* reverting to 3437Gravatar robertphillips@google.com2012-03-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3439 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix for CMYK jpeg decoding issue (69 - unable to read some jpeg files on ↵Gravatar robertphillips@google.com2012-03-20
| | | | | | | | | | android) http://codereview.appspot.com/5785054/ git-svn-id: http://skia.googlecode.com/svn/trunk@3438 2bbb7eff-a529-9590-31e7-b0007b416f81
* Restore SkImageDecoder_libjpeg, which may still be used by the Android build.Gravatar tomhudson@google.com2012-03-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3304 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove libjpeg image decoder, since we've never built it since we changedGravatar tomhudson@google.com2012-03-02
| | | | | | | | | | to gyp. http://codereview.appspot.com/5722046/ git-svn-id: http://skia.googlecode.com/svn/trunk@3302 2bbb7eff-a529-9590-31e7-b0007b416f81
* Lazily allocate our global pool for imagerefsGravatar reed@google.com2012-02-16
| | | | | | Review URL: https://codereview.appspot.com/5677055 git-svn-id: http://skia.googlecode.com/svn/trunk@3211 2bbb7eff-a529-9590-31e7-b0007b416f81
* posix: Avoid static initializers in static/global mutexesGravatar digit@google.com2012-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes static initializers related to static and global mutexes from the final library's machine code when building on a pthread-capable system. We use PTHREAD_MUTEX_INITIALIZER to perform POD-style initialization. You need a line like the following to declare a global mutex with it: SkBaseMutex gMutex = { PTHREAD_MUTEX_INITIALIZER }; We introduce the SK_DECLARE_STATIC_MUTEX and SK_DECLARE_GLOBAL_MUTEX macros to be able to declare static/global mutexes in the source tree uniformly. SkMutex is now defined as a sub-class of SkBaseMutex, with standard construction/destruction semantics. This is useful if the mutex object is a member of another C++ class, or allocated dynamically. We also modify a few places to refer to SkBaseMutex instead of a SkMutex, where it makes sense. Generally speaking, client code should hold and use pointers to SkBaseMutex whenever they can now. We defined a new built-time macro named SK_USE_POSIX_THREADS to indicate that we're using a pthread-based SkThread.h interface. The macro will also be used in future patches to implement other helper thread synchronization classes. Finally, we inline the acquire() and release() functions in the case of Posix to improve performance a bit. Running: 'bench -repeat 10 -match mutex' on an Android device or a 2.4GHz Xeon Linux desktop shows the following improvements: Before After Galaxy Nexus 1.64 1.45 Nexus S 1.47 1.16 Xoom 1.86 1.66 Xeon 0.36 0.31 This removes 5 static mutex initializers from the library Review URL: https://codereview.appspot.com/5501066 git-svn-id: http://skia.googlecode.com/svn/trunk@3091 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change remaining ANDROID ifdefs to SK_BUILD_FOR_ANDROIDGravatar djsollen@google.com2012-01-09
| | | | | | Review URL: http://codereview.appspot.com/5528050 git-svn-id: http://skia.googlecode.com/svn/trunk@2990 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix return value from SkImageDecoder::DecodeFile(): false even in case ofGravatar tomhudson@google.com2012-01-03
| | | | | | | | *partial* failure. git-svn-id: http://skia.googlecode.com/svn/trunk@2941 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkDEBUGFAIL to clean up use of SkASSERT(!"text");Gravatar tomhudson@google.com2011-12-28
| | | | | | | | | | catch a couple of latent SkASSERT("text") bugs. http://codereview.appspot.com/5504090/ git-svn-id: http://skia.googlecode.com/svn/trunk@2926 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional manual global initializationGravatar caryclark@google.com2011-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | M include/effects/SkAvoidXfermode.h M include/effects/SkDiscretePathEffect.h M include/effects/Sk1DPathEffect.h M include/effects/Sk2DPathEffect.h M include/effects/SkBlurDrawLooper.h M include/effects/SkPixelXorXfermode.h M include/effects/SkDashPathEffect.h M include/effects/SkColorMatrixFilter.h M include/effects/SkEmbossMaskFilter.h M include/effects/SkLayerDrawLooper.h M include/effects/SkGroupShape.h M include/effects/SkBlurImageFilter.h M include/effects/SkRectShape.h A include/effects/SkEffects.h M include/effects/SkCornerPathEffect.h M include/effects/SkGradientShader.h M include/effects/SkBlurMaskFilter.h M include/effects/SkLayerRasterizer.h M include/core/SkMallocPixelRef.h M include/core/SkFlattenable.h M include/core/SkShape.h M include/core/SkPixelRef.h M include/core/SkGraphics.h M include/core/SkPathEffect.h M include/core/SkPostConfig.h M include/core/SkXfermode.h M include/core/SkColorFilter.h M include/images/SkFlipPixelRef.h M include/images/SkImageRef_GlobalPool.h M src/effects/SkDashPathEffect.cpp M src/effects/SkColorMatrixFilter.cpp M src/effects/SkBlurImageFilter.cpp M src/effects/SkGroupShape.cpp M src/effects/SkCornerPathEffect.cpp M src/effects/SkGradientShader.cpp M src/effects/SkBlurMaskFilter.cpp M src/effects/SkAvoidXfermode.cpp M src/effects/Sk2DPathEffect.cpp M src/effects/SkBlurDrawLooper.cpp M src/effects/SkPixelXorXfermode.cpp M src/effects/SkColorFilters.cpp M src/effects/SkLayerDrawLooper.cpp M src/effects/SkRectShape.cpp A src/effects/SkEffects.cpp M src/effects/SkLayerRasterizer.cpp M src/effects/SkDiscretePathEffect.cpp M src/effects/Sk1DPathEffect.cpp A src/effects/SkEffects_none.cpp M src/core/SkPixelRef.cpp M src/core/SkGraphics.cpp M src/core/SkFlattenable.cpp M src/core/SkBitmapProcShader.h M src/core/SkPathEffect.cpp M src/core/SkShape.cpp M src/core/SkXfermode.cpp M src/core/SkMallocPixelRef.cpp M src/core/SkBitmapProcShader.cpp M src/images/SkFlipPixelRef.cpp M src/images/SkImageRef_GlobalPool.cpp A src/ports/SkGlobalInitialization_chromium.cpp M src/ports/SkImageRef_ashmem.h M src/ports/SkImageRef_ashmem.cpp A src/ports/SkGlobalInitialization_default.cpp M gyp/effects.gyp M gyp/tools.gyp M gyp/ports.gyp git-svn-id: http://skia.googlecode.com/svn/trunk@2876 2bbb7eff-a529-9590-31e7-b0007b416f81
* ignore alphaBit (and mask) for 32bit images, 'cause that seems to break thisGravatar reed@google.com2011-08-05
| | | | | | | | | | | ico image http://images.delta.com.edgesuite.net/delta/misc/favicon.ico git-svn-id: http://skia.googlecode.com/svn/trunk@2051 2bbb7eff-a529-9590-31e7-b0007b416f81
* Break onEncode() into two functions to avoid clobbering variables withGravatar tomhudson@google.com2011-07-28
| | | | | | | | | | setjmp/longjmp; gets rid of warnings on Linux. Over-the-shoulder review by reed@. git-svn-id: http://skia.googlecode.com/svn/trunk@1989 2bbb7eff-a529-9590-31e7-b0007b416f81