aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFMetadata.cpp
Commit message (Collapse)AuthorAge
* SkUTFGravatar Hal Canary2018-07-31
| | | | | | | | | | | | | | | | | | | | | Create new header and namespace, `SkUTF` where we are putting all of our robust, well documented UTF-8, UTF-16, and UTF-32 functions: `SkUTF::{Count,Next,To}UTF{8,16,32}()`. SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable for re-use in other modules. Some of the old UTF-{8,16} functions still live in SkUtils.h; their use will be phased out in future CLs. Also added more unit testing and cleaned up old tests. Removed functions that were unused outside of tests or used only once. Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380 Reviewed-on: https://skia-review.googlesource.com/143306 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* Fix many return-std-move-in-c++11 warningsGravatar Kevin Lubick2018-04-16
| | | | | | | | | Change-Id: Ib0042cf412fe3c5fa600b7ae644d16740457535e Reviewed-on: https://skia-review.googlesource.com/121354 Commit-Queue: Kevin Lubick <kjlubick@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Kevin Lubick <kjlubick@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* SkPDF: encode metadata strings correctlyGravatar Hal Canary2018-02-28
| | | | | | | | BUG=skia:7669 Change-Id: I3a90a2406854cc9bcfdd299e09ae3d6e610f2cc7 Reviewed-on: https://skia-review.googlesource.com/111121 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: SkWStream::write -> SkWStream::writeTextGravatar Hal Canary2017-08-28
| | | | | | | | | | | Follow on to https://skia.googlesource.com/skia/+/cbc060a No change in output. Change-Id: I3c43cb0207e1e9311a13162f22f7a58d82d239d7 Reviewed-on: https://skia-review.googlesource.com/18075 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@skia.org>
* factor out hexadecimal constants.Gravatar Hal Canary2017-06-19
| | | | | | | | | | Now we don't have to rely on the linker to de-duplicate so many gHex[] constants. Change-Id: Ia86d3a92648415afdb8d29499b4faded5ed05c7d Reviewed-on: https://skia-review.googlesource.com/20180 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* clean up non-ASCII commentsGravatar Hal Canary2017-01-03
| | | | | | | Change-Id: I07ad00133f6a938de70a94024a0ebe36c6c542bb Reviewed-on: https://skia-review.googlesource.com/6524 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
* SkDocument: turn off SK_SUPPORT_LEGACY_DOCUMENT_APIGravatar halcanary2016-09-06
| | | | | | | | no one seems to be using it. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2299653002 Review-Url: https://codereview.chromium.org/2299653002
* SkPDF: in-place font subsettingGravatar halcanary2016-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: gross code simplification, also no bitset lookups at draw time. SkPDFFont owns its glyph useage bitset. SkPDFSubstituteMap goes away. SkPDFObject interface is simplified. SkPDFDocument tracks font usage (as hash set), not glyph usage. SkPDFFont gets a simpler constructor. SkPDFFont has first and last glyph set in constructor, not adjusted later. SkPDFFont implementations are simplified. SkPDFGlyphSet is replaced with simple SkBitSet. SkPDFFont sizes its SkBitSets based on glyph count. SkPDFGlyphSetMap goes away. SkBitSet is now non-copyable. SkBitSet now how utility methods to match old SkPDFGlyphSet. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot Review-Url: https://codereview.chromium.org/2253283004
* SkPDF: fix PDFA-only metadata errorGravatar halcanary2016-07-07
| | | | Review-Url: https://codereview.chromium.org/2119883002
* SkPDF: allow overriding Producer metadataGravatar halcanary2016-06-30
| | | | | | | | | | | | I recommend not using this functionality. Also, some documentation. BUG=skia:5436 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2074583003 Review-Url: https://codereview.chromium.org/2074583003
* SkDocument/PDF: new APIGravatar halcanary2016-04-27
| | | | | | | | | | has a pdf/a switch. sets metadata in factory. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1916093002 Review URL: https://codereview.chromium.org/1916093002
* SkStringPrintf and SkString::printf now are no longer limted by a static bufferGravatar halcanary2016-04-25
| | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1403803002 Committed: https://skia.googlesource.com/skia/+/606cadd5aac62299ef2e277709b3684cae2bf96c Review URL: https://codereview.chromium.org/1403803002
* Revert of SkStringPrintf and SkString::printf now are no longer limted by a ↵Gravatar halcanary2016-04-22
| | | | | | | | | | | | | | | | | | | | | | static buffer (patchset #5 id:80001 of https://codereview.chromium.org/1403803002/ ) Reason for revert: breaking something Original issue's description: > SkStringPrintf and SkString::printf now are no longer limted by a static buffer > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1403803002 > > Committed: https://skia.googlesource.com/skia/+/606cadd5aac62299ef2e277709b3684cae2bf96c TBR=tomhudson@google.com,reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1908423002
* SkStringPrintf and SkString::printf now are no longer limted by a static bufferGravatar halcanary2016-04-22
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1403803002 Review URL: https://codereview.chromium.org/1403803002
* SkPDF: PDF/A runtime switchGravatar halcanary2016-04-22
| | | | | | | | | | | | | TODO: remove gyp variable and modify API in SkDocument.h SkMD5 now moved into core as pdf depends on it now. BUG=skia:3110 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002 Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82 Review URL: https://codereview.chromium.org/1891873002
* Revert of SkPDF: PDF/A runtime switch (patchset #1 id:100001 of ↵Gravatar halcanary2016-04-15
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1891873002/ ) Reason for revert: breaking something. Original issue's description: > SkPDF: PDF/A runtime switch > > TODO: remove gyp variable and modify API in SkDocument.h > > BUG=skia:3110 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002 > > Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82 TBR=tomhudson@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3110 Review URL: https://codereview.chromium.org/1892203002
* SkPDF: PDF/A runtime switchGravatar halcanary2016-04-15
| | | | | | | | | TODO: remove gyp variable and modify API in SkDocument.h BUG=skia:3110 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002 Review URL: https://codereview.chromium.org/1891873002
* SkPDF: fix pessimizing-move in PDFA codeGravatar halcanary2016-04-08
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1863393004 Review URL: https://codereview.chromium.org/1863393004
* SkPDF Fix PDF/A to be more validGravatar halcanary2016-04-07
| | | | | | | | | | | Some produced PDFs are recognized by veraPDF 0.13.2 (http://verapdf.org/software/) as valid PDF/A-2B. BUG=skia:4535 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1864173004 Review URL: https://codereview.chromium.org/1864173004
* SkPDF: fix PDF/AGravatar halcanary2016-04-07
| | | | | | | | | TODO: get a bot to start testing this. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1864163004 Review URL: https://codereview.chromium.org/1864163004
* SkPDF: milestone in metadata, also SkMilestone.hGravatar halcanary2016-03-29
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823753002 Review URL: https://codereview.chromium.org/1823753002
* Change SkTime::GetMSecs to double; ensure values stored in SkMSec do not ↵Gravatar benjaminwagner2016-03-25
| | | | | | | | | | | | | | | | | | | | | | | overflow. The following are currently unused in Android, Google3, Chromium, and Mozilla: - SkEvent - SkTime::GetMSecs - SK_TIME_FACTOR (also unused in Skia) - SkAutoTime I left uses of SkMSec more-or-less intact for SkEvent, SkAnimator, and SkInterpolator. SkInterpolator is used in Chromium, so I did not want to change the API. The views/ and animator/ code is crufty, so it didn't seem worthwhile to refactor it. Instead, I added SkEvent::GetMSecsSinceStartup, which is likely to be adequate for use in SampleApp. I also left SkMSec where it is used to measure a duration rather than a timestamp. With the exception of SkMovie, which is used in Android, all of the uses appear to measure the execution time of a piece of code, which I would hope does not exceed 2^31 milliseconds. Added skiatest::Timer to support a common idiom in tests where we want to measure the wallclock time in integer milliseconds. (Not used in tests/PathOpsSkpClipTest.cpp because it redefines things in Test.h.) Removed tabs in tests/StrokerTest.cpp. BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811613004 Review URL: https://codereview.chromium.org/1811613004
* SkPDF: use sk_make_sp<T> when it makes sense.Gravatar halcanary2016-03-08
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1773033002 Review URL: https://codereview.chromium.org/1773033002
* SkPDF: s/SkAutoTUnref/sk_sp/gGravatar halcanary2016-03-07
| | | | Review URL: https://codereview.chromium.org/1771073002
* SkPDF: AutoTUnref<T> changes in useGravatar halcanary2016-03-06
| | | | | | | | | | ::detach() -> ::release() ::operator T*() -> ::get() This makes all use of AutoTUnref work the same as sk_sp. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1772493002 Review URL: https://codereview.chromium.org/1772493002
* Start using <type_traits> and <utility> (C++11).Gravatar bungeman2016-01-05
| | | | | | | | | | | | | | SkUtility.h and SkTLogic.h implement a number of type traits now available through <type_traits> and <utility>. This removes SkUtility.h, replacing it with <utility>, and moves a number of traits in SkTLogic.h to use the std:: equivelents. This change only uses C++11 parts of the standard library; SkTLogic.h will continue to provide C++14 and beyond for now in the skstd namespace. The changes to SkTLogic.h are being done gradually so that safe changes may be landed confidently, with more risky changes in the future. Review URL: https://codereview.chromium.org/1561683002
* SkPDF: add `final` keyword to leaf classesGravatar halcanary2015-11-22
| | | | Review URL: https://codereview.chromium.org/1461403002
* SkPDF: Optionally output PDF/A-2b archive format.Gravatar halcanary2015-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note: this format does not yet pass validation tests. Add skia_pdf_generate_pdfa GYP flag. Default to off for now. PDF/A files are not reproducable, so they make correctness testing harder. Turn the Metadata struct into te SkPDFMetadata struct. This splits out a lot of functionality around both kinds of metadata. When PDF/A is used, add an ID entry to the trailer. Add SkPDFObjNumMap::addObjectRecursively. Test with GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp ninja -C out/Release dm out/Release/dm --config pdf --src skp gm -w /tmp/dm With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs generated from GMs and SKPs render identically in Pdfium. BUG=skia:3110 Review URL: https://codereview.chromium.org/1394263003
* Revert of SkPDF: Optionally output PDF/A-2b archive format. (patchset #5 ↵Gravatar bungeman2015-10-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:80001 of https://codereview.chromium.org/1394263003/ ) Reason for revert: SkMD5 is not really part of the Skia library. This is breaking the roll by using it, since Chromium doesn't build it. Original issue's description: > SkPDF: Optionally output PDF/A-2b archive format. > > Note: this format does not yet pass validation tests. > > Add skia_pdf_generate_pdfa GYP flag. Default to off for now. > PDF/A files are not reproducable, so they make correctness > testing harder. > > Turn the Metadata struct into te SkPDFMetadata struct. This > splits out a lot of functionality around both kinds of metadata. > > When PDF/A is used, add an ID entry to the trailer. > > Add SkPDFObjNumMap::addObjectRecursively. > > Test with > > GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp > ninja -C out/Release dm > out/Release/dm --config pdf --src skp gm -w /tmp/dm > > With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and > SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs > generated from GMs and SKPs render identically in Pdfium. > > BUG=skia:3110 > > Committed: https://skia.googlesource.com/skia/+/939c0fe51f157104758bcb268643c8b6d317a530 TBR=tomhudson@google.com,halcanary@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3110 Review URL: https://codereview.chromium.org/1398193002
* SkPDF: Optionally output PDF/A-2b archive format.Gravatar halcanary2015-10-09
Note: this format does not yet pass validation tests. Add skia_pdf_generate_pdfa GYP flag. Default to off for now. PDF/A files are not reproducable, so they make correctness testing harder. Turn the Metadata struct into te SkPDFMetadata struct. This splits out a lot of functionality around both kinds of metadata. When PDF/A is used, add an ID entry to the trailer. Add SkPDFObjNumMap::addObjectRecursively. Test with GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp ninja -C out/Release dm out/Release/dm --config pdf --src skp gm -w /tmp/dm With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs generated from GMs and SKPs render identically in Pdfium. BUG=skia:3110 Review URL: https://codereview.chromium.org/1394263003