f8d7d27313
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
152 lines
4.8 KiB
Python
152 lines
4.8 KiB
Python
{
|
|
'targets': [
|
|
{
|
|
'target_name': 'images',
|
|
'product_name': 'skia_images',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'dependencies': [
|
|
'libjpeg.gyp:*',
|
|
'utils.gyp:utils',
|
|
],
|
|
'export_dependent_settings': [
|
|
'libjpeg.gyp:*',
|
|
],
|
|
'include_dirs': [
|
|
'../include/config',
|
|
'../include/core',
|
|
'../include/images',
|
|
'../include/lazy',
|
|
# for access to SkImagePriv.h
|
|
'../src/image/',
|
|
],
|
|
'sources': [
|
|
'../include/images/SkImageDecoder.h',
|
|
'../include/images/SkImageEncoder.h',
|
|
'../include/images/SkImageRef.h',
|
|
'../include/images/SkImageRef_GlobalPool.h',
|
|
'../include/images/SkJpegUtility.h',
|
|
'../include/images/SkMovie.h',
|
|
'../include/images/SkPageFlipper.h',
|
|
|
|
'../src/images/bmpdecoderhelper.cpp',
|
|
'../src/images/bmpdecoderhelper.h',
|
|
'../src/images/SkFDStream.cpp',
|
|
'../src/images/SkImageDecoder.cpp',
|
|
'../src/images/SkImageDecoder_Factory.cpp',
|
|
'../src/images/SkImageDecoder_libjpeg.cpp',
|
|
'../src/images/SkImageDecoder_libbmp.cpp',
|
|
'../src/images/SkImageDecoder_libgif.cpp',
|
|
'../src/images/SkImageDecoder_libico.cpp',
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
'../src/images/SkImageDecoder_wbmp.cpp',
|
|
'../src/images/SkImageEncoder.cpp',
|
|
'../src/images/SkImageEncoder_Factory.cpp',
|
|
'../src/images/SkImageRef.cpp',
|
|
'../src/images/SkImageRefPool.cpp',
|
|
'../src/images/SkImageRefPool.h',
|
|
'../src/images/SkImageRef_ashmem.h',
|
|
'../src/images/SkImageRef_ashmem.cpp',
|
|
'../src/images/SkImageRef_GlobalPool.cpp',
|
|
'../src/images/SkImages.cpp',
|
|
'../src/images/SkJpegUtility.cpp',
|
|
'../src/images/SkMovie.cpp',
|
|
'../src/images/SkMovie_gif.cpp',
|
|
'../src/images/SkPageFlipper.cpp',
|
|
'../src/images/SkScaledBitmapSampler.cpp',
|
|
'../src/images/SkScaledBitmapSampler.h',
|
|
|
|
'../src/ports/SkImageDecoder_CG.cpp',
|
|
'../src/ports/SkImageDecoder_WIC.cpp',
|
|
],
|
|
'conditions': [
|
|
[ 'skia_os == "win"', {
|
|
'sources!': [
|
|
'../src/images/SkFDStream.cpp',
|
|
'../src/images/SkImageDecoder_Factory.cpp',
|
|
'../src/images/SkImageDecoder_libgif.cpp',
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
'../src/images/SkImageEncoder_Factory.cpp',
|
|
'../src/images/SkMovie_gif.cpp',
|
|
],
|
|
'link_settings': {
|
|
'libraries': [
|
|
'windowscodecs.lib',
|
|
],
|
|
},
|
|
},{ #else if skia_os != win
|
|
'sources!': [
|
|
'../src/ports/SkImageDecoder_WIC.cpp',
|
|
],
|
|
}],
|
|
[ 'skia_os in ["mac", "ios"]', {
|
|
'sources!': [
|
|
'../src/images/SkImageDecoder_Factory.cpp',
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
'../src/images/SkImageDecoder_libgif.cpp',
|
|
'../src/images/SkImageEncoder_Factory.cpp',
|
|
'../src/images/SkMovie_gif.cpp',
|
|
],
|
|
},{ #else if skia_os != mac
|
|
'sources!': [
|
|
'../src/ports/SkImageDecoder_CG.cpp',
|
|
],
|
|
}],
|
|
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris", "nacl"]', {
|
|
'sources!': [
|
|
'../src/images/SkImageDecoder_libgif.cpp',
|
|
'../src/images/SkMovie_gif.cpp',
|
|
],
|
|
# libpng stuff:
|
|
# Any targets that depend on this target should link in libpng and
|
|
# our code that calls it.
|
|
# See http://code.google.com/p/gyp/wiki/InputFormatReference#Dependent_Settings
|
|
'link_settings': {
|
|
'sources': [
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
],
|
|
'libraries': [
|
|
'-lpng',
|
|
],
|
|
},
|
|
# end libpng stuff
|
|
}],
|
|
[ 'skia_os == "android"', {
|
|
'include_dirs': [
|
|
'../src/utils',
|
|
],
|
|
'dependencies': [
|
|
'android_deps.gyp:gif',
|
|
'android_deps.gyp:png',
|
|
],
|
|
'defines': [
|
|
'SK_ENABLE_LIBPNG',
|
|
],
|
|
},{ #else if skia_os != android
|
|
'sources!': [
|
|
'../src/images/SkImageRef_ashmem.h',
|
|
'../src/images/SkImageRef_ashmem.cpp',
|
|
],
|
|
}],
|
|
[ 'skia_os == "ios"', {
|
|
'include_dirs': [
|
|
'../include/utils/mac',
|
|
],
|
|
}],
|
|
],
|
|
'direct_dependent_settings': {
|
|
'include_dirs': [
|
|
'../include/images',
|
|
'../include/lazy',
|
|
],
|
|
},
|
|
},
|
|
],
|
|
}
|
|
|
|
# Local Variables:
|
|
# tab-width:2
|
|
# indent-tabs-mode:nil
|
|
# End:
|
|
# vim: set expandtab tabstop=2 shiftwidth=2:
|