summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-07-12Move fpdfsdk/jsapi into fxjs/dsinclair
This CL moves the fpdfsdk/sjapi code info fxjs/. The "fxjs" library is moved from being XFA specific to being compiled if V8 is enabled. The fxjs_v8 files are required when building for XFA (they have XFA defines in them) and are used in CFXJS_RuntimeData. The cfxjse_* files are only added if XFA is also enabled. Review-Url: https://codereview.chromium.org/2144603003
2016-07-12Create an fxjs static librarydsinclair
This CL moves the fxjs/ code out of the xfa library and into a fxjs library. Review-Url: https://codereview.chromium.org/2136273002
2016-07-12Rename fxjse/ to fxjs/ update files to match class names.dsinclair
This Cl moves the fxjse/ directory to fxjs/ in anticipation of merging in fpdfsdk/jsapi. In the process the filenames are updated to better match the class contents. Static methods are moved to anonymous namespaces as possible. Review-Url: https://codereview.chromium.org/2136213002
2016-07-11Use smart pointers for class owned member variablesweili
Replace raw member variables to smart pointer type to better maintain the ownership and to ease the management. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2136683002
2016-07-11Cleanup CXFA_SimpleParser.dsinclair
This CL moves the static methods to an anonymous namespace and cleans up various formatting issues. Review-Url: https://codereview.chromium.org/2138833002
2016-07-11PDFDocTest should TearDown() properly.thestig
Otherwise pdfium_unittests --gtest_shuffle can fail. Review-Url: https://codereview.chromium.org/2135823002
2016-07-11Cleanup ownership of parser membersdsinclair
Change m_pXMLDoc and m_pStream in CXFA_SimpleParser to be a unique_ptr. This allows removing the CloseParser() call from CXFA_DocumentParser as the items will get cleaned up automatically. Review-Url: https://codereview.chromium.org/2131653002
2016-07-11Break xfa_parser_imp apartdsinclair
This CL splits the three parsers into individual files to make working with the code easier. Review-Url: https://codereview.chromium.org/2129963002
2016-07-11Remove IXFA_Parser, cleanup XFA parser code.dsinclair
The IXFA_Parser only created a CXFA_SimpleParser, the CXFA_DocumentParser is only created in one spot and doesn't need all the IXFA_Parser methods. This CL removes IXFA_Parser, instantiates the CXFA_SimpleParser where needed and cleans up surrounding code. Review-Url: https://codereview.chromium.org/2123133004
2016-07-11Cleanup redundant method names.dsinclair
This CL cleans up a bunch of method names which are redundant with the class names or code location. Review-Url: https://codereview.chromium.org/2132513003
2016-07-08[Android] Roll v8 & icu to fix android build w/ pdf_enable_v8=true.jbudorick
BUG=pdfium:38 Review-Url: https://codereview.chromium.org/2137703002
2016-07-07Cleanup xfa_document_datamerge filesdsinclair
This CL moves the static methods into an anonymous namespace, removes default parameters and moves some other methods only used by this file into the anonymous namespace. Review-Url: https://codereview.chromium.org/2122373003
2016-07-07set font cache if nullcaryclark
testing/corpus/fx/path/path_10_jd.pdf sets the document to null. (It can't be read at all by MacOS Preview.) This causes the font cache to also be null. In this case, get the font cache from CFX_GEModule instead. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2128043004
2016-07-07Break xfa_basic_data up to smaller filesdsinclair
xfa_basic_data is a large (>7k lines) file that is difficult to navigate. This CL breaks the file up into smaller files more logical files. Review-Url: https://codereview.chromium.org/2123343002
2016-07-07Remove constructor from functions that aren't constructorschromium/2796chromium/2795chromium/2794chromium/2793chromium/2792chromium/2791jochen
BUG=chromium:625823 R=haraken@chromium.org,thestig@chromium.org Review-Url: https://codereview.chromium.org/2128793002
2016-07-07Mark win_xfa_clang as experimentaljochen
That way it won't block the CQ while the compile problems are being investigated. BUG=chromium:626120 NOTRY=true (otherwise, win_xfa_clang will fail and block this CL) TBR=thestig@chromium.org Review-Url: https://codereview.chromium.org/2129893002
2016-07-07Fix compilation with strict format checkingagoode
abs() is bit tricky in C++ and this use of abs is returning double. FXSYS_snprintf is strictly checking this on Fedora 24 and results in: ../../third_party/pdfium/fpdfsdk/fsdk_baseannot.cpp:309:18: error: format specifies type 'int' but the argument has type 'typename __gnu_cxx::__enable_if<__is_integer<signed char>::__value, double>::__type' (aka 'double') [-Werror,-Wformat] Review-Url: https://codereview.chromium.org/2124083002
2016-07-06Change class member variables in raw pointer type into unique_ptrweili
Also did some cleanups such as removing an unused member variables and some unused structs. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2119013002
2016-07-06openjpeg: Prevent integer overflows during calculation of |l_nb_precinct_size|ochang
BUG=625541 Review-Url: https://codereview.chromium.org/2124073003
2016-07-06Roll DEPS for v8 to 820a23aa.jochen
Also roll DEPS for ICU to ffa4b670 and add a needed GYP variable. BUG= R=thestig@chromium.org Review-Url: https://codereview.chromium.org/2127553004
2016-07-06copy graphics state fullycaryclark
The dash parameters where not copied; the copy could point at random data and cause corpus tests to hang when testing Skia. PDFium measures text directly by calling FreeType. Turn off hinting altogether in Skia so that drawn text matches the metrics that PDFium measures. Premultiply bits retrieved from images, and check to see that the device bits are always premultiplied. Look for null graphics state and matrices. R=thestig@chromium.org,dsinclair@chromium.org BUG=pdfium:532 Review-Url: https://codereview.chromium.org/2120353004
2016-07-06Remove prototypes from v8 functions that aren't constructorsjochen
BUG=chromium:625823 R=haraken@chromium.org,thestig@chromium.org Review-Url: https://codereview.chromium.org/2123153002
2016-07-01Fix Android build by updating several DEPS files.thestig
Roll DEPS for buildtools to db6179b2. Roll DEPS for catapult to 327256cb. Roll DEPS for gyp to c61b0b35. TBR=dsinclair@chromium.org NOTREECHECKS=true Review-Url: https://codereview.chromium.org/2114223002
2016-07-01Roll build/ to 76d9f8b4.thestig
TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2114173003
2016-07-01Roll Clang to 775e2f87.thestig
TBR=thakis@chromium.org Review-Url: https://codereview.chromium.org/2122433002
2016-07-01Clean up parts of CPDF_CIDFont.thestig
Also remove some if statements that are always true/false. Review-Url: https://codereview.chromium.org/2094073002
2016-07-01Mac: Improve font substitution.chromium/2790chromium/2789chromium/2788chromium/2787thestig
Take the requested font weight and italicization into account when searching for fonts. For example, for a font with the face "Arial" and a weight of 700, search to see if "Arial Bold" is available. BUG=530 Review-Url: https://codereview.chromium.org/2119983002
2016-07-01Enable compiling with clang chrome plugins for GYP buildweili
For standalone build, enable the compilation with clang_use_chrome_plugins. Also remove the previous clang_use_pdfium_plugins to be consistent with chrome build, also avoid errors on chromeos_ozone build. BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2115813002
2016-07-01Clean up CFX_MacFontInfo and surrounding code.thestig
Review-Url: https://codereview.chromium.org/2112213002
2016-06-30Convert some methods to std::lower_bound and std::find_if.dsinclair
This CL updates XFA_GetElementTypeForName() to use std::lower_bound instead of a custom binary search implementation to find the element info. XFA_GetPropertyOfElement() is changed to use std::find_if. Previously it was using a custom binary search implementation. Changing this to non-binary search will allow having the items in g_XFAElementPropertyData be out of XFA_Element order. There are at most 19 items that need to be searched and often 1 or 2. Review-Url: https://codereview.chromium.org/2107093004
2016-06-29fix skia unit testscaryclark
Add checks to pass unit tests. R=thestig@chromium.org,dsinclair@chromium.org BUG=pdfium:525, pdfium:526, pdfium:527, pdfium:528, pdfium:529 Review-Url: https://codereview.chromium.org/2111553003
2016-06-29add local caching for skia drawscaryclark
PDFium assumes the lowest common denominator and draws many strings and paths that can be accumulated. Defer canvas->restore() calls until required because the clip changed. Defer text and path draws as long as subsequent calls concatenate additional data. Include debugging switch to allow disabling cache at compile-time while bugs are shaken out. Review-Url: https://codereview.chromium.org/2064753002
2016-06-29Disable failing embedder tests for Skia builds.thestig
BUG=pdfium:525,pdfium:526 Review-Url: https://codereview.chromium.org/2106043002
2016-06-28Change CXFA_Node::GetClassName to returnchromium/2786chromium/2784dsinclair
CXFA_Node::GetClassName currently takes an out parameter and returns void. This CL updates the signature to return the value and require no parameters. Review-Url: https://codereview.chromium.org/2104963002
2016-06-28Implement IJS_Runtime::Destroy().thestig
And call it from FPDF_DestroyLibrary(). Otherwise further attempts to FPDF_InitLibraryWithConfig() can hit fail an assertion in IJS_Runtime::Initialize(). BUG=604587 Review-Url: https://codereview.chromium.org/2103443004
2016-06-27Fix a regression from commit f3e6851.thestig
The index calculations are wrong for a reverse iterator. Review-Url: https://codereview.chromium.org/2101723002
2016-06-27Clean up some CPDF_Font subclasses.thestig
Review-Url: https://codereview.chromium.org/2093313002
2016-06-27Fix memory leaks with V8 startup data.thestig
Review-Url: https://codereview.chromium.org/2068563002
2016-06-27Clean up fxet_ap.cpp.thestig
Review-Url: https://codereview.chromium.org/2096143003
2016-06-27Simplify CPDF_TextRenderer::DrawTextString().thestig
Review-Url: https://codereview.chromium.org/2093033004
2016-06-27Double AdobeCMYK_to_sRGB speed with faster roundingbrucedawson
FXSYS_round is painfully slow on Windows. It does range checking and then calls an extremely expensive function. It ends up consuming half the CPU time when decoding the images in PDFs such as this one: https://www.ets.org/Media/Tests/GRE/pdf/gre_research_validity_data.pdf SSE can be used to optimize this: __m128 cmyk = {c * 255, m * 255, y * 255, k * 255}; uint32_t output[4]; _mm_storeu_si128((__m128i*)output, _mm_cvtps_epi32(cmyk)); but is cryptic, only works for x86/x64, and gives basically identical performance to this solution - int(c * 255 + 0.5f); The rounding behavior is not identical but in practice this rarely matters, and in this specific case it does not matter because the edge cases that vary are not hit. The three divisions at the end were changed to multiplies because profiling showed they were a significant cost. This change reduces the image-decode stalls in the PDF listed above by about 40%, making for a noticeably better experience. Further optimizations are possible but would require significantly more time and testing. BUG=617365 Review-Url: https://codereview.chromium.org/2096723003
2016-06-24pdfium clang/win: Stop passing /FIIntrin.hchromium/2783chromium/2782chromium/2781chromium/2780chromium/2779thakis
See https://codereview.chromium.org/2076483002 for a lengthy reasoning. The two mysterious files called out there were in boringssl and nacl, so for pdfium this should be a complete no-op. BUG=chromium:592745 Review-Url: https://codereview.chromium.org/2096143002
2016-06-24Revert "Turn on clang_use_chrome_plugins for GYP as well."thestig
This reverts commit f7f659c2c98a4d02e3695266d33f449b7be01af9. PDFium roll in Chromium fails on linux_chromium_chromeos_ozone_rel_ng. TBR=dsinclair@chromium.org BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2092273002
2016-06-24Remove IFWL_ToolTipTarget.thestig
It does not have an implementation. BUG=623135 Review-Url: https://codereview.chromium.org/2094013002
2016-06-23Improve hint table validation checks.thestig
Check required hint table dictionary entries and make sure they: - Exist. - Are of the right type. Along the way: - Fix FX_atonum() to not have a non-const pass-by-ref param. - Simplify code in CPDF_StreamContentParser. - Make CPDF_Number::IsInteger() a const method. BUG=610555 Review-Url: https://codereview.chromium.org/2095763003
2016-06-23Use some FXSYS methods instead of duplicatingdsinclair
This CL uses the FXSYS_isDecimalDigit in place of a few custom IsDigit methods. It also creates an iswspace and some fractional math helper methods to share some code. Review-Url: https://codereview.chromium.org/2094453004
2016-06-23Pass needed value to CXFA_Node constructordsinclair
Currently the CXFA_Node constructor will call out to lookup the object type for a given element type. There is only one called of this constructor and it already has the object type so just pass it through instead of getting the element data a second time. Review-Url: https://codereview.chromium.org/2092853002
2016-06-23Remove NULL in xfa/dsinclair
This CL converts all NULL's to nullptr. All instances of comparison to nullptr have been removed. Review-Url: https://codereview.chromium.org/2095653002
2016-06-23Change XFA_GetElementByName to XFA_GetElementTypeForNamedsinclair
This method was only ever used to get the XFA_Element type for the given element name. Changed to make the signature match the usage. Review-Url: https://codereview.chromium.org/2095733002
2016-06-23Turn on clang_use_chrome_plugins for GYP as well.thestig
BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2089823004