676aef05ab
The problem fixed - http://code.google.com/p/skia/issues/detail?id=940 - is that getResources will recursively obtain all child resource recursively without checking for duplicates. If we have lots of duplicates, then we try to build a very large vector (exponential with the number of nodes usually) and sooner or later we end up using too much memory and crash. A possible solution could have been to make sure resources do not have duplicates, but that requirement is impractical, and it this leaves the solution fragile, if there is any issue in the tree, we crash. When we emit the pdf, the large number of duplicates is not an issue, because SkPDFCatalog::addObject will deal with duplicates. I have run the gm with --config pdf, and the images are 100% same bits, while the pdfs have the same size but some very small changes, the order of some objects. Review URL: https://codereview.appspot.com/6744050 git-svn-id: http://skia.googlecode.com/svn/trunk@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
68 lines
1.9 KiB
Python
68 lines
1.9 KiB
Python
{
|
|
'targets': [
|
|
{
|
|
'target_name': 'pdf',
|
|
'product_name': 'skia_pdf',
|
|
'type': 'static_library',
|
|
'standalone_static_library': 1,
|
|
'dependencies': [
|
|
'skia_base_libs.gyp:skia_base_libs',
|
|
'zlib.gyp:zlib',
|
|
],
|
|
'include_dirs': [
|
|
'../include/config',
|
|
'../include/core',
|
|
'../include/images',
|
|
'../include/pdf',
|
|
'../src/core', # needed to get SkGlyphCache.h and SkTextFormatParams.h
|
|
'../src/utils', # needed to get SkBitSet.h
|
|
],
|
|
'sources': [
|
|
'../include/pdf/SkPDFDevice.h',
|
|
'../include/pdf/SkPDFDocument.h',
|
|
|
|
'../src/pdf/SkPDFCatalog.cpp',
|
|
'../src/pdf/SkPDFCatalog.h',
|
|
'../src/pdf/SkPDFDevice.cpp',
|
|
'../src/pdf/SkPDFDocument.cpp',
|
|
'../src/pdf/SkPDFFont.cpp',
|
|
'../src/pdf/SkPDFFont.h',
|
|
'../src/pdf/SkPDFFontImpl.h',
|
|
'../src/pdf/SkPDFFormXObject.cpp',
|
|
'../src/pdf/SkPDFFormXObject.h',
|
|
'../src/pdf/SkPDFGraphicState.cpp',
|
|
'../src/pdf/SkPDFGraphicState.h',
|
|
'../src/pdf/SkPDFImage.cpp',
|
|
'../src/pdf/SkPDFImage.h',
|
|
'../src/pdf/SkPDFPage.cpp',
|
|
'../src/pdf/SkPDFPage.h',
|
|
'../src/pdf/SkPDFShader.cpp',
|
|
'../src/pdf/SkPDFShader.h',
|
|
'../src/pdf/SkPDFStream.cpp',
|
|
'../src/pdf/SkPDFStream.h',
|
|
'../src/pdf/SkPDFTypes.cpp',
|
|
'../src/pdf/SkPDFTypes.h',
|
|
'../src/pdf/SkPDFUtils.cpp',
|
|
'../src/pdf/SkPDFUtils.h',
|
|
'../src/pdf/SkTSet.h',
|
|
],
|
|
# This section makes all targets that depend on this target
|
|
# #define SK_SUPPORT_PDF and have access to the pdf header files.
|
|
'direct_dependent_settings': {
|
|
'defines': [
|
|
'SK_SUPPORT_PDF',
|
|
],
|
|
'include_dirs': [
|
|
'../include/pdf',
|
|
],
|
|
},
|
|
},
|
|
],
|
|
}
|
|
|
|
# Local Variables:
|
|
# tab-width:2
|
|
# indent-tabs-mode:nil
|
|
# End:
|
|
# vim: set expandtab tabstop=2 shiftwidth=2:
|