summaryrefslogtreecommitdiff
path: root/core/fpdfapi
AgeCommit message (Collapse)Author
2016-08-19Avoid signed overflow in CPDF_ToUnicodeMap::StringToCode()tsepez
It was intended to be unsigned in the first place, and we're perfectly happy with the overflow as long as it is no longer undefined behaviour. BUG=638489 Review-Url: https://codereview.chromium.org/2258053003
2016-08-19Add a fuzzer for CPDF_HintTables.thestig
BUG=636559 Review-Url: https://codereview.chromium.org/2255083004
2016-08-18Add llvm fuzzer for CPDF_PSEnginetsepez
Put class definition into its own header file so fuzzer can find it. Fix a pair of div by 0s immediately hit by the fuzzer. Review-Url: https://codereview.chromium.org/2253193003
2016-08-18Move CFX_UnicodeEncoding and CFX_UnicodeEncodingEx to their own files.npm
Review-Url: https://codereview.chromium.org/2260533002
2016-08-17Split fx_font into multiple files, part 1.npm
Moved classes CFX_FontCache and CFX_AutoFontCache into a separate file. Review-Url: https://codereview.chromium.org/2246223002
2016-08-17Move parser pointer to CPDF_Documentdsinclair
The CPDF_IndirectObjectHolder has two subclasses, CPDF_Document and CFDF_Document. The CPDF document requires the parser and the CFDF document does not. This cl moves the parser pointer up to CPDF_Document. Review-Url: https://codereview.chromium.org/2253723002
2016-08-16Remove two unused members from CPDF_Parsertsepez
Review-Url: https://codereview.chromium.org/2247073005
2016-08-16Rename async to linearized when parsingdsinclair
The parser and document refer to async loading and parsing. The code isn't actually async but loading a linearized PDF. This Cl renames the methods to clarify what the code is doing. The LoadDoc() and LoadLinearizedDoc() methods have been refactored to share a common LoadDocInternal() method. Review-Url: https://codereview.chromium.org/2250163002
2016-08-16Get CPDF_Parser out of the document creation business.tsepez
Precursor to someday using possibly subclassed documents. Review-Url: https://codereview.chromium.org/2248123002
2016-08-15Fix a potential integer overflow in TT2PDF().chromium/2830thestig
BUG=635438 Review-Url: https://codereview.chromium.org/2248473002
2016-08-15Get rid of FX_SMALL_RECT.thestig
Review-Url: https://codereview.chromium.org/2248463002
2016-08-15Use a std::vector in fpdf_font code.thestig
Review-Url: https://codereview.chromium.org/2248453002
2016-08-15add native draw bitmap with alpha maskcaryclark
PDFs draw bitmaps with alpha by supplying an image alpha mask along side the image color data. The alpha mask may not be the same scale as the image data. Skia doesn't have a direct mapping for this draw call, but can come close by using the internal SkCompositeShader class. This scales the alpha mask to match the size of the image data, then puts both in the composite shader to draw. There are more things to do: - Allow Alpha8 or Gray8 to draw scaled to a matching device (blit doesn't work today) Temporary code marked with a TODO implements this functionality. - Refactor PDFium to allow SkComposeShader's components to take a matrix. The latter goal will defer drawing so that PDFium doesn't resize the mask, discarding resolution, before Skia has a chance to record it. Additionally fix drawing text with a negative font size. R=reed@google.com,dsinclair@chromium.org,herb@chromium.org Review-Url: https://codereview.chromium.org/2182763002
2016-08-15Clean up CPDF_HintTables.thestig
Review-Url: https://codereview.chromium.org/2241153002
2016-08-12Avoid an undefined shift in ReadPageHintTable().thestig
Even 39 bits is very generous for the number of bits needed to represent the greatest number of shared object references. BUG=637119 Review-Url: https://codereview.chromium.org/2242723002
2016-08-11Relax a check in CPDF_HintTables.thestig
CPDF_HintTables::ReadSharedObjHintTable() unnecessarily constraints a FX_FILESIZE value to an int32_t. Relax this check, since the result will be stored in |m_szSharedObjOffsetArray| which is of FX_FILESIZE. Bad values in |m_szSharedObjOffsetArray| will still cause hint table loading to eventually fail. BUG=635565 Review-Url: https://codereview.chromium.org/2230883003
2016-08-10Minor cleanup of fpdf_cmapsdsinclair
Cleanup some dead code and c-style casts. Review-Url: https://codereview.chromium.org/2235743003
2016-08-10Clean up CPDF_HintTables::LoadHintStream a little.thestig
- Return earlier when possible. - Fail rather than crash on invalid values. Review-Url: https://codereview.chromium.org/2235843002
2016-08-10Move CFX_RenderDevice, CFX_FxgeDevice, and CFX_GraphStateData into their own ↵npm
files. This is the third CL to separate fx_ge into classes, one per file. All fx_ge.h includes had to be replaced with new includes The method definitions for CFX_FxgeDevice were not moved to a single file. These methods are defined in two folders different from fxge/ge, so they were left untouched for now. Review-Url: https://codereview.chromium.org/2223213002
2016-08-09Fix a leak with FPDFPageObj_NewImgeObj().thestig
BUG=pdfium:545 Review-Url: https://codereview.chromium.org/2194393002
2016-08-09Fix typos of the word outer.thestig
Review-Url: https://codereview.chromium.org/2226003003
2016-08-08Add CPDF_Array::IsEmpty().jaepark
Using IsEmpty() is more readable than using GetCount() == 0. Review-Url: https://codereview.chromium.org/2226113002
2016-08-08Move CFX_ClipRgn and CFX_PathData into their own files.npm
This is the second CL in an attempt to split up the classes in fxge/include/fx_ge.h into their own files. CFX_ClipRgn is moved to core/fxge/ge because it is only used in core/fxge. The header for CFX_PathData is left in core/fxge/include since it is used elsewhere. Review-Url: https://codereview.chromium.org/2216853004
2016-08-05Add CPDF_ImageObject::GetImage().thestig
And use it where appropriate. Review-Url: https://codereview.chromium.org/2224623002
2016-08-04Move CFX_GEModule into its own filenpm
This is the first CL in an attempt to split up the classes in fxge/include/fx_ge.h into their own files. Review-Url: https://codereview.chromium.org/2217663002
2016-08-02Fixup crypto key generation.dsinclair
This CL fixes up the crypto key copying code to better handle big endian machines. BUG=pdfium:147 Review-Url: https://codereview.chromium.org/2190123002
2016-07-29Simplify some FPDF edit functions.thestig
Fix an unlikely memory leak in FPDFPage_InsertObject(). BUG=pdfium:545 Review-Url: https://codereview.chromium.org/2195643002
2016-07-29Cleanup CPDF_DocPageData release methods and callers.thestig
Review-Url: https://codereview.chromium.org/2194853002
2016-07-28Split fpdfdoc/include/fpdf_doc.h into individual classes.dsinclair
This CL splits the header file apart. The cpp files are not touched as part of this CL, they will be done as a followup. This de-duplicates the fpdf_doc.h BUG=pdfium:249 Review-Url: https://codereview.chromium.org/2183313004
2016-07-26Remove unused m_bFirstLayer in CPDF_RenderContext.jaepark
Review-Url: https://codereview.chromium.org/2183933002
2016-07-25Remove FX_FONTCACHE_DEFINEtsepez
This macro isn't buying us anything and reduces transparency. Review-Url: https://codereview.chromium.org/2179953002
2016-07-25Use smart pointers for CFX_Font and CFX_Type3Font classesweili
For the class owned member variables, use std::unique_ptr or std::vector for memory management. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2169793002
2016-07-24Remove CFX_Deletableweili
Change the last use of CFX_Deletable to its actual type and remove the use of CFX_Deletable. Review-Url: https://codereview.chromium.org/2178613002
2016-07-24Use actual type instead CFX_Deletableweili
Change two places that used CFX_Deletable to use actual types. This makes the type more obvious, and avoids unnecessary casts. Review-Url: https://codereview.chromium.org/2180443002
2016-07-21Use smart pointers for graphics device classesweili
Use unique_ptr for class owned member variables. Also clean up some style issues such as removing unused functions and casting to raw pointer. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2163103002
2016-07-20Clean up singleton implementationweili
Move the singleton instances into their namespaces, and use get()/getInstance() for uniform accesses. Review-Url: https://codereview.chromium.org/2154843002
2016-07-19Use smart pointers for various Jbig2 decoding contextsweili
Use unique_ptr for class owned member variables, and remove unnecessary or unused functions and member variable. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2149903002
2016-07-15Use CPDF_Dictionary::SetAtReference instead of CPDF_Dictionary::AddReference.jaepark
The definitions of CPDF_Dictionary::SetAtReference and CPDF_Dictionary::AddReference are identical, and AddReference is only used once. So remove CPDF_Dictionary::AddReference method and use CPDF_Dictionary::SetAtReference instead. Review-Url: https://codereview.chromium.org/2161453002
2016-07-12Replace void* to actual type for jbig2 context to avoid castsweili
Also clear up a few variable names and unnecessary brackets. Review-Url: https://codereview.chromium.org/2143083002
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-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-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-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-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-29Disable failing embedder tests for Skia builds.thestig
BUG=pdfium:525,pdfium:526 Review-Url: https://codereview.chromium.org/2106043002
2016-06-27Clean up some CPDF_Font subclasses.thestig
Review-Url: https://codereview.chromium.org/2093313002
2016-06-27Simplify CPDF_TextRenderer::DrawTextString().thestig
Review-Url: https://codereview.chromium.org/2093033004
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-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-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