summaryrefslogtreecommitdiff
path: root/pdf.gyp
diff options
context:
space:
mode:
authoredisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-27 16:54:44 +0000
committeredisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-27 16:54:44 +0000
commitc3bb3a4d57e899d211caeb4be5d25817e445d8d9 (patch)
treef015217217ab740c847c54c3526754ffac35ff63 /pdf.gyp
parent3d8320ed48b59fc7d39fd7d60a3bb03b3d1c1526 (diff)
downloadgyp-c3bb3a4d57e899d211caeb4be5d25817e445d8d9.tar.gz
Use SkSet to fix issue when pdf generates an exp number of resources.
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/gyp@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'pdf.gyp')
-rw-r--r--pdf.gyp2
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf.gyp b/pdf.gyp
index 7b3b9ea..081df01 100644
--- a/pdf.gyp
+++ b/pdf.gyp
@@ -12,6 +12,7 @@
'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
@@ -43,6 +44,7 @@
'../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.