summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-22Consolidate QuadPoints reading code in fpdfsdk.chromium/3380chromium/3379Lei Zhang
Also fix nits in QuadPoints code in cpdf_annot.cpp. Change-Id: I7852b673d3dca906e6d250cb3cfa305f8ea7e742 Reviewed-on: https://pdfium-review.googlesource.com/28893 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-22Roll DEPS for depot_tools to 869a285Lei Zhang
https://chromium.googlesource.com/chromium/tools/depot_tools/+log/2e8d8348..869a285 TBR=dsinclair@chromium.org Change-Id: I0e6e61b033284ed9c592106fd8748731a0677bb0 Reviewed-on: https://pdfium-review.googlesource.com/29071 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-22Roll DEPS for zlib to 8c371ad7Lei Zhang
https://chromium.googlesource.com/chromium/src/third_party/zlib.git/+log/91155b5d..8c371ad7 TBR=dsinclair@chromium.org Change-Id: I11bf8537e4cd5032da4b0f5dcc0ff31ac15db83c Reviewed-on: https://pdfium-review.googlesource.com/28771 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-03-22Roll DEPS for build to 74c3e063Lei Zhang
https://chromium.googlesource.com/chromium/src/build/+log/4b1fc75d..74c3e063 TBR=dsinclair@chromium.org Change-Id: I0e1a47052a4676c0105084edb69a7e37aa55c46b Reviewed-on: https://pdfium-review.googlesource.com/29070 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-22Move helper methods out of pdfium_test.Dan Sinclair
This CL splits some helper code out of pdfium_test into individual files. This makes it a bit clearer what each chunk of code is doing and makes pdfium_test easier to read. Change-Id: I3dcff5a6a85ac4283336108eb3a24fa5f234284c Reviewed-on: https://pdfium-review.googlesource.com/28990 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-22Roll DEPS for buildtools to 3748a2a9Lei Zhang
https://chromium.googlesource.com/chromium/buildtools/+log/f115f478..3748a2a9 TBR=dsinclair@chromium.org Change-Id: I597b647a9fe564d5599ca79dac4d04c5c7cb4af6 Reviewed-on: https://pdfium-review.googlesource.com/29031 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-03-22Roll DEPS for build to 4b1fc75dLei Zhang
https://chromium.googlesource.com/chromium/src/build/+log/7bee8be1..4b1fc75d TBR=dsinclair@chromium.org Change-Id: I5fc0191b2118ba9a93115618163d012ab521fd18 Reviewed-on: https://pdfium-review.googlesource.com/28790 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-22Remove testing/{gmock,gtest}/dummy.Lei Zhang
BUG=chromium:823586 TBR=dsinclair@chromium.org Change-Id: Ifee58db77a19c9143b8773e78d102114f08143ae Reviewed-on: https://pdfium-review.googlesource.com/29030 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-22Update gtest and gmock to 1.8.x.Lei Zhang
This applies parts of https://crrev.com/469551 and https://crrev.com/471303 to PDFium. Change-Id: Ifbb8e4c300bd276fe3c6fe60d19ebb1618be8936 Reviewed-on: https://pdfium-review.googlesource.com/28791 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-22Add testing/{gmock,gtest}/dummy.Lei Zhang
This will help facilitate the transition for these two directories from DEPS checkouts to part of the parent git repo. Without any files in these directories, gclient will delete them when they are no longer in DEPS. BUG=chromium:823586 TBR=dsinclair@chromium.org Change-Id: I1841db87fddcb0b6a2ed9300a86349e09bda3160 Reviewed-on: https://pdfium-review.googlesource.com/29011 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-21Rewrite CPDFXFA_DocEnvironment::GetPopupPos.chromium/3378Henrique Nakashima
This is a step to fix XFA combobox popups being rendered outside the page. The rest of the fix is in: https://chromium-review.googlesource.com/c/chromium/src/+/961249 Bug: chromium:820106 Change-Id: I51e5667bc08cdb2028c0afafa6e29e929e661c94 Reviewed-on: https://pdfium-review.googlesource.com/28371 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-21Add functions to convert various FPDF_ types.Lei Zhang
Centralize the static_casts involved. Change-Id: I036ead3b30abd60804b31343de8fda9912e03b0b Reviewed-on: https://pdfium-review.googlesource.com/28892 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-21Use more const pointers in CPDF_ContentMarkItem.Lei Zhang
Transitively mark the same pointers as const in callers. Change-Id: I1f9669b35c6d7f4b1a11c25163480bc687fbc7f8 Reviewed-on: https://pdfium-review.googlesource.com/28870 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-21Rename foo_{wid,hei} to foo_{width,height}.Lei Zhang
Change-Id: I94412dd183535c18f4421b465f64870b44ad230d Reviewed-on: https://pdfium-review.googlesource.com/28971 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-21Move declarations in pdfium_test closer to usageDan Sinclair
This CL moves some definitions in pdfium_test closer to their usage. Change-Id: I30835b1749976cc027466df37e12ddd74581ce22 Reviewed-on: https://pdfium-review.googlesource.com/28972 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-21Rename "des_foo" to "dest_foo".Lei Zhang
Destination variables usually have "dest" or "dst" as the prefix. Change-Id: If5bb01a5eafe1e4b42d1a6d653abb1b444b1b2fa Reviewed-on: https://pdfium-review.googlesource.com/28970 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-21Add helpers to work with FXDIB_Format.Lei Zhang
Helper functions make getting the bpp and component count more readable. Change-Id: Ie0f97d52136d11ef5251f6e22748e87aea289ae1 Reviewed-on: https://pdfium-review.googlesource.com/28572 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-21Add a regression test for bug 821454.Lei Zhang
WideString::Compare() went bad but no embedder test failed. Improve coverage by hand crafting a PDF similar to the sample PDF in the bug report. BUG=chromium:823369 Change-Id: I267f53ba3ef7612bf54771a85f8305b2cbc3cfcb Reviewed-on: https://pdfium-review.googlesource.com/28910 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-21Explain how CPDF_Page::GetDisplayMatrix() inverts y.Henrique Nakashima
Change-Id: Ia6e9fe790065d0bfd288d425c10d1dd9e0cf8c31 Reviewed-on: https://pdfium-review.googlesource.com/28850 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-21Fix some param names in the public API.Lei Zhang
Also fix some comments. Change-Id: Ib42dcf04906139020bdbdfe86e6088faa1c31daa Reviewed-on: https://pdfium-review.googlesource.com/28830 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-21Change FXSYS_RGB() to FXSYS_BGR().Lei Zhang
Also change it from a macro to a constexpr function. Change-Id: I8b2bb42c45a23da6db136abdaee24132db4471c6 Reviewed-on: https://pdfium-review.googlesource.com/28579 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-21Change FXSYS_Get{R,G,B}Value()'s input param to BGR.Lei Zhang
Also change them from macros to constexpr functions. Change-Id: I5ebec07487b7b7f59cc769debc95c730776d4613 Reviewed-on: https://pdfium-review.googlesource.com/28578 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-21Replace deprecated SetNamedPropertyHandlerFranziska Hinkelmann
Replace v8::SetNamedPropertyHandler() with SetHandler() and the appropriate flag set. Change-Id: Ia06311cbea4ab21903d4ac4fe115eab6f0983c0d Reviewed-on: https://pdfium-review.googlesource.com/28930 Reviewed-by: Jochen Eisinger <jochen@chromium.org> Commit-Queue: Jochen Eisinger <jochen@chromium.org>
2018-03-21Rename one ArgbEncode() variant to AlphaAndColorRefToArgb().Lei Zhang
Mark the other ArgbEncode() variant as constexpr. Change-Id: I84207d805766e5efc669638bd8a15cfead356a41 Reviewed-on: https://pdfium-review.googlesource.com/28577 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-21Remove thin_archive config from complete static librariesTom Anderson
Following CL [1], it is required to remove the thin_archive config everywhere complete_static_lib is set. [1] https://chromium-review.googlesource.com/c/chromium/src/+/954344 BUG=chromium:801925 R=thestig Change-Id: Ia142aa65c375f0ab42346599d07167c38332c357 Reviewed-on: https://pdfium-review.googlesource.com/28890 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-03-20Rename "RGB" methods/variables to "ColorRef" in CPDF_ColorState.Lei Zhang
Change-Id: I196e3148d680c9efeaf9609dd3ddbfe3f6635fa6 Reviewed-on: https://pdfium-review.googlesource.com/28576 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-20Simplify code in CPDF_TextPage.Lei Zhang
- Augment/reuse existing NormalizeThreshold() function. - Use std::min() / std::max(). Change-Id: I709e246c58bf8a69638e1d77dcc2a79ae8a27e77 Reviewed-on: https://pdfium-review.googlesource.com/28736 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-20Change ArgbToColorRef() to ArgbToAlphaAndColorRef().chromium/3377Lei Zhang
Since that is what it really returns. Add a replacement ArgbToColorRef() that only returns a FX_COLORREF, and remove a duplicate implementation. Then update callers and only use ArgbToAlphaAndColorRef() where appropriate. Also update comments to explain what FX_COLORREF is. Change-Id: I5ed3d71683898dc2b3a66395dea0ec2562c14a68 Reviewed-on: https://pdfium-review.googlesource.com/28575 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-19Calculate AP for multi-line markup annotations correctlyRalf Sippl
Currently, when constructing AP for multi-line markup annotations, we only take into account the first set of quadpoints, resulting in only the first line of the annotation being displayed if the annotation spans multiple lines. This CL, initially written by Jane Liu <janeliulwq@google.com> (https://pdfium-review.googlesource.com/12010) takes into account all the quadpoints, so multi-line annotations can be displayed correctly. BUG=pdfium:876 Change-Id: I8be10ee38e01eb6525ddef556df1b727189455c7 Reviewed-on: https://pdfium-review.googlesource.com/28590 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Roll DEPS for Clang to 7d56ff90.Lei Zhang
AKA roll Clang 325667:327688 https://chromium.googlesource.com/chromium/src/tools/clang/+log/7e693123..7d56ff90 TBR=dsinclair@chromium.org Change-Id: If679a9bfcdfd8ca88b0d725a9c78c061a1af9426 Reviewed-on: https://pdfium-review.googlesource.com/28776 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Roll DEPS for Skia to af770026Lei Zhang
https://chromium.googlesource.com/skia/+log/40ca2087..af770026 TBR=dsinclair@chromium.org Change-Id: Id9df263b798ac82ef9e0b52af365bb5785a8517c Reviewed-on: https://pdfium-review.googlesource.com/28773 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Roll DEPS for catapult to 4f03e51fLei Zhang
https://chromium.googlesource.com/external/github.com/catapult-project/catapult.git/+log/d624b3ce..4f03e51f TBR=dsinclair@chromium.org Change-Id: Ifd7993e5e8b34844e5652d1ecd8324eaa36b2572 Reviewed-on: https://pdfium-review.googlesource.com/28774 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Roll instrumented_libs to 323cf321Lei Zhang
https://chromium.googlesource.com/chromium/src/third_party/instrumented_libraries.git/+log/28417458..323cf321 TBR=dsinclair@chromium.org Change-Id: I38d33721c2d9ca387a63aafbc4c524d2c4483071 Reviewed-on: https://pdfium-review.googlesource.com/28772 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Roll v8 to 9cf8abb7Lei Zhang
https://chromium.googlesource.com/v8/v8/+log/6353d168..9cf8abb7 TBR=dsinclair@chromium.org Change-Id: I461ddbe732c0c350811786204e4e8c7387f36d16 Reviewed-on: https://pdfium-review.googlesource.com/28770 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Add more options to combobox_form.pdf resource.Henrique Nakashima
This causes a scrollbar to appear. We need a test case that contains an AcroForm combobox with a popup that is large enough to create a scrollbar. Bug: chromium:823378, chromium:820278 Change-Id: I6e93bda5b938f9f7c08ceeef7989794ea7764532 Reviewed-on: https://pdfium-review.googlesource.com/28750 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2018-03-19Remove non-const ref parameters in CPDF_TextPage.Lei Zhang
Change-Id: Ia6cb19269ef93440669b68d76c3c378a5d4da7a5 Reviewed-on: https://pdfium-review.googlesource.com/28735 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-19Remove redundant code in CPDF_TextPage::CountRects().Lei Zhang
CountRects() calls GetRectArray(), which performs the same calculation. Change-Id: I79dcd8e82f6d0fe7ed992da06237f31d0761a902 Reviewed-on: https://pdfium-review.googlesource.com/28734 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-19Avoid crashing in FPDFText_CountRects() for invalid start values.Lei Zhang
BUG=chromium:821305 Change-Id: I371572f60ea3984ce044e25125d882b3c2d03115 Reviewed-on: https://pdfium-review.googlesource.com/28733 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-19Avoid crashing in FPDFText_CountRects() for negative count values.Lei Zhang
Treat values less than -1 as -1. BUG=chromium:821305 Change-Id: Ieaced045473fa51097400e5af1286f0d3f4d0143 Reviewed-on: https://pdfium-review.googlesource.com/28732 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-16Add more tests for FPDFText_CountRects().chromium/3376chromium/3375chromium/3374Lei Zhang
BUG=chromium:821305 Change-Id: I261bc9704363d2a6b930146b2a275d2fa5178165 Reviewed-on: https://pdfium-review.googlesource.com/28692 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-03-16Rename some variables in FPDFTextEmbeddertest.Lei Zhang
Either give them shorter names, or change them to kFoo. Change-Id: I3cb7ba242784f163e9c6ba7346d48c622e792ae1 Reviewed-on: https://pdfium-review.googlesource.com/28690 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-16Fix methods that have definition with different parameter names.Lei Zhang
Found by ClangTidy. BUG=pdfium:1039 Change-Id: I2bb9256a63d5459e959c1a3228418073245d7a86 Reviewed-on: https://pdfium-review.googlesource.com/28731 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-16Fix typo in doc of FPDFDest_GetDestPageIndex.Henrique Nakashima
Change-Id: Ic312c540dcdc19d0c81ae85a7c5b201a00bacf7f Reviewed-on: https://pdfium-review.googlesource.com/28730 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-16Make more variables const-ref.chromium/3373Lei Zhang
Found by ClangTidy. BUG=pdfium:1040 Change-Id: I6d7cb26ae2d12f5650f73596d0b991234b076f57 Reviewed-on: https://pdfium-review.googlesource.com/28712 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-15Add a CFX_PathData::AppendRect() variant.chromium/3372Lei Zhang
One that takes a CFX_FloatRect instead of LBRT floats. Use it where appropriate. Change-Id: I8ba19e86c61c91d8b4ef685b5cb65c8fb717f013 Reviewed-on: https://pdfium-review.googlesource.com/28581 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
2018-03-15Create FPDFPage_RemoveObject().Henrique Nakashima
This call removes a page object from a page. We currently offer an API to insert these objects, but not to remove. Bug: pdfium:1037 Change-Id: I35ff596f9e7c87a39051f0cb1de40a5bec40fee5 Reviewed-on: https://pdfium-review.googlesource.com/28492 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
2018-03-15Fixing order of guards to avoid potential segvsRyan Harrison
Per tspepez's drive by: str, in theory, might not be terminated, and might have been allocated right up to a guard page at the end of the heap, say, so that str[len] could segv. Change-Id: I6cba7b6d12b23f69e6f150c1b5296df65c2e0086 Reviewed-on: https://pdfium-review.googlesource.com/28610 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2018-03-15Rename FX_COLORREF variables from "rgb" to "bgr".Lei Zhang
FX_COLORREF should work like win32 COLORREF, which is BGR. Change-Id: I9f8bb3e2d30a64dc822ac6b8c46130358a03678a Reviewed-on: https://pdfium-review.googlesource.com/28574 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-03-15Use Width()/Height() methods from rectangles.Lei Zhang
Change-Id: I07f4363046be920816e8d0dae766c7af833284db Reviewed-on: https://pdfium-review.googlesource.com/28582 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-03-15Remove unused CPDFSDK_BAAnnot methods.Lei Zhang
Change-Id: I5de956c8a759c974659396a34a355eb0840d2144 Reviewed-on: https://pdfium-review.googlesource.com/28580 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>