aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/images
Commit message (Collapse)AuthorAge
* Separate core and images project.Gravatar scroggo@google.com2013-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkImage calls functions on SkImageDecoder and SkImageEncoder. This is desired behavior, and it is also desired to include SkImage as a part of core. In order to keep core from depending on images, update SkImageDecoder_empty.cpp to implement all of SkImageDecoder and SkImageEncoder. This file will be built by chrome (in https://codereview.chromium.org/15960015). Move force_linking from SkImageDecoder.cpp to its own file. It must be called to force linking with the image decoders if desired. Call the function in tools that need it: sk_image render_pictures render_pdfs sk_hello filter bench_pictures debugger SkImageDecoder: Derive from SkNoncopyable, instead of duplicating its hiding of constructors. skhello: Return rather than trying to write a null SkData to the stream. Revert "Hamfistedly removed core dependence on images" (commit 0f05f682a90bc125323677abf3476e1027d174f5) and "Move SkImage::encode to SkImage_Codec.cpp." (commit 83e47a954d0bf65439f3d9c0c93213063dd70da3.) These two commits were temporary fixes that this change cleans up. SkSnapshot.cpp: Check for a NULL encoder returned by SkImageEncoder::Create. BUG=https://code.google.com/p/skia/issues/detail?id=1275 R=djsollen@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/15806010 git-svn-id: http://skia.googlecode.com/svn/trunk@9364 2bbb7eff-a529-9590-31e7-b0007b416f81
* add encodeData() to SkImageEncoder, and add encoding to SkImageGravatar reed@google.com2013-05-20
| | | | | | | | | BUG= R=scroggo@google.com Review URL: https://codereview.chromium.org/15002004 git-svn-id: http://skia.googlecode.com/svn/trunk@9193 2bbb7eff-a529-9590-31e7-b0007b416f81
* Provide a function to print the name of a Format.Gravatar scroggo@google.com2013-05-15
| | | | | | | | | | Also use SkToU32 instead of a flat cast. R=djsollen@google.com Review URL: https://codereview.chromium.org/14565005 git-svn-id: http://skia.googlecode.com/svn/trunk@9139 2bbb7eff-a529-9590-31e7-b0007b416f81
* Test region decoding in skimage, plus fixes.Gravatar scroggo@google.com2013-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add tests in skimage to perform region decoding. Write out a PNG of the region as well as a bitmap obtained with extractSubset for comparison. Rename decodeRegion to decodeSubset, so it will not be confused with SkRegion. (Leave a function called decodeRegion which calls decodeSubset.) Clean up some comments. Use png_set_interlaced_pass instead of modifying pass directly. Make some changes to region decoding to fix problems I discovered during testing: Only call getAddr within a valid range. Check for a NULL fInputStream. Return a boolean for whether cropBitmap succeeded. In cropBitmap, do not attempt to draw to a bitmap to an Index8 bitmap, which crashes. Use extractSubset instead. Remove an assert. R=djsollen@google.com Review URL: https://codereview.chromium.org/14567011 git-svn-id: http://skia.googlecode.com/svn/trunk@8996 2bbb7eff-a529-9590-31e7-b0007b416f81
* Updates to skimage tool to use it for testing.Gravatar scroggo@google.com2013-04-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | skimage_main.cpp: More changes in the interest of testing our decoders. force_all_opaque before writing PNG files. Test reencoding the image to its original type (if possible), and then test redecoding it (to make sure the encoding was successful). Add an option to turn off this behavior. Merge decodeFileAndWrite with decodeFile. SkImageDecoder: Add kUnknown_Type to SkImageEncoder::Types. Add a static function to get the Format of an SkStream. In getFormatName(), remove an incorrect assert. When calling the flavor of DecodeStream that returns the Format, check the stream if the decoder returns kUnknown_Format. BUG=https://code.google.com/p/skia/issues/detail?id=1241 Review URL: https://codereview.chromium.org/14363003 git-svn-id: http://skia.googlecode.com/svn/trunk@8862 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARGB image encoder for checksums.Gravatar bungeman@google.com2013-04-23
| | | | | | | https://codereview.chromium.org/14267031/ git-svn-id: http://skia.googlecode.com/svn/trunk@8831 2bbb7eff-a529-9590-31e7-b0007b416f81
* Updates to images project.Gravatar scroggo@google.com2013-04-17
| | | | | | | | | | | | | | | | | | | | | | Use the SkImageEncoder_Factory on all platforms. On Windows and Mac, register the platform's image encoder as an option for SkImageEncoder::Create. Also add more types that can be decoded. Update comments for SkImageDecoder to be more accurate. Add more types to SkImageEncoder::Type, and return the correct type of encoder, if it exists. Use a custom version of SkImageDecoder::Factory on Windows and Mac to check the stream for registered decoders before defaulting to the platform's version. Share code with the existing SkImageDecoder::Factory method. Preparation for testing decoders and encoders: BUG=https://code.google.com/p/skia/issues/detail?id=1241 Review URL: https://codereview.chromium.org/14298010 git-svn-id: http://skia.googlecode.com/svn/trunk@8730 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 unused declarationGravatar djsollen@google.com2013-03-20
| | | | | | Review URL: https://codereview.chromium.org/12704017 git-svn-id: http://skia.googlecode.com/svn/trunk@8257 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
* 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 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
* 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 I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 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
* 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
* 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
* 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
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* merge from android tree:Gravatar djsollen@google.com2011-02-23
| | | | | | | | | | | | | - optional parameters added to descriptorProc and allocPixels - clip options to image decoders - check for xfermode in blitter_a8 - UNROLL loops in blitrow reviewed by reed@google.com git-svn-id: http://skia.googlecode.com/svn/trunk@841 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional pref-config table to codecsGravatar reed@android.com2010-03-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@519 2bbb7eff-a529-9590-31e7-b0007b416f81
* refactor helper functions out of libjpeg wrapperGravatar reed@android.com2010-01-21
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@476 2bbb7eff-a529-9590-31e7-b0007b416f81
* record dither setting so we can replay it when we (re)decodeGravatar reed@android.com2009-09-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@368 2bbb7eff-a529-9590-31e7-b0007b416f81
* ws fixesGravatar reed@android.com2009-06-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@217 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional Format* parameter to decoder helper functions.Gravatar reed@android.com2009-06-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@215 2bbb7eff-a529-9590-31e7-b0007b416f81
* Honor pref config in image decoding whenever possible.Gravatar weita@google.com2009-05-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@173 2bbb7eff-a529-9590-31e7-b0007b416f81
* Simplify font-chaining (fallbacks) to have fonthost just return the nextGravatar reed@android.com2009-03-17
| | | | | | | | | | logical fontID. Extend ImageRef to accept an imagedecoder factory, to replace calling the std one. git-svn-id: http://skia.googlecode.com/svn/trunk@125 2bbb7eff-a529-9590-31e7-b0007b416f81
* see prev. checkin (missed these files). Change ownership rule for streams to theGravatar reed@android.com2009-03-16
| | | | | | | | | skia std. of receiver calls ref() if it needs to, but regardless, the caller always manages/balances its own ownership. git-svn-id: http://skia.googlecode.com/svn/trunk@121 2bbb7eff-a529-9590-31e7-b0007b416f81
* pull from android: use registry to build up list of image codecsGravatar reed@android.com2009-01-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@76 2bbb7eff-a529-9590-31e7-b0007b416f81
* separate image encode and decodeGravatar reed@android.com2009-01-06
| | | | | | | | remove obsolete build-flag for encode git-svn-id: http://skia.googlecode.com/svn/trunk@56 2bbb7eff-a529-9590-31e7-b0007b416f81
* grab from latest androidGravatar reed@android.com2008-12-17
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81