summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
AgeCommit message (Collapse)Author
2016-09-15Fix memory leaking on ClosePage.chromium/2862art-snake
CFX_FontCache refactoring: after this CL: Only one global CFX_FontCache used. Any cached items from it, are released, when its are not used. BUG=79367,48791 The fonts was not cleared after unloading pages. Test pdf: http://www.nasa.gov/pdf/750614main_NASA_FY_2014_Budget_Estimates-508.pdf For this file, we have ~5 fonts per page, which equal ~1 Mb per page. In this PDF we have 670 pages, as result after slow scrolling(reading) full document we have ~600 Mb fonts data in memory. memory usage of PDF Plugin: before this CL: ~660 Mb after this CL: ~100 Mb Review-Url: https://codereview.chromium.org/2158023002
2016-09-15Rename dictionary set and get methodsdsinclair
This Cl makes the Get and Set methods consistenly use {G|S}et<Type>For. BUG=pdfium:596 Review-Url: https://codereview.chromium.org/2334323005
2016-09-13Sort include entries.dsinclair
This CL updates all of the includes to be correctly sorted. A PRESUBMIT warning is added (from chromium) that will warn if the includes are in the wrong order on upload. Review-Url: https://codereview.chromium.org/2337293002
2016-09-06Make CPDF_TextStateData private to CPDF_TextState.chromium/2853tsepez
Review-Url: https://codereview.chromium.org/2313083002
2016-09-06Move CPDF_GraphState to CFX_GraphStatetsepez
The FX layer is spying on its private data, so make the job of ref-counting it live in FX as well, instead of up a layer at pdfapi. Pre-cursor to making this private and passing the graph state itself everywhere. Review-Url: https://codereview.chromium.org/2314223002
2016-09-06Make CPDF_ContentMarkData private to CPDF_ContentMarktsepez
Review-Url: https://codereview.chromium.org/2312743005
2016-09-06Make ColorStateData private to CPDF_ColorStatetsepez
Review-Url: https://codereview.chromium.org/2311313002
2016-09-03Use safe bool conversion operators in fpdf_page/chromium/2852chromium/2851chromium/2850tsepez
Review-Url: https://codereview.chromium.org/2310693002
2016-09-02Make CPDF_ClipPath have a CPDF_ClipPathData rather than inheriting.tsepez
Make Data private to the ClipPath class which manages it transparently for its callers. This prevents the callers from having to remember to make a copy before dirtying the shared data, since the operations that modify state will do this under the covers for us. Review-Url: https://codereview.chromium.org/2301263003
2016-09-02Remove CFX_Matrix::Copy() in favor of assignmenttsepez
The default assignment operator will suffice and allows us to write matrix1 = matrix2; Review-Url: https://codereview.chromium.org/2307953003
2016-09-02Make CPDF_GeneralStateData private.tsepez
All interaction goes through the CPDF_GeneralState, which manages the underlying storage transparently to the callers. Make StateData use a real string and a real matrix rather than C-style arrays. Review-Url: https://codereview.chromium.org/2302683002
2016-09-02Make CPDF_Path have a CFX_Path rather than inheritingtsepez
Review-Url: https://codereview.chromium.org/2305103002
2016-09-02Make CPDF_GeneralState have a CPDF_GeneralStateDatachromium/2848tsepez
Remove a const cast along the way and propagate to callers. Review-Url: https://codereview.chromium.org/2303553002
2016-09-01Make CPDF_ContentMark have a CPDF_ContentMarkData.tsepez
This one doesn't require an explict Emplace(), as the object seems to get constructed only as a side-effect of making a private copy. Review-Url: https://codereview.chromium.org/2298953002
2016-08-31Make CPDF_ColorState have a CFX_ColorStateData rather than inheritingtsepez
Review-Url: https://codereview.chromium.org/2294133002
2016-08-31Make CPDF_GraphState have a CPDF_GraphStateData instead of inheriting.tsepez
Get callers out of the copy-before-write business, and let the class manage it instead. Review-Url: https://codereview.chromium.org/2292363002
2016-08-30Make CPDF_TextState have a CPDF_TextStateData rather than inheriting one.tsepez
Review-Url: https://codereview.chromium.org/2287313004
2016-08-30More better const-ness in CFX_CountRef<>tsepez
There are a couple of places where code is calling GetObject() that should be calling GetPrivateCopy(), but works because the value may not be shared at the time. This just makes it safer. Review-Url: https://codereview.chromium.org/2290863002
2016-08-29Revert "Add -> operators to CFX_CountRef."tsepez
This reverts commit c10c23a2b1999b1cb0354fd4db9837dc63a3d833. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2285283003
2016-08-29Revert "Replace wrapper methods in CPDF_Path with -> operator."tsepez
This reverts commit d09a09751f724ecdb1a0bc307447a3d0c212ebff. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2291833002
2016-08-29Revert "Use ->() in CPDF_ColorState"tsepez
This reverts commit 91ddd3f7501429222f648b986a99f3959a398889. Reason for revert: may introduce sublte bugs, more thought required. TBR=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2294553002
2016-08-29Use ->() in CPDF_ColorStatetsepez
Move methods to CPDF_ColorStateData. Move MakePrivateCopy() methods to call sites. Remove now-empty cpdf_colorstate.cpp file. Review-Url: https://codereview.chromium.org/2291763002
2016-08-29Replace wrapper methods in CPDF_Path with -> operator.tsepez
These just invoked exaclty the same methodes in the underlying xxxData class, which we can now do with just a ->() Move some methods to the xxxData class, where they belong. In doing so, put MakePrivateCopy() calls at each callsite for those methods that made a copy. Review-Url: https://codereview.chromium.org/2286983002
2016-08-26Add -> operators to CFX_CountRef.chromium/2842tsepez
Allows CFX_CountRefs to behave more like pointers. Rename SetNull() to Clear() for consistency with other ptrs. Change GetPrivateCopy() into MakePrivateCopy() with no return, since the -> operators are clearer than getting an object pointer. Review-Url: https://codereview.chromium.org/2283113002
2016-08-26Make CFX_CountRef<>::m_pObject private, add accessors, fix const-ness.tsepez
Hide the CountedObj class from the rest of the code. Rename GetModify() to GetPrivateCopy(), since it turns out there are places where we modify a potentially-shared copy. Add non-const version of GetObject() to permit these. Review-Url: https://codereview.chromium.org/2287633002
2016-08-26Remove CFX_CountRef::IsNull in favor of operator booltsepez
Review-Url: https://codereview.chromium.org/2285513002
2016-08-26Rework CFX_CountRef in terms of CFX_RetainPtr.tsepez
Make use of existing ref count work rather than re-inventing it. Review-Url: https://codereview.chromium.org/2281683002
2016-08-25Tidy up CFX_PathDatatsepez
Remove friendship with CFX_Path Pack members tighter on 64-bits. Review-Url: https://codereview.chromium.org/2275883004
2016-08-23Fix stack overflow in object Clone() functionsweili
For some complex objects such as CPDF_Dictionary, CPDF_Array, CPDF_Stream, and CPDF_Reference, Clone() could be executed with infinite recursion to cause the stack overflow. Fix this by checking already cloned objects to avoid recursion. BUG=pdfium:513 Review-Url: https://codereview.chromium.org/2250533002
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-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-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-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-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-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-13Make code compile with clang_use_chrome_plugin (part I)weili
This change contains files in core/fpdfapi directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. 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/2060973002
2016-06-07Get rid of NULLs in core/thestig
Review-Url: https://codereview.chromium.org/2032613003
2016-06-06Remove unused PS generation code.thestig
CFX_PSRenderer, IFX_PSOutput, CPSOutput, CPSPrinterDriver. Also reland commit 2d63eaa. Review-Url: https://codereview.chromium.org/2019603002
2016-06-02Fix all the code which has duplicate variable declarationsweili
When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2027273002
2016-06-01Relax checks added in commit 8f3a311.chromium/2760chromium/2759chromium/2758chromium/2757chromium/2756thestig
Some shading types do not use these fields. Review-Url: https://codereview.chromium.org/2027053002
2016-06-01Validate the BitsPerFlag entry in shading dictionaries.thestig
BUG=616248 Review-Url: https://codereview.chromium.org/2020183004
2016-05-31Validate a couple of fields in shading dictionaries.thestig
BUG=616246 Review-Url: https://codereview.chromium.org/2022263003
2016-05-25Remove CFX_PrivateData from CPDF_Pagetsepez
CFX_PrivateData served two purposes here: The first was to hold an opaque pointer to the corresponding page structure in the next higher layer, of which it knows no details. Introduce an empty CPDF_Page::View class to represent this higher class, so as to get type safety while preserving layering. The second was to hold an opaque render context, which it also happened to own. Make this a CFX_Deletable to help with management. Also remove an unused inheritance from CFX_PrivateData in CPDF_Annot. Review-Url: https://codereview.chromium.org/2008553008
2016-05-25get skia buildingcaryclark
Resolve changes to cpdf_shadingpattern.h that prevent Skia from building. R=thestig@chromium.org,dsinclair@chromium.org,reed@google.com BUG= Review-Url: https://codereview.chromium.org/2017463002