7def5e1630
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
173 lines
5.5 KiB
Python
173 lines
5.5 KiB
Python
# GYP file for images project.
|
|
{
|
|
'targets': [
|
|
{
|
|
'target_name': 'images',
|
|
'product_name': 'skia_images',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'dependencies': [
|
|
'libjpeg.gyp:*',
|
|
'libwebp.gyp:libwebp',
|
|
'utils.gyp:utils',
|
|
],
|
|
'export_dependent_settings': [
|
|
'libjpeg.gyp:*',
|
|
],
|
|
'include_dirs': [
|
|
'../include/config',
|
|
'../include/core',
|
|
'../include/images',
|
|
'../include/lazy',
|
|
# for access to SkErrorInternals.h
|
|
'../src/core/',
|
|
# for access to SkImagePriv.h
|
|
'../src/image/',
|
|
],
|
|
'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/SkBitmapRegionDecoder.cpp',
|
|
|
|
'../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/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': [
|
|
'windowscodecs.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': {
|
|
'sources': [
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
],
|
|
'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': {
|
|
'sources': [
|
|
'../src/images/SkImageDecoder_libpng.cpp',
|
|
],
|
|
'libraries': [
|
|
'-lpng',
|
|
'-lz',
|
|
],
|
|
},
|
|
}],
|
|
[ 'skia_os == "android"', {
|
|
'include_dirs': [
|
|
'../src/utils',
|
|
],
|
|
'dependencies': [
|
|
'android_deps.gyp:gif',
|
|
'android_deps.gyp:png',
|
|
],
|
|
},{ #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:
|