summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2016-06-23Cleanup some variable namings.chromium/2778dsinclair
This CL cleans up some variable namings from the XFA_Element enum change. Review-Url: https://codereview.chromium.org/2093663002
2016-06-23Load font maps in XFA.dsinclair
When XFA is enabled documents using some unicode fonts will render incorrectly as seen in the example attached to chromium:617490. This CL enables the loading of the font map files in XFA so we can correctly identify the character sets as unicode and map the glyphs correctly. BUG=chromium:617490 Review-Url: https://codereview.chromium.org/2097523002
2016-06-23Remove FPDFAPI_LoadCID2UnicodeMap.dsinclair
This Cl removes FPDFAPI_LoadCID2UnicodeMap() and inlines the code into the one caller. Review-Url: https://codereview.chromium.org/2097513002
2016-06-23Remove IsOrdinaryList; rename to OrdinaryList to Listdsinclair
IsOrdinaryList is no longer used, removed. Rename list item as Ordinary doesn't hold any meaning. Review-Url: https://codereview.chromium.org/2079393006
2016-06-23Remove CXFA_OrdinaryObject classdsinclair
The CXFA_OrdinaryObject class no longer has any functionality but is just wraps CXFA_Object and sets the object type for the sub classes. This Cl removes the class and has the subclass set the object type themselves. This CL also renames the OrdinaryObject type to just Object. Review-Url: https://codereview.chromium.org/2082343003
2016-06-22Update GetClassID to GetElementTypedsinclair
The GetClassID method actually returns the XFA_Element, change the name of the method to be more suggestive of the return value. The GetClassID was sort-of polymorphich and would call down to subclasses. This CL changes the data to be stored on the CXFA_Object class and just returns what is set. The values are set in the constructor as needed. Review-Url: https://codereview.chromium.org/2082573007
2016-06-22Remove unused GetScriptObjHash().dsinclair
Method is never called, remove it and the data variable it uses as it will no longer be used. Review-Url: https://codereview.chromium.org/2088173003
2016-06-22Remove some fx_dib functions with unused parameters.thestig
Review-Url: https://codereview.chromium.org/2075383002
2016-06-22Fix Skia GN build on Macweili
The build has been broken. This should make it compilable. Review-Url: https://codereview.chromium.org/2075343002
2016-06-22Fix memory leaks in EmbedderTest::OpenDocument().thestig
EmbedderTest::OpenDocument() does not gracefully handle the case of being called twice in a given test case. So avoid doing that. Review-Url: https://codereview.chromium.org/2088093002
2016-06-21Use FXFONT defines in place of integers.thestig
Fix nits along the way. Review-Url: https://codereview.chromium.org/2083943003
2016-06-21Convert XFA_ELEMENT to an enum classdsinclair
This CL changes XFA_ELEMENT From an enum to an enum class. The type name was updated to XFA_Element. Review-Url: https://codereview.chromium.org/2089443002
2016-06-21Update the documentation: no longer needs to set clang_use_chrome_pluginsweili
PDFium can be compiled with clang_use_chrome_plugins=true, which is the default setting. So we no longer need to set the variable. BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2085803003
2016-06-21Add win_xfa_clang trybotweili
Also clean up the file by ordering the trybots by names. BUG=chromium:619726 Review-Url: https://codereview.chromium.org/2088533004
2016-06-21Move ifx_renderdevicedriver to a separate file to shareweili
Move ifx_renderdevicedriver class to its own file to share with multiple devices to reduce code duplication. Review-Url: https://codereview.chromium.org/2078783002
2016-06-21Add android to the CQ as a 100% experiment.jbudorick
BUG=pdfium:416 Review-Url: https://codereview.chromium.org/2083993002
2016-06-20Add stackexploit@gmail.com to AUTHORS file.chromium/2777chromium/2776chromium/2774ochang
R=thestig@chromium.org Review-Url: https://codereview.chromium.org/2084663003
2016-06-20Fix clang_use_chrome_plugin for Mac and Skia buildsweili
These changes are specific to Mac and Skia builds. They are needed for these builds to compile with clang_use_chrome_plugin. BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2081523002
2016-06-20Change func(void) to func()weili
Since PDFium is compiled as C++ code, the void keyword is not needed. BUG=pdfium:519 Review-Url: https://codereview.chromium.org/2084603003
2016-06-20openjpeg: Prevent a buffer overflow in opj_j2k_read_SQcd_SQcc.stackexploit
BUG=chromium:619405 R=ochang@chromium.org Review-Url: https://codereview.chromium.org/2071773002
2016-06-20Split the XFA_OBJECTTYPE enum into two parts.dsinclair
Currently the object type and the node flags are both mixed into the single XFA_OBJECTTYPE_* enum. These two things are un-related and should not share a single type. This Cl creates an XFA_ObjectType enum class and a XFA_NodeFlag enum to hold the two types. Accessors are added to determine if the flags are set (or called where they already existed. Review-Url: https://codereview.chromium.org/2083453003
2016-06-20Remove unused CFX_Font members.thestig
Review-Url: https://codereview.chromium.org/2077243002
2016-06-20Another round of fx_ge cleanup.thestig
- Clean up CFX_GEModule. - Remove duplicate #defines in fx_ge.h - Remove IsFontStyleFromCharCode() that always returns true. - Mark a FXTEXT_CHARPOS field as Mac only. Review-Url: https://codereview.chromium.org/2075333002
2016-06-20Fixup LoadImageInfo type checking.dsinclair
The ::DetectImageType method does more then just detecting the image type, it also sets up various needed structures to handle the decoding. Instead of skipping the ::DetectImageType call this CL changes the code to return early if the image check fails. This should allow us to stop working on images which do not match the required data format. BUG=chromium:621094 Review-Url: https://codereview.chromium.org/2085493002
2016-06-20Speculative fix for FXJS_InitializeRuntime crash.dsinclair
The call to GetGlobalObjectTemplate() in FXJS_InitializeRuntime() will call into CFXJS_ObjDefinition::MaxID() which will call FXJS_PerIsolateData() on the provided isolate. We, currently, create the isolate data after we make this call which seems like it would lead to bad things. This CL moves the PerIsolate data creation earlier in the process. BUG=chromium:612918 Review-Url: https://codereview.chromium.org/2069763002
2016-06-18Make code compile with clang_use_chrome_plugin (final)weili
This change mainly contains files in xfa/ and fxjse/ directories which were not covered by previous changes. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. After this change, PDFium can be compiled with "clang_use_chrome_plugin=true" for GN build. Since clang_use_chrome_plugin is true by default, we no longer need to set this parameter explicitly. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2072803002