skia2/gyp/images.gyp
halcanary@google.com 2c7c7ee47d Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache
Removed SkBitmapFactory since no clients were using it.  New cache
selection mechanism can simply pass a SkDiscardableMemory::Factory
into the SkDiscardablePixelRef if non-default SkDiscardableMemory
should be used.  Removed BitmapFactoryTest.

SkDiscardableMemory::Factory interface.  Android will need this
functionality in the future inside their BitmapFactory.

Removed SkLazyPixelRef, since it's functionality is now subsumed into
SkDiscardablePixelRef.  Removed LazyPixelRef test.

Modified SkDiscardablePixelRef to optionally allow it to use a
SkDiscardableMemory::Factory.  This tiny change makes it a replacement
for SkLazyPixelRef.  This functioanlity is also necessary for moving
Android over to SkDiscardablePixelRef from SkImageRef in a later CL.
Added a test for this.

SkDecodingImageGenerator::Install can optionally pass a factory in to
SkDiscardablePixelRef.

Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache.
This functionality can be handled much more cleanly by
SkDiscardableMemory.

New SkDiscardableMemoryPool class to replace SkLruImageCache.  In a
later CL, we will replace SkImageRef_GlobalPool (used by android) as
well.  This is a concrete implementation of
SkDiscardableMemory::Factory.  Added a test for this.

modified gm/factory.cpp to remove dependnce on SkBitmapFactory +
SkLruImageCache.  Now uses SkDecodingImageGenerator +
SkDiscardablePixelRef + SkDiscardableMemoryPool.

SkImageDecoder::Target replaces SkBitmapFactory::Target.  The
DecodeMemoryToTarget function may disappear in the future.

Moved SkLazyCachingPixelRef::DecodeProc replaces
SkBitmapFactory::DecodeProc.  This is a short term change, since
another CL changes SkLazyCachingPixelRef to use SkImageGenerator
instead of DecodeProc.

Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of
SkLazyPixelRef.

tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator +
SkDiscardablePixelRef instead of a SkBitmapFactory.

bench_pictures uses the Global SkDiscardableMemoryPool instead of a
global gLruImageCache.

R=reed@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/103033002

git-svn-id: http://skia.googlecode.com/svn/trunk@12515 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-05 18:31:42 +00:00

178 lines
5.8 KiB
Python

# GYP file for images project.
{
'targets': [
{
'target_name': 'images',
'product_name': 'skia_images',
'type': 'static_library',
'standalone_static_library': 1,
'dependencies': [
'core.gyp:*',
'libjpeg.gyp:*',
'libwebp.gyp:libwebp',
'utils.gyp:utils',
],
'export_dependent_settings': [
'libjpeg.gyp:*',
],
'include_dirs': [
'../include/images',
'../include/lazy',
'../src/lazy',
# for access to SkErrorInternals.h
'../src/core/',
# for access to SkImagePriv.h
'../src/image/',
# So src/ports/SkImageDecoder_CG can access SkStreamHelpers.h
'../src/images/',
],
'sources': [
'../include/images/SkForceLinking.h',
'../include/images/SkImageRef.h',
'../include/images/SkImageRef_GlobalPool.h',
'../src/images/SkJpegUtility.h',
'../include/images/SkMovie.h',
'../include/images/SkPageFlipper.h',
'../src/images/bmpdecoderhelper.cpp',
'../src/images/bmpdecoderhelper.h',
'../src/images/SkDecodingImageGenerator.cpp',
'../src/images/SkDecodingImageGenerator.h',
'../src/images/SkForceLinking.cpp',
'../src/images/SkImageDecoder.cpp',
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_FactoryRegistrar.cpp',
# If decoders are added/removed to/from (all/individual)
# platform(s), be sure to update SkForceLinking.cpp
# so the right decoders will be forced to link.
'../src/images/SkImageDecoder_libbmp.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkImageDecoder_libico.cpp',
'../src/images/SkImageDecoder_libjpeg.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkImageDecoder_libwebp.cpp',
'../src/images/SkImageDecoder_wbmp.cpp',
'../src/images/SkImageEncoder.cpp',
'../src/images/SkImageEncoder_Factory.cpp',
'../src/images/SkImageEncoder_argb.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/images/SkStreamHelpers.cpp',
'../src/images/SkStreamHelpers.h',
'../src/ports/SkImageDecoder_CG.cpp',
'../src/ports/SkImageDecoder_WIC.cpp',
],
'conditions': [
[ 'skia_os == "win"', {
'sources!': [
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkMovie_gif.cpp',
],
'link_settings': {
'libraries': [
'-lwindowscodecs.lib',
],
},
},{ #else if skia_os != win
'sources!': [
'../src/ports/SkImageDecoder_WIC.cpp',
],
}],
[ 'skia_os in ["mac", "ios"]', {
'sources!': [
'../src/images/SkImageDecoder_FactoryDefault.cpp',
'../src/images/SkImageDecoder_libpng.cpp',
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkMovie_gif.cpp',
],
},{ #else if skia_os != mac
'sources!': [
'../src/ports/SkImageDecoder_CG.cpp',
],
}],
[ 'skia_os in ["linux", "freebsd", "openbsd", "solaris"]', {
# Any targets that depend on this target should link in libpng, libgif, and
# our code that calls it.
# See http://code.google.com/p/gyp/wiki/InputFormatReference#Dependent_Settings
'link_settings': {
'libraries': [
'-lgif',
'-lpng',
'-lz',
],
},
# end libpng/libgif stuff
}],
# FIXME: NaCl should be just like linux, etc, above, but it currently is separated out
# to remove gif. Once gif is supported by naclports, this can be merged into the above
# condition.
[ 'skia_os == "nacl"', {
'sources!': [
'../src/images/SkImageDecoder_libgif.cpp',
'../src/images/SkMovie_gif.cpp',
],
'link_settings': {
'libraries': [
'-lpng',
'-lz',
],
},
}],
[ 'skia_os == "android"', {
'include_dirs': [
'../src/utils',
],
'dependencies': [
'android_deps.gyp:gif',
'android_deps.gyp:png',
],
'export_dependent_settings': [
'android_deps.gyp:png'
],
},{ #else if skia_os != android
'sources!': [
'../src/images/SkImageRef_ashmem.h',
'../src/images/SkImageRef_ashmem.cpp',
],
}],
[ 'skia_os == "chromeos"', {
'dependencies': [
'chromeos_deps.gyp:gif',
],
'link_settings': {
'libraries': [
'-lpng',
],
},
}],
[ 'skia_os == "ios"', {
'include_dirs': [
'../include/utils/mac',
],
}],
],
'direct_dependent_settings': {
'include_dirs': [
'../include/images',
'../include/lazy',
],
},
},
],
}